forked from vrnetlab/vrnetlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
22 lines (20 loc) · 1.02 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
image: vrnetlab/ci-builder
stages:
- build
build:
stage: build
tags:
- vrnetlab
script:
# make sure we pulled LFS files
- git lfs pull
# We allow the user to control which Docker registry is used through the
# env var DOCKER_REGISTRY. If it is not set then we assume we should use
# the GitLab built-in Docker registry so we check if it is enabled.
# CI_REGISTRY is only set when the GitLab Docker registry is enabled
- if [ -z "${DOCKER_REGISTRY}" ]; then if [ -n "${CI_REGISTRY}" ]; then export DOCKER_USER=gitlab-ci-token; export DOCKER_PASSWORD=${CI_BUILD_TOKEN}; export DOCKER_REGISTRY=${CI_REGISTRY_IMAGE}; fi; fi
- 'echo "DOCKER_REGISTRY: ${DOCKER_REGISTRY}"'
# if DOCKER_REGISTRY set, either explicitly by user or implicitly by GitLab
# (see above) we login to repo, build images and push them
- if [ -n "${DOCKER_REGISTRY}" ]; then docker login -u ${DOCKER_USER} -p=${DOCKER_PASSWORD} ${DOCKER_REGISTRY}; fi
- if [ -n "${DOCKER_REGISTRY}" ]; then make && make docker-push; fi