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
3220fi
3321
22+ datetime=" $( date +' %F-%H%M' ) "
3423if [[ -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} "
4535fi
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
5444build_info_file=" last_build.html"
5545# build_date="$(date +'%F_%H-%M_%Z')"
5646commit_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>"
5949printf " Last build: $artifact_link <br><br><b>Latest commits on $TRAVIS_BRANCH :</b><br>$commit_info " > " $build_info_file "
6050
6151artifactory_path=" ${artifactory_path}${deploy_dir} "
@@ -64,7 +54,7 @@ echo "artifactory_full_url is $artifactory_full_url"
6454
6555artifactory_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 " )
6858echo " $artf_resp "
6959
7060if [[ " $artf_resp " != * " created" * ]]; then
0 commit comments