forked from murphysecurity/murphysec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
102 lines (96 loc) · 4.71 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
89
90
91
92
93
94
95
96
97
98
99
100
101
stages: # List of stages for jobs, and their order of execution
- build
- internal-pub
- notify
variables:
GOPROXY: https://goproxy.cn,direct
# GOPATH: "$CI_PROJECT_DIR/.go"
# GOBIN: "$CI_PROJECT_DIR/.go/bin"
CGO_ENABLED: '0'
# DENO_DIR: "$CI_PROJECT_DIR/.deno"
# GOCACHE: "$CI_PROJECT_DIR/.go-cache"
compose-build:
tags:
- client-build-shell
image: golang:1.19.2-bullseye
stage: build
artifacts:
expire_in: 1 day
paths:
- out/bin/*
# cache:
# key: cli-build-cache-v3
# paths:
# - .go/pkg/mod/
# - .go-cache/
before_script:
- mkdir -p .go-cache
- mkdir -p .go
rules:
- if: '$CI_COMMIT_TAG == null'
script:
- GOOS=windows GOARCH=amd64 go build -v -ldflags "-s -w -buildid=" -trimpath -o out/bin/murphysec-windows-amd64.exe .
- GOOS=windows GOARCH=arm64 go build -v -ldflags "-s -w -buildid=" -trimpath -o out/bin/murphysec-windows-arm64.exe .
- GOOS=linux GOARCH=amd64 go build -v -ldflags "-s -w -buildid=" -trimpath -o out/bin/murphysec-linux-amd64 .
- GOOS=linux GOARCH=arm64 go build -v -ldflags "-s -w -buildid=" -trimpath -o out/bin/murphysec-linux-arm64 .
- GOOS=darwin GOARCH=amd64 go build -v -ldflags "-s -w -buildid=" -trimpath -o out/bin/murphysec-darwin-amd64 .
- GOOS=darwin GOARCH=arm64 go build -v -ldflags "-s -w -buildid=" -trimpath -o out/bin/murphysec-darwin-arm64 .
compose-build-with-tag:
tags:
- client-build-shell
image: golang:1.19.2-bullseye
stage: build
artifacts:
expire_in: 1 day
paths:
- out/bin/*
# cache:
# key: cli-build-cache-v3
# paths:
# - .go/pkg/mod/
# - .go-cache/
before_script:
- mkdir -p .go-cache
- mkdir -p .go
rules:
- if: '$CI_COMMIT_TAG != null'
script:
- GOOS=windows GOARCH=amd64 go build -v -ldflags "-s -w -X github.com/murphysecurity/murphysec/infra/buildinfo.version=$CI_COMMIT_TAG -buildid=" -trimpath -o out/bin/murphysec-windows-amd64.exe .
- GOOS=windows GOARCH=arm64 go build -v -ldflags "-s -w -X github.com/murphysecurity/murphysec/infra/buildinfo.version=$CI_COMMIT_TAG -buildid=" -trimpath -o out/bin/murphysec-windows-arm64.exe .
- GOOS=linux GOARCH=amd64 go build -v -ldflags "-s -w -X github.com/murphysecurity/murphysec/infra/buildinfo.version=$CI_COMMIT_TAG -buildid=" -trimpath -o out/bin/murphysec-linux-amd64 .
- GOOS=linux GOARCH=arm64 go build -v -ldflags "-s -w -X github.com/murphysecurity/murphysec/infra/buildinfo.version=$CI_COMMIT_TAG -buildid=" -trimpath -o out/bin/murphysec-linux-arm64 .
- GOOS=darwin GOARCH=amd64 go build -v -ldflags "-s -w -X github.com/murphysecurity/murphysec/infra/buildinfo.version=$CI_COMMIT_TAG -buildid=" -trimpath -o out/bin/murphysec-darwin-amd64 .
- GOOS=darwin GOARCH=arm64 go build -v -ldflags "-s -w -X github.com/murphysecurity/murphysec/infra/buildinfo.version=$CI_COMMIT_TAG -buildid=" -trimpath -o out/bin/murphysec-darwin-arm64 .
internal-cos-upload:
image: iseki0/cos-uploader:v1.1.3
stage: internal-pub
artifacts:
expire_in: 1 day
paths:
- out/zip/*
script:
- mkdir out/zip
- bash -c "cd out/bin/ && zip ../zip/pro.zip *"
- cos-uploader --local out/bin/murphysec-windows-amd64.exe --remote /client/$CI_BUILD_REF_NAME/murphysec-windows-amd64.exe
- cos-uploader --local out/bin/murphysec-windows-arm64.exe --remote /client/$CI_BUILD_REF_NAME/murphysec-windows-arm64.exe
- cos-uploader --local out/bin/murphysec-linux-amd64 --remote /client/$CI_BUILD_REF_NAME/murphysec-linux-amd64
- cos-uploader --local out/bin/murphysec-linux-arm64 --remote /client/$CI_BUILD_REF_NAME/murphysec-linux-arm64
- cos-uploader --local out/bin/murphysec-darwin-amd64 --remote /client/$CI_BUILD_REF_NAME/murphysec-darwin-amd64
- cos-uploader --local out/bin/murphysec-darwin-arm64 --remote /client/$CI_BUILD_REF_NAME/murphysec-darwin-arm64
- cos-uploader --local out/zip/pro.zip --remote /client/$CI_BUILD_REF_NAME/pro.zip
- cos-uploader --local out/bin/murphysec-windows-amd64.exe --remote /client/-/murphysec-windows-amd64.exe
- cos-uploader --local out/bin/murphysec-windows-arm64.exe --remote /client/-/murphysec-windows-arm64.exe
- cos-uploader --local out/bin/murphysec-linux-amd64 --remote /client/-/murphysec-linux-amd64
- cos-uploader --local out/bin/murphysec-linux-arm64 --remote /client/-/murphysec-linux-arm64
- cos-uploader --local out/bin/murphysec-darwin-amd64 --remote /client/-/murphysec-darwin-amd64
- cos-uploader --local out/bin/murphysec-darwin-arm64 --remote /client/-/murphysec-darwin-arm64
- cos-uploader --local out/zip/pro.zip --remote /client/-/pro.zip
lark-notify:
image: denoland/deno
stage: notify
cache:
key: cli-deno-cache-1223
paths:
- .deno
script:
- deno run --allow-all ci/lark-push.ts