-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
46 lines (40 loc) · 959 Bytes
/
.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
stages:
- build
- release
- cleanup
variables:
CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
BUILD_IMAGE: skiniq-ios:$CI_BUILD_REF
build_generic:
stage: build
script:
- docker build -t $BUILD_IMAGE .
except:
- master
- develop
build_staging:
stage: build
script:
- docker build --build-arg API_SERVER=https://staging.skin.hadleylab.com -t $BUILD_IMAGE .
only:
- develop
build_production:
stage: build
script:
- docker build --build-arg API_SERVER=https://skin.hadleylab.com -t $BUILD_IMAGE .
only:
- master
release:
stage: release
script:
- docker tag $BUILD_IMAGE $CONTAINER_RELEASE_IMAGE
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker push $CONTAINER_RELEASE_IMAGE
only:
- master
- develop
cleanup:
stage: cleanup
script:
- bash -c "[ -z $(docker images -q $BUILD_IMAGE) ] || docker rmi $BUILD_IMAGE"
when: always