-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
51 lines (44 loc) · 1.33 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
default:
image: $CI_REGISTRY/docker-hub-proxy/rocker/tidyverse:4.3.2
variables:
CONTAINER_REGISTRY: $CI_REGISTRY
CONTAINER_REGISTRY_USERNAME: $CI_REGISTRY_USER
CONTAINER_REGISTRY_PASSWORD: $CI_REGISTRY_PASSWORD
CONTAINER_REPOSITORY: $SWID
CONTAINER_IMAGE_NAME: $CI_PROJECT_NAME # used for container image name
COMPONENT_NAME: $CI_PROJECT_NAME # used for component name (alias name) in umbrella chart
GIT_STRATEGY: fetch
RENV_PATHS_CACHE: ${CI_PROJECT_DIR}/renv/cache
cache:
key: ${CI_PROJECT_NAME}
paths:
- ${RENV_PATHS_CACHE}
stages:
- deploy_test
- deploy_prod
deploy-job-test:
# ausgeführt wenn push in merge request
stage: deploy_test
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
variables:
APP_NAME: $TEST_NAME
before_script:
- Rscript -e "renv::restore()"
script:
- Rscript -e "renv::status()"
#- Rscript -e "source('data-raw/create_latest_data.R')"
- Rscript -e "source('dev/deploy.R')"
deploy-job-prod:
# ausgeführt wenn Push auf Main branch
stage: deploy_prod
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
variables:
APP_NAME: $PROD_NAME
before_script:
- Rscript -e "renv::restore()"
script:
- Rscript -e "renv::restore()"
#- Rscript -e "source('data-raw/create_latest_data.R')"
- Rscript -e "source('dev/deploy.R')"