Skip to content

Commit 6ec9d77

Browse files
another try at pushing to github from travis
1 parent b6c7c2d commit 6ec9d77

File tree

5 files changed

+26
-15
lines changed

5 files changed

+26
-15
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ target
2929
out
3030
build
3131

32-
.travis/deploy_rsa
32+
.travis/deploy_key

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,8 @@ notifications:
4343
4444
on_success: change
4545
on_failure: always
46+
47+
env:
48+
global:
49+
- GIT_NAME="Mateusz Bajorek"
50+
- GIT_EMAIL="[email protected]"

.travis/after_deploy.sh

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,31 @@ increment_version_to_next_snapshot ()
2121
# increment version to the next snapshot version, commit and push to repository
2222
if [ ! -z "$TRAVIS_TAG" ]
2323
then
24+
# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc
25+
openssl aes-256-cbc -K $encrypted_541ac7960f0d_key -iv $encrypted_541ac7960f0d_iv -in .travis/deploy_key.enc -out .travis/deploy_key -d
26+
chmod 600 .travis/deploy_key
27+
eval `ssh-agent -s`
28+
ssh-add .travis/deploy_key
29+
git config --global user.name "$GIT_NAME"
30+
git config --global user.email "$GIT_EMAIL"
31+
32+
# increment version to the next snapshot version
2433
increment_version_to_next_snapshot $TRAVIS_TAG
2534
echo "on a tag -> set pom.xml <version> to next SNAPSHOT $new_snapshot"
26-
git remote add upstream [email protected]:CurrencyFair/OneSignal-Java-SDK.git
27-
git fetch --all
28-
git checkout master
2935
mvn --settings .travis/mvnsettings.xml org.codehaus.mojo:versions-maven-plugin:2.3:set -DnewVersion=$new_snapshot
3036
mvn --settings .travis/mvnsettings.xml org.codehaus.mojo:versions-maven-plugin:2.3:commit
37+
3138
# Save some useful information
32-
git config user.name "Travis CI"
33-
git config user.email "[email protected]"
39+
REPO=$(git config remote.origin.url)
40+
REPO=${REPO/https:\/\/github.com\//git@github.com:}
41+
REPO_NAME=$(basename $REPO)
42+
TARGET_DIR=$(mktemp -d /tmp/$REPO_NAME.XXXX)
43+
git clone --branch master ${REPO} ${TARGET_DIR}
44+
yes | cp -f pom.xml $TARGET_DIR/
45+
cd $TARGET_DIR
46+
# Finally add changed pom.xml and commit
3447
git add pom.xml
3548
git commit -m "[skip ci] [Travis-CI] next snapshot version via Travis build $TRAVIS_BUILD_NUMBER"
36-
37-
# Get the deploy key by using Travis's stored variables to decrypt deploy_rsa.enc
38-
openssl aes-256-cbc -K $encrypted_7a1322f4b03c_key -iv $encrypted_7a1322f4b03c_iv -in .travis/deploy_rsa.enc -out .travis/deploy_rsa -d
39-
chmod 600 .travis/deploy_rsa
40-
eval `ssh-agent -s`
41-
ssh-add .travis/deploy_rsa
42-
43-
# Now that we're all set up, we can push.
44-
git push upstream master
49+
# Now that we're all set up, we can push
50+
git push $REPO master
4551
fi

.travis/deploy_key.enc

1.64 KB
Binary file not shown.

.travis/deploy_rsa.enc

-3.17 KB
Binary file not shown.

0 commit comments

Comments
 (0)