-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
88 lines (83 loc) · 2.27 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
variables:
VERSION: "v3.0.0-alpha"
CHARTVERSION: "v3.0.0-alpha"
REGISTRY: "121.40.102.76:30080"
APPGAIA: "gaia"
APPGAIASCHEDULER: "gaia-scheduler"
stages:
- check
- build
ci-check:
stage: check
image:
name: ${REGISTRY}/ci/golang-make:alpine
tags:
- hyperos
- cloud
script:
- go version
- go env -w GOPROXY=https://goproxy.cn,direct
- make fmt-check
- make lint
- go mod tidy
only:
- merge_requests
debug-image:
stage: check
image:
name: ${REGISTRY}/ci/kaniko-executor:debug
entrypoint: ['']
tags:
- hyperos
- cloud
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${REGISTRY}\":{\"auth\":\"$(echo -n ${HARBOR_USERNAME}:${HARBOR_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
- >-
/kaniko/executor
--insecure
--insecure-registry ${REGISTRY}
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--target ${APPGAIA}
--destination "${REGISTRY}/${HARBOR_PROJECT}/${APPGAIA}:${VERSION}-debug"
- >-
/kaniko/executor
--insecure
--insecure-registry ${REGISTRY}
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--target ${APPGAIASCHEDULER}
--destination "${REGISTRY}/${HARBOR_PROJECT}/${APPGAIASCHEDULER}:${VERSION}-debug"
only:
- merge_requests
compile:
stage: build
image:
name: ${REGISTRY}/ci/kaniko-executor:debug
entrypoint: ['']
tags:
- hyperos
- cloud
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"${REGISTRY}\":{\"auth\":\"$(echo -n ${HARBOR_USERNAME}:${HARBOR_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
- >-
/kaniko/executor
--insecure
--insecure-registry ${REGISTRY}
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--target ${APPGAIA}
--destination "${REGISTRY}/${HARBOR_PROJECT}/${APPGAIA}:${VERSION}"
- >-
/kaniko/executor
--insecure
--insecure-registry ${REGISTRY}
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--target ${APPGAIASCHEDULER}
--destination "${REGISTRY}/${HARBOR_PROJECT}/${APPGAIASCHEDULER}:${VERSION}"
only:
- main
# - if: $CI_COMMIT_TAG