-
Notifications
You must be signed in to change notification settings - Fork 96
Expand file tree
/
Copy pathdeploy_snapshot.sh
More file actions
executable file
·28 lines (25 loc) · 1.15 KB
/
deploy_snapshot.sh
File metadata and controls
executable file
·28 lines (25 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
#
# Deploy a jar, source jar, and javadoc jar to Sonatype's snapshot repo.
#
# Adapted from https://coderwall.com/p/9b_lfq and
# http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/
REPO="analytics-java"
USERNAME="segmentio"
JDK="oraclejdk8"
BRANCH="master"
set -e
if [ "$CIRCLE_PROJECT_REPONAME" != "$REPO" ]; then
echo "Skipping snapshot deployment: wrong repository. Expected '$REPO' but was '$CIRCLE_PROJECT_REPONAME'."
elif [ "$CIRCLE_PROJECT_USERNAME" != "$USERNAME" ]; then
echo "Skipping snapshot deployment: wrong owner. Expected '$USERNAME' but was '$CIRCLE_PROJECT_USERNAME'."
elif [ "$CIRCLE_JDK_VERSION" != "$JDK" ]; then
# $CIRCLE_JDK_VERSION must be manually set in circle.yml
echo "Skipping snapshot deployment: wrong JDK. Expected '$JDK' but was '$CIRCLE_JDK_VERSION'."
elif [ "$CIRCLE_BRANCH" != "$BRANCH" ]; then
echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$CIRCLE_BRANCH'."
else
echo "Deploying snapshot..."
mvn clean source:jar javadoc:jar deploy --settings=".buildscript/settings.xml" -Dmaven.test.skip=true -Dgpg.skip=true
echo "Snapshot deployed!"
fi