From a2e9d6c05c3a2a4788aef83006f03c80135c6c2f Mon Sep 17 00:00:00 2001 From: Evan Siroky Date: Tue, 25 Aug 2020 00:04:02 -0700 Subject: [PATCH 1/5] Revert "ci(travis): remove clean branch cp" This reverts commit 36dc7555f5f2279e2b0d01cae4a9dc04cb16ff87. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 3e21a4cae..9e19fa16c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -85,6 +85,7 @@ before_deploy: - ls target/*.jar # Copy packaged jar over to deploy dir. - cp target/dt-*.jar deploy/ +- cp target/dt-*.jar "deploy/dt-latest-$BRANCH_CLEAN.jar" deploy: provider: s3 skip_cleanup: true From e11b9953b07c1c521f1d2db7e86dc885b9bb7057 Mon Sep 17 00:00:00 2001 From: Evan Siroky Date: Tue, 25 Aug 2020 00:04:30 -0700 Subject: [PATCH 2/5] Revert "ci(travis): remove creation of branch-named jar" This reverts commit 017256aa29574ea3063b9ac6bf8c33dc6809a17f. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9e19fa16c..4bf54e8b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,6 +79,10 @@ after_success: fi fi before_deploy: +# get branch name of current branch for use in jar name: https://graysonkoonce.com/getting-the-current-branch-name-during-a-pull-request-in-travis-ci/ +- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) + # Replace forward slashes with underscores in branch name. +- export BRANCH_CLEAN=${BRANCH//\//_} # Create directory that will contain artifacts to deploy to s3. - mkdir deploy # Display contents of target directory (for logging purposes only). From 47ee28a7770049902fe5d244b8f0f68efdc65481 Mon Sep 17 00:00:00 2001 From: Evan Siroky Date: Mon, 31 Aug 2020 14:34:50 -0700 Subject: [PATCH 3/5] ci: resolve to first jar file during jar deployment --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4bf54e8b8..81fe15f4e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -89,7 +89,10 @@ before_deploy: - ls target/*.jar # Copy packaged jar over to deploy dir. - cp target/dt-*.jar deploy/ -- cp target/dt-*.jar "deploy/dt-latest-$BRANCH_CLEAN.jar" + # get first jar file and copy it into a new file that adds the current branch name +- ALL_JARS=(target/dt-*.jar) +- FIRST_JAR="${ALL_JARS[0]}" +- cp FIRST_JAR "deploy/dt-latest-$BRANCH_CLEAN.jar" deploy: provider: s3 skip_cleanup: true From 5b5504125e2126b7ad104197ad46c4a2bef4f759 Mon Sep 17 00:00:00 2001 From: Evan Siroky Date: Mon, 31 Aug 2020 14:41:11 -0700 Subject: [PATCH 4/5] ci: enclose bash variable with quote --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 81fe15f4e..b9f7b3a8e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -92,7 +92,7 @@ before_deploy: # get first jar file and copy it into a new file that adds the current branch name - ALL_JARS=(target/dt-*.jar) - FIRST_JAR="${ALL_JARS[0]}" -- cp FIRST_JAR "deploy/dt-latest-$BRANCH_CLEAN.jar" +- cp "$FIRST_JAR" "deploy/dt-latest-$BRANCH_CLEAN.jar" deploy: provider: s3 skip_cleanup: true From 46f39194541736607c011693161a11d87161a1b9 Mon Sep 17 00:00:00 2001 From: Evan Siroky Date: Tue, 1 Sep 2020 17:48:48 -0700 Subject: [PATCH 5/5] ci: elaborate a comment a bit --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b9f7b3a8e..e47729302 100644 --- a/.travis.yml +++ b/.travis.yml @@ -89,7 +89,10 @@ before_deploy: - ls target/*.jar # Copy packaged jar over to deploy dir. - cp target/dt-*.jar deploy/ - # get first jar file and copy it into a new file that adds the current branch name + # Get the first jar file and copy it into a new file that adds the current branch name. During a + # merge to master, there are multiple jar files produced, but they're each effectively the same + # code (there may be slight differences in the version shown in the `pom.xml`, but that's not + # important for the purposes of creating this "latest branch" jar). - ALL_JARS=(target/dt-*.jar) - FIRST_JAR="${ALL_JARS[0]}" - cp "$FIRST_JAR" "deploy/dt-latest-$BRANCH_CLEAN.jar"