-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy path.gitlab-ci.yml
13 lines (13 loc) · 881 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
build-image:
image: docker
services:
- docker:dind
script:
- apk add --no-cache curl
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- version_available=$(curl --write-out %{http_code} --silent --output /dev/null https://gitlab.com/adi90x/rancher-gen-rap/builds/artifacts/$CI_BUILD_REF_NAME/browse?job=compile-go)
- if [ $version_available == "302" ]; then build_version=artifacts/$CI_BUILD_REF_NAME; else build_version="artifacts/master"; fi
- if [ $FORCE_RANCHER_GEN_VERSION != "" ]; then build_version=$FORCE_RANCHER_GEN_VERSION/artifacts; fi
- if [ $CI_BUILD_REF_NAME == "master" ]; then tag="latest"; else tag=$CI_BUILD_REF_NAME; fi
- docker build --build-arg VERSION_RANCHER_GEN=$build_version -t registry.gitlab.com/adi90x/rancher-active-proxy:$tag .
- docker push registry.gitlab.com/adi90x/rancher-active-proxy