From 5c04a3c5b3ce0899d4916f476fe01f74a01ea7af Mon Sep 17 00:00:00 2001 From: Drew Short Date: Wed, 12 Sep 2018 10:50:36 -0500 Subject: [PATCH] Only make release builds for master * Upload those release builds to nexus --- .gitlab-ci.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 29f6023..9c7cfd5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - test - build + - deploy tests: image: rust:1.28.0-jessie @@ -16,6 +17,7 @@ debug: script: - cargo build artifacts: + expire_in: 7 days paths: - target/debug/rsddns tags: @@ -28,7 +30,21 @@ release: - cargo build --release - strip target/release/rsddns artifacts: + expire_in: 7 days paths: - target/release/rsddns tags: - - docker \ No newline at end of file + - docker + only: + - master + +deploy:release: + stage: deploy + script: + - cat Cargo.toml | grep "version =" | awk '{split($0,a,"="); gsub(/ |"/, "", a[2]); print a[2]}' > VERSION + - curl -v -u "$DEPLOYMENT_CREDENTIALS" --upload-file "target/release/rsddns" "$NEXUS_RELEASE_URL/com/sothr/rsddns/$(head -1 ./VERSION)/rsddns" + - curl -v -u "$DEPLOYMENT_CREDENTIALS" --upload-file "VERSION" "$NEXUS_RELEASE_URL/com/sothr/rsddns/latest" + dependencies: + - release + tags: + - linux