Skip to content

Commit

Permalink
Merge pull request #336 from ibi-group/upload-branch-jar-again
Browse files Browse the repository at this point in the history
Upload branch jar again
  • Loading branch information
evansiroky authored Sep 2, 2020
2 parents d068810 + 46f3919 commit 732e344
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,23 @@ 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).
- ls target/*.jar
# Copy packaged jar over to deploy dir.
- cp target/dt-*.jar deploy/
# 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"
deploy:
provider: s3
skip_cleanup: true
Expand Down

0 comments on commit 732e344

Please sign in to comment.