-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
39 lines (32 loc) · 1002 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
stages:
- ci
- deploy
- rm
variables:
IMG_NAME: sdk-ultra96
REG_HOST: docker-registry:443/embedded
SDK_ULTRA96_DIR: /locod/docker/petalinux-sdk/ultra96
build-ci-docker:
stage: ci
tags:
- docker-build
script:
- docker build -t ${IMG_NAME}_ci:ci-${CI_COMMIT_REF_NAME} -f Dockerfile ${SDK_ULTRA96_DIR}
- docker run --rm -t ${IMG_NAME}_ci:ci-${CI_COMMIT_REF_NAME} bash -c 'source /opt/petalinux-sdk/environment-setup-cortexa72-cortexa53-xilinx-linux;echo $CC'
build-deploy:
stage: deploy
tags:
- docker-build
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
script:
- docker image rm ${IMG_NAME}_ci:ci-${CI_COMMIT_REF_NAME}