variables: DOCKER_TLS_CERTDIR: "" stages: - build build-master: image: docker:latest stage: build services: - docker:dind before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - VERSION_1=`grep 'version="*"' core/Dockerfile | cut -d '"' -f2` - IMAGE_1="$CI_REGISTRY_IMAGE/pvs_core" - docker pull "$IMAGE_1":latest || true - docker build --cache-from "$IMAGE_1":latest -t "$IMAGE_1":latest -t "$IMAGE_1":$VERSION_1 core/ - VERSION_2=`grep 'version="*"' preprocessor/Dockerfile | cut -d '"' -f2` - IMAGE_2="$CI_REGISTRY_IMAGE/pvs_preprocessor" - docker pull "$IMAGE_2":latest || true - docker build --cache-from "$IMAGE_2":latest -t "$IMAGE_2":latest -t "$IMAGE_2":$VERSION_2 preprocessor/ - VERSION_3=`grep 'version="*"' client/Dockerfile | cut -d '"' -f2` - IMAGE_3="$CI_REGISTRY_IMAGE/pvs_client" - docker pull "$IMAGE_3":latest || true - docker build --cache-from "$IMAGE_3":latest -t "$IMAGE_3":latest -t "$IMAGE_3":$VERSION_3 client/ - VERSION_4=`grep 'version="*"' cache/Dockerfile | cut -d '"' -f2` - IMAGE_4="$CI_REGISTRY_IMAGE/pvs_cache" - docker pull "$IMAGE_4":latest || true - docker build --cache-from "$IMAGE_4":latest -t "$IMAGE_4":latest -t "$IMAGE_4":$VERSION_4 cache/ - VERSION_5=`grep 'version="*"' fluentd/Dockerfile | cut -d '"' -f2` - IMAGE_5="$CI_REGISTRY_IMAGE/fluentd" - docker pull "$IMAGE_5":latest || true - docker build --cache-from "$IMAGE_5":latest -t "$IMAGE_5":latest -t "$IMAGE_5":$VERSION_5 fluentd/ - VERSION_6=`grep 'version="*"' ingestor/Dockerfile | cut -d '"' -f2` - IMAGE_6="$CI_REGISTRY_IMAGE/pvs_ingestor" - docker pull "$IMAGE_6":latest || true - docker build --cache-from "$IMAGE_6":latest -t "$IMAGE_6":latest -t "$IMAGE_6":$VERSION_6 ingestor/ - cd ./testing && ./gitlab_test.sh && cd - - docker push "$IMAGE_1":$VERSION_1 - docker push "$IMAGE_1":latest - docker push "$IMAGE_2":$VERSION_2 - docker push "$IMAGE_2":latest - docker push "$IMAGE_3":$VERSION_3 - docker push "$IMAGE_3":latest - docker push "$IMAGE_4":$VERSION_4 - docker push "$IMAGE_4":latest - docker push "$IMAGE_5":$VERSION_5 - docker push "$IMAGE_5":latest - docker push "$IMAGE_6":$VERSION_6 - docker push "$IMAGE_6":latest only: - master build: image: docker:latest stage: build services: - docker: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":latest || true - docker build --cache-from "$IMAGE":latest -t "$IMAGE":$CI_COMMIT_REF_SLUG -t "$IMAGE":$CI_COMMIT_REF_NAME core/ - docker tag "$IMAGE:$CI_COMMIT_REF_NAME" "$IMAGE:latest" - IMAGE="$CI_REGISTRY_IMAGE/pvs_preprocessor" - docker pull "$IMAGE":latest || true - docker build --cache-from "$IMAGE":latest -t "$IMAGE":$CI_COMMIT_REF_SLUG -t "$IMAGE":$CI_COMMIT_REF_NAME preprocessor/ - docker tag "$IMAGE:$CI_COMMIT_REF_NAME" "$IMAGE:latest" - IMAGE="$CI_REGISTRY_IMAGE/pvs_client" - docker pull "$IMAGE":latest || true - docker build --cache-from "$IMAGE":latest -t "$IMAGE":$CI_COMMIT_REF_SLUG -t "$IMAGE":$CI_COMMIT_REF_NAME client/ - docker tag "$IMAGE:$CI_COMMIT_REF_NAME" "$IMAGE:latest" - IMAGE="$CI_REGISTRY_IMAGE/pvs_cache" - docker pull "$IMAGE":latest || true - docker build --cache-from "$IMAGE":latest -t "$IMAGE":$CI_COMMIT_REF_SLUG -t "$IMAGE":$CI_COMMIT_REF_NAME cache/ - docker tag "$IMAGE:$CI_COMMIT_REF_NAME" "$IMAGE:latest" - IMAGE="$CI_REGISTRY_IMAGE/fluentd" - docker pull "$IMAGE":latest || true - docker build --cache-from "$IMAGE":latest -t "$IMAGE":$CI_COMMIT_REF_SLUG -t "$IMAGE":$CI_COMMIT_REF_NAME fluentd/ - docker tag "$IMAGE:$CI_COMMIT_REF_NAME" "$IMAGE:latest" - IMAGE="$CI_REGISTRY_IMAGE/pvs_ingestor" - docker pull "$IMAGE":$CI_COMMIT_REF_NAME || true - docker build --cache-from "$IMAGE":latest -t "$IMAGE":$CI_COMMIT_REF_SLUG -t "$IMAGE":$CI_COMMIT_REF_NAME ingestor/ - cd ./testing && ./gitlab_test.sh && cd - except: - master