variables: DOCKER_TLS_CERTDIR: "" stages: - build build-tag: image: registry.gitlab.eox.at/esa/prism/vs/docker-base-testing:latest stage: build services: - docker:19.03.13-dind before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - IMAGE_1="$CI_REGISTRY_IMAGE/pvs_core" - docker pull "$IMAGE_1":latest || true - docker build --cache-from "$IMAGE_1":latest -t "$IMAGE_1":dev -t "$IMAGE_1":$CI_COMMIT_TAG core/ - IMAGE_2="$CI_REGISTRY_IMAGE/pvs_preprocessor" - docker pull "$IMAGE_2":latest || true - docker build --cache-from "$IMAGE_2":latest -t "$IMAGE_2":dev -t "$IMAGE_2":$CI_COMMIT_TAG preprocessor/ - IMAGE_3="$CI_REGISTRY_IMAGE/pvs_client" - docker pull "$IMAGE_3":latest || true - docker build --cache-from "$IMAGE_3":latest -t "$IMAGE_3":dev -t "$IMAGE_3":$CI_COMMIT_TAG client/ - IMAGE_4="$CI_REGISTRY_IMAGE/pvs_cache" - docker pull "$IMAGE_4":latest || true - docker build --cache-from "$IMAGE_4":latest -t "$IMAGE_4":dev -t "$IMAGE_4":$CI_COMMIT_TAG cache/ - IMAGE_5="$CI_REGISTRY_IMAGE/fluentd" - docker pull "$IMAGE_5":latest || true - docker build --cache-from "$IMAGE_5":latest -t "$IMAGE_5":dev -t "$IMAGE_5":$CI_COMMIT_TAG fluentd/ - IMAGE_6="$CI_REGISTRY_IMAGE/pvs_ingestor" - docker pull "$IMAGE_6":latest || true - docker build --cache-from "$IMAGE_6":latest -t "$IMAGE_6":dev -t "$IMAGE_6":$CI_COMMIT_TAG ingestor/ - cd ./testing && ./gitlab_test.sh - if [ $? -ne 0 ]; then exit 1; fi # actually fail build - docker push "$IMAGE_1":$CI_COMMIT_TAG - docker push "$IMAGE_2":$CI_COMMIT_TAG - docker push "$IMAGE_3":$CI_COMMIT_TAG - docker push "$IMAGE_4":$CI_COMMIT_TAG - docker push "$IMAGE_5":$CI_COMMIT_TAG - docker push "$IMAGE_6":$CI_COMMIT_TAG only: - tags artifacts: paths: - /tmp/*.log build-master-staging: image: registry.gitlab.eox.at/esa/prism/vs/docker-base-testing:latest stage: build services: - docker:19.03.13-dind before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - if [[ "$CI_COMMIT_BRANCH" = "master" ]] ; then TAG_USED="latest"; else TAG_USED="staging"; fi - IMAGE_1="$CI_REGISTRY_IMAGE/pvs_core" - docker pull "$IMAGE_1":"$TAG_USED" || true - docker build --cache-from "$IMAGE_1":"$TAG_USED" -t "$IMAGE_1":dev -t "$IMAGE_1":"$TAG_USED" core/ - IMAGE_2="$CI_REGISTRY_IMAGE/pvs_preprocessor" - docker pull "$IMAGE_2":"$TAG_USED" || true - docker build --cache-from "$IMAGE_2":"$TAG_USED" -t "$IMAGE_2":dev -t "$IMAGE_2":"$TAG_USED" preprocessor/ - IMAGE_3="$CI_REGISTRY_IMAGE/pvs_client" - docker pull "$IMAGE_3":"$TAG_USED" || true - docker build --cache-from "$IMAGE_3":"$TAG_USED" -t "$IMAGE_3":dev -t "$IMAGE_3":"$TAG_USED" client/ - IMAGE_4="$CI_REGISTRY_IMAGE/pvs_cache" - docker pull "$IMAGE_4":"$TAG_USED" || true - docker build --cache-from "$IMAGE_4":"$TAG_USED" -t "$IMAGE_4":dev -t "$IMAGE_4":"$TAG_USED" cache/ - IMAGE_5="$CI_REGISTRY_IMAGE/fluentd" - docker pull "$IMAGE_6":"$TAG_USED" || true - docker build --cache-from "$IMAGE_5":"$TAG_USED" -t "$IMAGE_5":dev -t "$IMAGE_5":"$TAG_USED" fluentd/ - IMAGE_6="$CI_REGISTRY_IMAGE/pvs_ingestor" - docker pull "$IMAGE_6":"$TAG_USED" || true - docker build --cache-from "$IMAGE_6":"$TAG_USED" -t "$IMAGE_6":dev -t "$IMAGE_6":"$TAG_USED" ingestor/ - cd ./testing && ./gitlab_test.sh - if [ $? -ne 0 ]; then exit 1; fi # actually fail build - docker push "$IMAGE_1":"$TAG_USED" - docker push "$IMAGE_2":"$TAG_USED" - docker push "$IMAGE_3":"$TAG_USED" - docker push "$IMAGE_4":"$TAG_USED" - docker push "$IMAGE_5":"$TAG_USED" - docker push "$IMAGE_6":"$TAG_USED" only: - staging - master except: - tags artifacts: paths: - /tmp/*.log build: image: registry.gitlab.eox.at/esa/prism/vs/docker-base-testing:latest stage: build services: - docker:19.03.13-dind before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - IMAGE="$CI_REGISTRY_IMAGE/pvs_core" - docker pull "$IMAGE":staging || true - docker build --cache-from "$IMAGE":staging -t "$IMAGE":dev core/ - IMAGE="$CI_REGISTRY_IMAGE/pvs_preprocessor" - docker pull "$IMAGE":staging || true - docker build --cache-from "$IMAGE":staging -t "$IMAGE":dev preprocessor/ - IMAGE="$CI_REGISTRY_IMAGE/pvs_client" - docker pull "$IMAGE":staging || true - docker build --cache-from "$IMAGE":staging -t "$IMAGE":dev client/ - IMAGE="$CI_REGISTRY_IMAGE/pvs_cache" - docker pull "$IMAGE":staging || true - docker build --cache-from "$IMAGE":staging -t "$IMAGE":dev cache/ - IMAGE="$CI_REGISTRY_IMAGE/fluentd" - docker pull "$IMAGE":staging || true - docker build --cache-from "$IMAGE":staging -t "$IMAGE":dev fluentd/ - IMAGE="$CI_REGISTRY_IMAGE/pvs_ingestor" - docker pull "$IMAGE":staging || true - docker build --cache-from "$IMAGE":staging -t "$IMAGE":dev ingestor/ - cd ./testing && ./gitlab_test.sh - if [ $? -ne 0 ]; then exit 1; fi # actually fail build except: - tags - staging - master artifacts: paths: # - /tmp/emg-pvs_cache # - /tmp/emg-pvs_client - /tmp/emg-pvs_database # - /tmp/emg-pvs_fluentd # - /tmp/emg-pvs_ingestor - /tmp/emg-pvs_preprocessor # - /tmp/emg-pvs_redis - /tmp/emg-pvs_registrar - /tmp/emg-pvs_renderer # - /tmp/emg-pvs_seeder # - /tmp/emg-pvs_sftp