Created
December 3, 2017 08:35
-
-
Save nemesisqp/07689449bf526086fa6b6983e1053272 to your computer and use it in GitHub Desktop.
script-ea-bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
settingFile=setting.conf | |
logFile=result | |
. $settingFile | |
fullGitHttpUrl="${gitHttpUrl:0:8}$username:$password@${gitHttpUrl:8}" | |
repoNameWithDotGit=`basename "$fullGitHttpUrl"` | |
repoName="${repoNameWithDotGit:0:-4}" | |
# clone repo | |
git clone --progress $fullGitHttpUrl > "$logFile" 2>&1 | |
cd $repoName | |
# create and clone gh-pages branch | |
mkdir -p $buildFolder | |
cd $buildFolder | |
git clone --progress -b gh-pages $fullGitHttpUrl . >> "../../$logFile" 2>&1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
settingFile=setting.conf | |
logFile=result | |
. $settingFile | |
fullGitHttpUrl="${gitHttpUrl:0:8}$username:$password@${gitHttpUrl:8}" | |
repoNameWithDotGit=`basename "$fullGitHttpUrl"` | |
repoName="${repoNameWithDotGit:0:-4}" | |
cd "$repoName/$buildFolder" | |
git pull origin gh-pages -s recursive -X ours > "../../$logFile" 2>&1 | |
git add . >> "../../$logFile" 2>&1 | |
git commit -m "%datetime%" >> "../../$logFile" 2>&1 | |
git push origin HEAD:gh-pages >> "../../$logFile" 2>&1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gitHttpUrl="https://github.com/asv/test-aaa-bash-repo.git" | |
username="user" | |
password="pass" | |
buildFolder="build" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment