-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
32 lines (28 loc) · 973 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
stages:
- ci
- deploy
- rm
variables:
IMG_NAME: sdk-ngultra
REG_HOST: docker-registry:443/embedded
build-ci-docker:
stage: ci
tags: [docker-build, VM]
script:
- docker build -t ${IMG_NAME}_ci:ci-${CI_COMMIT_REF_NAME} --build-arg NX_USERNAME=${NX_USERNAME} --build-arg NX_PERSONAL_ACCESS_TOKEN=${NX_PERSONAL_ACCESS_TOKEN} -f Dockerfile .
- docker run --rm -t ${IMG_NAME}_ci:ci-${CI_COMMIT_REF_NAME} bash -c 'arm-none-eabi-gcc --version'
build-deploy:
stage: deploy
tags: [docker-build, VM]
only:
- tags
script:
- docker tag ${IMG_NAME}_ci:ci-${CI_COMMIT_REF_NAME} ${REG_HOST}/${IMG_NAME}:$CI_COMMIT_TAG
- docker image tag ${REG_HOST}/${IMG_NAME}:$CI_COMMIT_TAG ${REG_HOST}/${IMG_NAME}:latest
- docker push ${REG_HOST}/${IMG_NAME}:latest
- docker push ${REG_HOST}/${IMG_NAME}:$CI_COMMIT_TAG
remove-tmp-img:
stage: rm
tags: [docker-build, VM]
script:
- docker image rm ${IMG_NAME}_ci:ci-${CI_COMMIT_REF_NAME}