-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
37 lines (35 loc) · 1 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
variables:
BILLING_TAG: $CI_REGISTRY_IMAGE:billing-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHA
BILLING_LATEST_TAG: $CI_REGISTRY_IMAGE:billing-latest
BUILD_TAG: $CI_REGISTRY_IMAGE:builder-$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHA
BUILD_LATEST_TAG: $CI_REGISTRY_IMAGE:builder-latest
stages:
- build
services:
- docker:dind
build-billing-job:
image: docker:latest
only:
- dashboard
- master
stage: build
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- cd billing
- docker build -t $BILLING_TAG .
- docker tag $BILLING_TAG $BILLING_LATEST_TAG
- docker push $BILLING_TAG
- docker push $BILLING_LATEST_TAG
build-builder-job:
image: docker:latest
only:
- dashboard
- master
stage: build
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- cd build
- docker build -t $BUILDER_TAG .
- docker tag $BUILDER_TAG $BUILDER_LATEST_TAG
- docker push $BUILDER_TAG
- docker push $BUILDER_LATEST_TAG