-
Notifications
You must be signed in to change notification settings - Fork 7
/
.gitlab-ci.yml
48 lines (41 loc) · 1.3 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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
variables:
DOCKER_REPOSITORY: registry.mender.io/cfengine/cfbuild
DOCKERFILE: Dockerfile
include:
- project: 'Northern.tech/Mender/mendertesting'
file: '.gitlab-ci-check-docker-build.yml'
- project: 'Northern.tech/Mender/mendertesting'
file: '.gitlab-ci-check-docker-deploy.yml'
stages:
- build
- publish
- sync
build:docker:
rules:
- if: '$CI_COMMIT_BRANCH =~ /^(master|production)$/'
script:
- echo "building ${CI_PROJECT_NAME} for ${DOCKER_BUILD_SERVICE_IMAGE}"
- docker build
--tag $DOCKER_BUILD_SERVICE_IMAGE
--file ${DOCKER_DIR:-.}/${DOCKERFILE:-Dockerfile}
--build-arg GIT_COMMIT_TAG="${DOCKER_PUBLISH_COMMIT_TAG}"
--build-arg GITHUB_USERNAME_TOKEN
${DOCKER_DIR:-.}
- docker save $DOCKER_BUILD_SERVICE_IMAGE > image.tar
publish:image:
rules:
- if: '$CI_COMMIT_BRANCH =~ /^(master|production)$/'
publish:image:mender:
rules:
- when: never
sync:image:
rules:
- if: '$CI_COMMIT_BRANCH == "production"'
variables:
TARGET_MANIFEST_FILE: "kubernetes/build-cfengine-com/build-cfengine-com-deployment.yaml"
sync:image:staging:
extends: sync:image
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
variables:
TARGET_MANIFEST_FILE: "kubernetes/staging-build-cfengine-com/staging-build-cfengine-com-deployment.yaml"