-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
30 lines (26 loc) · 1.01 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
.set-tag: &set-tag
- |
if [ -n "${CI_COMMIT_TAG}" ] ; then
# If this build is from a git tag, use that as the docker tag.
export TAG_SPECIFIC="${CI_COMMIT_TAG}"
else
# If this build is from a branch, use the name and sha as the
# docker tag.
export TAG_SPECIFIC="${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}"
fi
image: golang:1.18.4-bullseye
before_script:
- *set-tag
- echo "machine gitlab.com login gitlab-ci-token password ${CI_JOB_TOKEN}" > ~/.netrc
build:
script:
- make SUFFIX=${TAG_SPECIFIC} check build
- |
if [ -n "${CI_COMMIT_TAG}" ] ; then
curl --silent --show-error --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file epicctl "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/epicctl/${CI_COMMIT_TAG}/epicctl"
curl --silent --show-error --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file scripts/scan-logs "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/epicctl/${CI_COMMIT_TAG}/scan-logs"
fi
artifacts:
paths:
- epicctl
- scripts/*