update ci config

This commit is contained in:
Smart-SangGe 2022-08-01 18:07:12 +08:00
parent 5335755b91
commit aa206d25eb

View File

@ -9,13 +9,11 @@ variables:
stages:
- build
- deploy
- release
cache: # 缓存
paths:
- bin
job_build:
bin_build:
stage: build
image: golang:latest
script:
@ -24,12 +22,14 @@ job_build:
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file ${LINUX_AMD64_BINARY} "${PACKAGE_REGISTRY_URL}/${LINUX_AMD64_BINARY}"
artifacts:
paths:
- bin
- .
docker_build:
stage: build
script:
- docker build -t console:${PACKAGE_VERSION} .
release:
# Caution, as of 2021-02-02 these assets links require a login, see:
# https://gitlab.com/gitlab-org/gitlab/-/issues/299384
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
@ -37,4 +37,8 @@ release:
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"${LINUX_AMD64_BINARY}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${LINUX_AMD64_BINARY}\"}"
docker_deploy:
stage: deploy
script:
- docker tag console:${PACKAGE_VERSION} reg.sre.victor-core.top/cobalt-strike/REPOSITORY:${PACKAGE_VERSION}
- docker push reg.sre.victor-core.top/cobalt-strike/REPOSITORY:${PACKAGE_VERSION}