Skip to content

Commit be1874b

Browse files
author
Tim Etchells
committed
Fix deploy
1 parent 93ccc05 commit be1874b

File tree

2 files changed

+20
-30
lines changed

2 files changed

+20
-30
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ os:
99

1010
env:
1111
# Will override the Travis web UI settings.
12-
- force_deploy="true"
12+
- skip_tests="true" deploy="true"
1313

1414
sudo: true
1515
cache: npm

travis-scripts/deploy.sh

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,48 +14,38 @@
1414
# To be run from the repository root directory
1515
# $artifact_name must be set and the file it points to must be in the working directory
1616

17-
# In the Travis UI, set the following to do an RC build:
18-
: '
19-
env:
20-
- rc=true
21-
'
22-
23-
# Set force_deploy=true to skip deploy checks and always deploy.
24-
if [[ $force_deploy != "true" ]]; then
25-
if [[ "$rc" != "true" && "$TRAVIS_EVENT_TYPE" != "cron" && -z "$TRAVIS_TAG" ]]; then
26-
echo "$(basename $0): not a release or cronjob, skipping deploy"
27-
exit 0
28-
elif [[ -z "$TRAVIS_TAG" && "$TRAVIS_BRANCH" != "master" ]]; then
29-
echo "$(basename $0): not a tag or master branch, skipping deploy"
30-
exit 0
31-
fi
17+
if [[ $deploy != "true" ]]; then
18+
echo "$(basename $0): skipping deploy"
19+
exit 0
3220
fi
3321

22+
datetime="$(date +'%F-%H%M')"
3423
if [[ -n "$TRAVIS_TAG" ]]; then
3524
echo "Releasing $TRAVIS_TAG"
36-
# No extra tag; just the version eg. 19.1
37-
tag=""
38-
deploy_dir="release"
39-
elif [[ "$rc" == "true" ]]; then
40-
tag="_rc-$(date +'%F-%H%M')"
41-
deploy_dir="rc"
42-
else
43-
tag="_nightly-$(date +'%F-%H%M')"
25+
# No extra build_label; just the version eg. 19.1
26+
build_label=""
27+
deploy_dir="tagged"
28+
elif [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then
29+
build_label="_nightly-${datetime}"
4430
deploy_dir="nightly"
31+
else
32+
branch="$TRAVIS_BRANCH"
33+
build_label="_${branch}"
34+
deploy_dir="${branch}"
4535
fi
4636

47-
echo "Build tag is \"$tag\""
37+
echo "Build label is \"$build_label\""
4838

49-
# Will resolve to something like "microclimate-tools-18.12.0_nightly-2018-12-07-2330.vsix"
50-
tagged_artifact_name="${artifact_name/.vsix/$tag.vsix}"
51-
mv -v "$artifact_name" "$tagged_artifact_name"
39+
# Will resolve to something like "codewind-18.12.0_nightly-2018-12-07-2330.vsix"
40+
labelled_artifact_name="${artifact_name/.vsix/$build_label.vsix}"
41+
mv -v "$artifact_name" "$labelled_artifact_name"
5242

5343
# Update the last_build file linking to the most recent vsix
5444
build_info_file="last_build.html"
5545
#build_date="$(date +'%F_%H-%M_%Z')"
5646
commit_info="$(git log $TRAVIS_BRANCH -3 --pretty='%h by %an - %s<br>')"
5747
# This link is only really useful on DHE
58-
artifact_link="<a href=\"./$tagged_artifact_name\">$tagged_artifact_name</a>"
48+
artifact_link="<a href=\"./$labelled_artifact_name\">$labelled_artifact_name</a>"
5949
printf "Last build: $artifact_link<br><br><b>Latest commits on $TRAVIS_BRANCH:</b><br>$commit_info" > "$build_info_file"
6050

6151
artifactory_path="${artifactory_path}${deploy_dir}"
@@ -64,7 +54,7 @@ echo "artifactory_full_url is $artifactory_full_url"
6454

6555
artifactory_cred_header="X-JFrog-Art-Api: $artifactory_apikey"
6656

67-
artf_resp=$(curl -X PUT -sS -H "$artifactory_cred_header" -T "$tagged_artifact_name" "$artifactory_full_url/$tagged_artifact_name")
57+
artf_resp=$(curl -X PUT -sS -H "$artifactory_cred_header" -T "$labelled_artifact_name" "$artifactory_full_url/$labelled_artifact_name")
6858
echo "$artf_resp"
6959

7060
if [[ "$artf_resp" != *"created"* ]]; then

0 commit comments

Comments
 (0)