Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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