forked from zarf-dev/zarf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
72 lines (67 loc) · 2.04 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
stages:
- build
- package
- upload
- release
.only-default: &only-default
only:
- master
- merge_requests
- tags
compile:
only:
- branches
- merge_requests
- tags
stage: build
image: golang:1.16
script:
- make build-cli
artifacts:
paths:
- build/
package:
<<: *only-default
stage: package
needs:
- job: compile
artifacts: true
tags:
- bigbang
- packages
image: golang:1.16
before_script:
- ./build/zarf tools registry login registry1.dso.mil --username "$REGISTRY1_USERNAME_ZARF_ROBOT" --password "$REGISTRY1_PASSWORD_ZARF_ROBOT"
script:
- make ci-release
after_script:
- echo "PACKAGE_JOB_ID=$CI_JOB_ID" >> job.env
artifacts:
reports:
dotenv: job.env
paths:
- build/
artifact-upload:
image: amazon/aws-cli
stage: upload
needs:
- job: package
artifacts: true
rules:
- if: $CI_COMMIT_TAG
script:
- aws s3 cp build s3://zarf-public/release/$CI_COMMIT_TAG --region us-gov-west-1 --recursive
generate-release:
image: registry.gitlab.com/gitlab-org/release-cli:v0.8.0
stage: release
rules:
- if: $CI_COMMIT_TAG
needs:
- job: artifact-upload
script:
- release-cli create --name "Zarf ${CI_COMMIT_TAG}" --tag-name "${CI_COMMIT_TAG}" --description "Zarf K8s Airgap Buddy"
--assets-link "{\"name\":\"zarf\",\"url\":\"https://zarf-public.s3-us-gov-west-1.amazonaws.com/release/$CI_COMMIT_TAG/zarf\"}"
--assets-link "{\"name\":\"zarf-mac-apple\",\"url\":\"https://zarf-public.s3-us-gov-west-1.amazonaws.com/release/$CI_COMMIT_TAG/zarf-mac-apple\"}"
--assets-link "{\"name\":\"zarf-mac-intel\",\"url\":\"https://zarf-public.s3-us-gov-west-1.amazonaws.com/release/$CI_COMMIT_TAG/zarf-mac-intel\"}"
--assets-link "{\"name\":\"zarf-init.tar.zst\",\"url\":\"https://zarf-public.s3-us-gov-west-1.amazonaws.com/release/$CI_COMMIT_TAG/zarf-init.tar.zst\"}"
--assets-link "{\"name\":\"zarf.sha256\",\"url\":\"https://zarf-public.s3-us-gov-west-1.amazonaws.com/release/$CI_COMMIT_TAG/zarf.sha256\"}"