Newer
Older
variables:
DOCKER_TLS_CERTDIR: ""
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- 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/
- docker pull "$IMAGE_3":latest || true
- docker build --cache-from "$IMAGE_3":latest -t "$IMAGE_3":dev -t "$IMAGE_3":$CI_COMMIT_TAG client/
- 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/
- if [ $? -ne 0 ]; then exit 1; fi # actually fail build
- docker push "$IMAGE_6":latest
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
build-staging:
image: docker:latest
stage: build
services:
- docker: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":staging || true
- docker build --cache-from "$IMAGE_1":staging -t "$IMAGE_1":dev -t "$IMAGE_1":staging core/
- IMAGE_2="$CI_REGISTRY_IMAGE/pvs_preprocessor"
- docker pull "$IMAGE_2":staging || true
- docker build --cache-from "$IMAGE_2":staging -t "$IMAGE_2":dev -t "$IMAGE_2":staging preprocessor/
- IMAGE_3="$CI_REGISTRY_IMAGE/pvs_client"
- docker pull "$IMAGE_3":staging || true
- docker build --cache-from "$IMAGE_3":staging -t "$IMAGE_3":dev -t "$IMAGE_3":staging client/
- IMAGE_4="$CI_REGISTRY_IMAGE/pvs_cache"
- docker pull "$IMAGE_4":staging || true
- docker build --cache-from "$IMAGE_4":staging -t "$IMAGE_4":dev -t "$IMAGE_4":staging cache/
- IMAGE_5="$CI_REGISTRY_IMAGE/fluentd"
- docker pull "$IMAGE_5":staging || true
- docker build --cache-from "$IMAGE_5":staging -t "$IMAGE_5":dev -t "$IMAGE_5":staging fluentd/
- IMAGE_6="$CI_REGISTRY_IMAGE/pvs_ingestor"
- docker pull "$IMAGE_6":staging || true
- docker build --cache-from "$IMAGE_6":staging -t "$IMAGE_6":dev -t "$IMAGE_6":staging ingestor/
- cd ./testing && ./gitlab_test.sh
- if [ $? -ne 0 ]; then exit 1; fi # actually fail build
- docker push "$IMAGE_1":staging
- docker push "$IMAGE_2":staging
- docker push "$IMAGE_3":staging
- docker push "$IMAGE_4":staging
- docker push "$IMAGE_5":staging
- docker push "$IMAGE_6":staging
only:
- staging
build:
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker pull "$IMAGE":staging || true
- docker build --cache-from "$IMAGE":staging -t "$IMAGE":dev core/
- docker pull "$IMAGE":staging || true
- docker build --cache-from "$IMAGE":staging -t "$IMAGE":dev preprocessor/
- docker pull "$IMAGE":staging || true
- docker build --cache-from "$IMAGE":staging -t "$IMAGE":dev client/
- 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