EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 058fb7c8 authored by Lubomir Dolezal's avatar Lubomir Dolezal
Browse files

update gitlab ci

parent 6433573e
Branches
Tags
2 merge requests!36Staging to master to prepare 1.0.0 release,!33Builds bumpversion
......@@ -4,7 +4,6 @@ variables:
stages:
- build
build-tags:
image: docker:latest
stage: build
......@@ -13,46 +12,76 @@ build-tags:
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":dev -t "$IMAGE_1":$VERSION_1 core/
- VERSION_2=`grep 'version="*"' preprocessor/Dockerfile | cut -d '"' -f2`
- 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":$VERSION_2 preprocessor/
- VERSION_3=`grep 'version="*"' client/Dockerfile | cut -d '"' -f2`
- 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":$VERSION_3 client/
- VERSION_4=`grep 'version="*"' cache/Dockerfile | cut -d '"' -f2`
- 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":$VERSION_4 cache/
- VERSION_5=`grep 'version="*"' fluentd/Dockerfile | cut -d '"' -f2`
- 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":$VERSION_5 fluentd/
- VERSION_6=`grep 'version="*"' ingestor/Dockerfile | cut -d '"' -f2`
- 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":$VERSION_6 ingestor/
- 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":$VERSION_1
- docker push "$IMAGE_1":$CI_COMMIT_TAG
- docker push "$IMAGE_1":latest
- docker push "$IMAGE_2":$VERSION_2
- docker push "$IMAGE_2":$CI_COMMIT_TAG
- docker push "$IMAGE_2":latest
- docker push "$IMAGE_3":$VERSION_3
- docker push "$IMAGE_3":$CI_COMMIT_TAG
- docker push "$IMAGE_3":latest
- docker push "$IMAGE_4":$VERSION_4
- docker push "$IMAGE_4":$CI_COMMIT_TAG
- docker push "$IMAGE_4":latest
- docker push "$IMAGE_5":$VERSION_5
- docker push "$IMAGE_5":$CI_COMMIT_TAG
- docker push "$IMAGE_5":latest
- docker push "$IMAGE_6":$VERSION_6
- docker push "$IMAGE_6":$CI_COMMIT_TAG
- docker push "$IMAGE_6":latest
only:
- tags
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
......@@ -62,24 +91,25 @@ build:
- 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":dev 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":latest || true
- docker build --cache-from "$IMAGE":latest -t "$IMAGE":dev 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":latest || true
- docker build --cache-from "$IMAGE":latest -t "$IMAGE":dev 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":latest || true
- docker build --cache-from "$IMAGE":latest -t "$IMAGE":dev cache/
- docker pull "$IMAGE":staging || true
- docker build --cache-from "$IMAGE":staging -t "$IMAGE":dev cache/
- IMAGE="$CI_REGISTRY_IMAGE/fluentd"
- docker pull "$IMAGE":latest || true
- docker build --cache-from "$IMAGE":latest -t "$IMAGE":dev 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":latest || true
- docker build --cache-from "$IMAGE":latest -t "$IMAGE":dev 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment