-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchange-file.sh
executable file
·37 lines (28 loc) · 1.05 KB
/
change-file.sh
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
29
30
31
32
33
34
35
36
37
#!/bin/bash
YEAR=$(date +"%Y")
MONTH=$(date +"%m")
cd $TRAVIS_BUILD_DIR
#Remove Remotes Added by TravisCI
git remote rm origin
#Add Remote with Secure Key
git remote add origin https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
#local remote=origin
#if [[ $GH_TOKEN ]]; then
# remote=https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
#fi
#List Remotes ONLY DURING testing - do not do this on live repo / possible key leak
#git remote -v
# Set Git Variables
git config --global user.email "${GIT_EMAIL}"
git config --global user.name "${GIT_NAME}"
git config --global push.default simple
# Make sure we have master branch checked out in Git
git checkout master
# Modify our file and make sure Travis is owner
sudo $TRAVIS_BUILD_DIR/travis-ci/modify-globalblacklist.sh
sudo chown travis:travis $TRAVIS_BUILD_DIR/globalblacklist.conf
# Add the modified file to the and commit it
#git add $TRAVIS_BUILD_DIR/globalblacklist.conf
git add -A
git commit -am "V3.$YEAR.$MONTH.$TRAVIS_BUILD_NUMBER [ci skip]"
# Travis now moves to the before_deploy: section of .travis.yml