Commit d9513a51 authored by Cresson Remi's avatar Cresson Remi
Browse files

CI: fix the CI

1 merge request!4ADD: use otbtf 3.2.1 in unit tests
Pipeline #36500 failed with stages
in 25 minutes and 41 seconds
Showing with 21 additions and 7 deletions
+21 -7
workflow: workflow:
rules: rules:
- if: $CI_MERGE_REQUEST_ID # Execute jobs in merge request context - if: $CI_MERGE_REQUEST_ID || $CI_COMMIT_REF_NAME =~ /master/ # Execute jobs in merge request context, or commit in master branch
- if: $CI_COMMIT_BRANCH == 'master' # Execute jobs when a new commit is pushed to master branch
stages: stages:
- Docker build - Docker build
- Static Analysis - Static Analysis
- Tests - Tests
- Ship
Build the docker image: .dind_base:
stage: Docker build
allow_failure: false
tags: [dind] tags: [dind]
image: docker/compose:1.29.2 image: docker/compose:1.29.2
variables: variables:
...@@ -24,6 +23,13 @@ Build the docker image: ...@@ -24,6 +23,13 @@ Build the docker image:
# we use $CI_REGISTRY_PASSWORD here which is a special variable provided by GitLab # we use $CI_REGISTRY_PASSWORD here which is a special variable provided by GitLab
# https://docs.gitlab.com/ce/ci/variables/predefined_variables.html # https://docs.gitlab.com/ce/ci/variables/predefined_variables.html
- echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY - echo -n $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
Build the docker image:
stage: Docker build
allow_failure: false
extends: .dind_base
except:
- master
script: script:
- docker info - docker info
- > - >
...@@ -39,8 +45,6 @@ Build the docker image: ...@@ -39,8 +45,6 @@ Build the docker image:
--build-arg "BASE_IMAGE=gitlab-registry.irstea.fr/remi.cresson/otbtf/3.2.1:cpu-basic-dev" --build-arg "BASE_IMAGE=gitlab-registry.irstea.fr/remi.cresson/otbtf/3.2.1:cpu-basic-dev"
. .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:latest
.static_analysis_base: .static_analysis_base:
image: $CI_REGISTRY_IMAGE:latest image: $CI_REGISTRY_IMAGE:latest
...@@ -125,3 +129,13 @@ train_from_tfrecords: ...@@ -125,3 +129,13 @@ train_from_tfrecords:
script: script:
- pytest -o log_cli=true --log-cli-level=INFO --junitxml=report_train_from_tfrecords.xml tests/train_from_tfrecords_unittest.py - pytest -o log_cli=true --log-cli-level=INFO --junitxml=report_train_from_tfrecords.xml tests/train_from_tfrecords_unittest.py
deploy:
stage: Ship
only:
- master
extends: .dind_base
script:
- echo "Shipping!"
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:latest
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment