Skip to content

Commit 7f86de7

Browse files
another try at pushing to github
1 parent a40bcff commit 7f86de7

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,7 @@ notifications:
4040
4141
on_success: change
4242
on_failure: always
43+
44+
env:
45+
global:
46+
- ENCRYPTION_LABEL: "7a1322f4b03c"

.travis/deploy.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,28 @@ then
5151
echo "on a tag -> set pom.xml <version> to next SNAPSHOT $new_snapshot"
5252
mvn --settings .travis/mvnsettings.xml org.codehaus.mojo:versions-maven-plugin:2.3:set -DnewVersion=$new_snapshot
5353
mvn --settings .travis/mvnsettings.xml org.codehaus.mojo:versions-maven-plugin:2.3:commit
54+
# Save some useful information
55+
REPO=`git config remote.origin.url`
56+
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
57+
git clone $REPO out
58+
# Clean out existing contents
59+
cd out
5460
git config user.name "Travis CI"
5561
git config user.email "[email protected]"
56-
git remote add upstream "https://$GITHUB_API_TOKEN@github.com/CurrencyFair/OneSignal-Java-SDK.git"
57-
git fetch upstream
62+
yes | cp -f ../pom.xml pom.xml
5863
git add pom.xml
5964
git commit -m "[Travis-CI] next snapshot version"
60-
git push --quiet upstream master > /dev/null 2>&1
65+
66+
# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc
67+
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
68+
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
69+
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
70+
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
71+
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in .travis/deploy_key.enc -out .travis/deploy_key -d
72+
chmod 600 .travis/deploy_key
73+
eval `ssh-agent -s`
74+
ssh-add .travis/deploy_key
75+
76+
# Now that we're all set up, we can push.
77+
git push $SSH_REPO $TARGET_BRANCH
6178
fi

.travis/deploy_key.enc

3.17 KB
Binary file not shown.

0 commit comments

Comments
 (0)