summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author杨威 <[email protected]>2019-05-23 10:19:23 +0800
committer杨威 <[email protected]>2019-05-23 10:19:23 +0800
commit4dee4456ca0b8ad9490cbc90e70fcf1cf99b70d7 (patch)
tree4065972b10dc276cf79f3fce2f85a105a6448adc
parentccc3dc3b30051b3590db2439a015f3abd01e15f0 (diff)
Update .gitlab-ci.yml
-rw-r--r--.gitlab-ci.yml4
1 files changed, 3 insertions, 1 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6e87938..4c585bf 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -38,6 +38,8 @@ build:
.create_release_cmd: &create_release_cmd |
echo -e "curl --header 'Content-Type: application/json' --header \"PRIVATE-TOKEN: $TOKEN\" --data '{ \"name\": \"$CI_COMMIT_TAG.zip\", \"tag_name\": \"$CI_COMMIT_TAG\", \"description\": \"$CI_COMMIT_MESSAGE \", \"assets\": { \"links\": [{ \"name\": \"$CI_PROJECT_NAME_$CI_COMMIT_TAG.zip\", \"url\": \"$CI_PROJECT_URL/-/jobs/artifacts/$CI_COMMIT_TAG/download?job=$ARTIFACTS_JOB\" }] } }' --request POST $CI_API_V4_URL/projects/$CI_PROJECT_ID/releases/"""| /bin/bash
+.upload_artifacts_script: &upload_artifacts_script
+ res=`*get_release_cmd` && if [[ $res =~ "200" ]]; then *create_link_cmd; else *create_release_cmd; fi
release:
stage: release
tags:
@@ -45,4 +47,4 @@ release:
only:
- tags
script:
- - res=`*get_release_cmd` && if [[ $res =~ "200" ]]; then *create_link_cmd; else *create_release_cmd; fi \ No newline at end of file
+ - *upload_artifacts_script \ No newline at end of file