Skip to content
Snippets Groups Projects
Commit e4067e15 authored by Reto Gerber's avatar Reto Gerber
Browse files

Update .gitlab-ci.yml file

parent 7024e4c0
No related branches found
No related tags found
No related merge requests found
Pipeline #59649 canceled
...@@ -5,6 +5,7 @@ variables: ...@@ -5,6 +5,7 @@ variables:
stages: stages:
- build - build
- update
- deploy - deploy
image_build: image_build:
...@@ -13,17 +14,18 @@ image_build: ...@@ -13,17 +14,18 @@ image_build:
before_script: before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN http://$CI_REGISTRY - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN http://$CI_REGISTRY
script: | script: |
CI_COMMIT_SHA_7=$(echo $CI_COMMIT_SHA | cut -c1-7) docker build --no-cache --tag $CI_REGISTRY_IMAGE:latest .
docker build --no-cache --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7 . docker push $CI_REGISTRY_IMAGE:latest
docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7
#docker build --no-cache --tag $CI_REGISTRY_IMAGE:latest .
#docker push $CI_REGISTRY_IMAGE:latest
#CI_COMMIT_SHA_7=$(echo $CI_COMMIT_SHA | cut -c1-7)
#docker build --no-cache --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7 .
#docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7
except:
variables:
- $CI_PROJECT_URL == "https://gitlab.uzh.ch/retogerber/metrics-collect"
retrieve_data: retrieve_data:
stage: deploy stage: update
image: image:
name: $CI_REGISTRY_IMAGE:latest name: $CI_REGISTRY_IMAGE:latest
entrypoint: [""] entrypoint: [""]
...@@ -32,9 +34,29 @@ retrieve_data: ...@@ -32,9 +34,29 @@ retrieve_data:
- web - web
- triggers - triggers
- pushes - pushes
before_script: before_script:
- source src/dataset_utils.sh - echo ${CI_PROJECT_NAME}
script: | - echo ${CI_COMMIT_BRANCH}
R -e "print(list.files(paste0(getwd(),'/src')))" - git config --global user.name "Reto Gerber"
#rmarkdown::render(paste0(getwd(),'/src/getting_bettr_friendly_datasets.Rmd'))" - git config --global user.email "reto.gerber@uzh.ch"
#import_datasets_by_keyword performance - url_host=`git remote get-url origin | sed -e "s/https:\/\/gitlab-ci-token:.*@//g"`
\ No newline at end of file - cd /tmp/
- git clone "https://oauth2:${CI_PUSH_TOKEN}@${url_host}"
- cd ${CI_PROJECT_NAME}
- git checkout ${CI_COMMIT_BRANCH}
script:
- R -e 'rmarkdown::render("src/getting_bettr_friendly_datasets.Rmd")' && cp src/getting_bettr_friendly_datasets.html public/getting_bettr_friendly_datasets.html
- git add public/getting_bettr_friendly_datasets.html && git commit -m "Commit public/getting_bettr_friendly_datasets.html by CI" && git push
pages:
stage: deploy
image: alpine:latest
script:
- echo 'Nothing to do...'
artifacts:
paths:
- public
only:
variables:
- $CI_PROJECT_URL == "https://gitlab.uzh.ch/retogerber/metrics-collect"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment