Skip to content
Snippets Groups Projects
Commit cc03d87f authored by alex's avatar alex Committed by Marcel Loose
Browse files

Improve CI pipeline

parent 1e91001f
No related branches found
No related tags found
1 merge request!209Improve CI pipeline
Pipeline #99844 failed
...@@ -2,7 +2,7 @@ image: docker:latest ...@@ -2,7 +2,7 @@ image: docker:latest
workflow: workflow:
rules: rules:
# don't create a pipeline if its a commit pipeline, on a branch and that branch has open merge requests. # Don't create a pipeline if commit is on a branch with open merge requests
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never when: never
- when: always - when: always
...@@ -21,7 +21,8 @@ variables: ...@@ -21,7 +21,8 @@ variables:
stages: stages:
- versioning - versioning
- build - build
- tests - prepare_tests
- run_tests
- docs - docs
- deploy - deploy
...@@ -51,15 +52,13 @@ versioning: ...@@ -51,15 +52,13 @@ versioning:
# Docker login # Docker login
.prepare: .prepare:
stage: build stage: build
needs: ["versioning"]
image: docker:latest
tags: tags:
- dind - dind
before_script: before_script:
- echo "Logging in as $CI_REGISTRY_USER @ $CI_REGISTRY" - echo "Logging in as $CI_REGISTRY_USER @ $CI_REGISTRY"
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY - echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
# Create and push the integration image to the gitlab registry, if it does not exist. # Create and push the integration image to the gitlab registry, if it does not exist
build_base: build_base:
stage: build stage: build
extends: .prepare extends: .prepare
...@@ -84,15 +83,9 @@ build_base: ...@@ -84,15 +83,9 @@ build_base:
-f Docker/Dockerfile-base . -f Docker/Dockerfile-base .
docker push $INTEGRATION_BASE_IMAGE docker push $INTEGRATION_BASE_IMAGE
fi fi
tags:
- das6
install_linc: install_linc:
stage: build stage: build
needs: ["versioning","build_base"]
image: docker:latest
tags:
- dind
extends: .prepare extends: .prepare
script: script:
- | - |
...@@ -105,9 +98,8 @@ install_linc: ...@@ -105,9 +98,8 @@ install_linc:
- docker push $INTEGRATION_IMAGE - docker push $INTEGRATION_IMAGE
download_data: download_data:
needs: ["versioning","install_linc"]
image: $INTEGRATION_IMAGE image: $INTEGRATION_IMAGE
stage: build stage: prepare_tests
script: script:
- mkdir data && cd data - mkdir data && cd data
- wget -nv https://support.astron.nl/software/ci_data/linc/$TEST_HBA_DATASET_NAME -O $TEST_HBA_DATASET_NAME && tar xfz $TEST_HBA_DATASET_NAME && rm -f $TEST_HBA_DATASET_NAME - wget -nv https://support.astron.nl/software/ci_data/linc/$TEST_HBA_DATASET_NAME -O $TEST_HBA_DATASET_NAME && tar xfz $TEST_HBA_DATASET_NAME && rm -f $TEST_HBA_DATASET_NAME
...@@ -122,9 +114,7 @@ download_data: ...@@ -122,9 +114,7 @@ download_data:
- data - data
validate_scripts: validate_scripts:
stage: tests stage: run_tests
# Versioning required for $INTEGRATION_IMAGE
needs: ["versioning", "download_data"]
image: $INTEGRATION_IMAGE image: $INTEGRATION_IMAGE
script: script:
- | - |
...@@ -136,30 +126,25 @@ validate_scripts: ...@@ -136,30 +126,25 @@ validate_scripts:
((errors == 0)) ((errors == 0))
blsmooth: blsmooth:
stage: tests stage: run_tests
# Versioning required for $INTEGRATION_IMAGE
needs: ["versioning", "download_data"]
image: $INTEGRATION_IMAGE image: $INTEGRATION_IMAGE
script: script:
- cwltool --no-container steps/blsmooth.cwl test_jobs/blsmooth.json - cwltool --no-container steps/blsmooth.cwl test_jobs/blsmooth.json
find_skymodel_cal: find_skymodel_cal:
stage: tests stage: run_tests
needs: ["versioning", "download_data"]
image: $INTEGRATION_IMAGE image: $INTEGRATION_IMAGE
script: script:
- cwltool --no-container --preserve-environment PYTHONPATH steps/find_skymodel_cal.cwl test_jobs/find_skymodel_cal.json - cwltool --no-container --preserve-environment PYTHONPATH steps/find_skymodel_cal.cwl test_jobs/find_skymodel_cal.json
check_ateam_separation: check_ateam_separation:
stage: tests stage: run_tests
needs: ["versioning", "download_data"]
image: $INTEGRATION_IMAGE image: $INTEGRATION_IMAGE
script: script:
- cwltool --no-container --preserve-environment PATH --preserve-environment PYTHONPATH steps/check_ateam_separation.cwl test_jobs/check_ateam_separation.json - cwltool --no-container --preserve-environment PATH --preserve-environment PYTHONPATH steps/check_ateam_separation.cwl test_jobs/check_ateam_separation.json
run_hba_calibrator: run_hba_calibrator:
stage: tests stage: run_tests
needs: ["versioning", "download_data"]
image: $INTEGRATION_IMAGE image: $INTEGRATION_IMAGE
script: script:
- cwltool --no-container --preserve-environment PATH --preserve-environment LINC_DATA_ROOT --preserve-environment PYTHONPATH --outdir results --leave-tmpdir --tmpdir-prefix /tmp/run_hba_calibrator/ workflows/HBA_calibrator.cwl test_jobs/HBA_calibrator.json - cwltool --no-container --preserve-environment PATH --preserve-environment LINC_DATA_ROOT --preserve-environment PYTHONPATH --outdir results --leave-tmpdir --tmpdir-prefix /tmp/run_hba_calibrator/ workflows/HBA_calibrator.cwl test_jobs/HBA_calibrator.json
...@@ -172,8 +157,7 @@ run_hba_calibrator: ...@@ -172,8 +157,7 @@ run_hba_calibrator:
when: on_failure when: on_failure
run_hba_target: run_hba_target:
stage: tests stage: run_tests
needs: ["versioning", "download_data"]
image: $INTEGRATION_IMAGE image: $INTEGRATION_IMAGE
script: script:
- cwltool --no-container --preserve-environment PATH --preserve-environment LINC_DATA_ROOT --preserve-environment PYTHONPATH --outdir results --leave-tmpdir --tmpdir-prefix /tmp/run_hba_target/ workflows/HBA_target.cwl test_jobs/HBA_target.json - cwltool --no-container --preserve-environment PATH --preserve-environment LINC_DATA_ROOT --preserve-environment PYTHONPATH --outdir results --leave-tmpdir --tmpdir-prefix /tmp/run_hba_target/ workflows/HBA_target.cwl test_jobs/HBA_target.json
...@@ -190,8 +174,7 @@ run_hba_target: ...@@ -190,8 +174,7 @@ run_hba_target:
when: on_failure when: on_failure
run_hba_target_selfcal: run_hba_target_selfcal:
stage: tests stage: run_tests
needs: ["versioning", "download_data"]
image: $INTEGRATION_IMAGE image: $INTEGRATION_IMAGE
script: script:
- cwltool --no-container --preserve-environment PATH --preserve-environment LINC_DATA_ROOT --preserve-environment PYTHONPATH --outdir results --leave-tmpdir --tmpdir-prefix /tmp/run_hba_target/ workflows/HBA_target.cwl test_jobs/HBA_target_selfcal.json - cwltool --no-container --preserve-environment PATH --preserve-environment LINC_DATA_ROOT --preserve-environment PYTHONPATH --outdir results --leave-tmpdir --tmpdir-prefix /tmp/run_hba_target/ workflows/HBA_target.cwl test_jobs/HBA_target_selfcal.json
...@@ -208,8 +191,7 @@ run_hba_target_selfcal: ...@@ -208,8 +191,7 @@ run_hba_target_selfcal:
when: on_failure when: on_failure
run_lba_calibrator: run_lba_calibrator:
stage: tests stage: run_tests
needs: ["versioning", "download_data"]
image: $INTEGRATION_IMAGE image: $INTEGRATION_IMAGE
script: script:
- cwltool --no-container --preserve-environment PATH --preserve-environment LINC_DATA_ROOT --preserve-environment PYTHONPATH --outdir results --leave-tmpdir --tmpdir-prefix /tmp/run_lba_calibrator workflows/LBA_calibrator.cwl test_jobs/LBA_calibrator.json - cwltool --no-container --preserve-environment PATH --preserve-environment LINC_DATA_ROOT --preserve-environment PYTHONPATH --outdir results --leave-tmpdir --tmpdir-prefix /tmp/run_lba_calibrator workflows/LBA_calibrator.cwl test_jobs/LBA_calibrator.json
...@@ -222,8 +204,7 @@ run_lba_calibrator: ...@@ -222,8 +204,7 @@ run_lba_calibrator:
when: on_failure when: on_failure
run_lba_target: run_lba_target:
stage: tests stage: run_tests
needs: ["versioning", "download_data"]
image: $INTEGRATION_IMAGE image: $INTEGRATION_IMAGE
script: script:
- cwltool --no-container --preserve-environment PATH --preserve-environment LINC_DATA_ROOT --preserve-environment PYTHONPATH --outdir results --leave-tmpdir --tmpdir-prefix /tmp/run_lba_target/ workflows/LBA_target.cwl test_jobs/LBA_target.json - cwltool --no-container --preserve-environment PATH --preserve-environment LINC_DATA_ROOT --preserve-environment PYTHONPATH --outdir results --leave-tmpdir --tmpdir-prefix /tmp/run_lba_target/ workflows/LBA_target.cwl test_jobs/LBA_target.json
...@@ -241,7 +222,6 @@ run_lba_target: ...@@ -241,7 +222,6 @@ run_lba_target:
build_doc: build_doc:
stage: docs stage: docs
needs: ["versioning", "download_data"]
image: $INTEGRATION_IMAGE image: $INTEGRATION_IMAGE
before_script: before_script:
- apt-get update - apt-get update
...@@ -263,10 +243,6 @@ build_doc: ...@@ -263,10 +243,6 @@ build_doc:
# Deploy to docker hub # Deploy to docker hub
deploy_docker: deploy_docker:
stage: deploy stage: deploy
needs: ["versioning", "download_data"]
image: docker:latest
tags:
- dind
before_script: before_script:
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY - echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
- echo $DH_REGISTRY_PASSWORD | docker login -u $DH_REGISTRY_USER --password-stdin - echo $DH_REGISTRY_PASSWORD | docker login -u $DH_REGISTRY_USER --password-stdin
...@@ -284,8 +260,6 @@ deploy_docker: ...@@ -284,8 +260,6 @@ deploy_docker:
# Deploy a release version # Deploy a release version
deploy_release: deploy_release:
stage: deploy stage: deploy
needs: ["versioning", "download_data"]
image: docker:latest
tags: tags:
- dind - dind
before_script: before_script:
...@@ -315,9 +289,7 @@ deploy_release: ...@@ -315,9 +289,7 @@ deploy_release:
deploy_docker_tag_stable: deploy_docker_tag_stable:
stage: deploy stage: deploy
needs: ["versioning", "download_data"]
when: manual when: manual
image: docker:latest
tags: tags:
- dind - dind
before_script: before_script:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment