-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpush.sh
executable file
·39 lines (34 loc) · 1.05 KB
/
push.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
38
39
#!/bin/bash
setup_git() {
cd
git config --global user.email "[email protected]"
git config --global user.name "Travis CI"
git clone --depth=20 --branch master https://${GITHUB_TOKEN}@github.com/TheRealMoeder/TheRealMoeder.github.io.git build/TheRealMoeder/TheRealMoeder.github.io > /dev/null 2>&1
cd build/TheRealMoeder/TheRealMoeder.github.io
}
commit_website_files() {
cp ../deviation-voicepack/genspeech/*.zip .
../deviation-voicepack/create_index.sh
git add index.md
git add *.zip
git commit -m "Created build ID $BUILD_ID from voicepacker"
git remote add origin https://${GITHUB_TOKEN}@github.com/TheRealMoeder/TheRealMoeder.github.io.git
git push -u --force origin master
}
upload_files() {
git push --quiet
}
remove_old_files() {
for ((i=1; i<$BUILD_ID-30; i++)); do find $i-voice*.zip -delete; done
rm -rf .git
git init
git add .
}
echo "Setting up git..."
setup_git
echo "Removing old files and cleaning out repository..."
remove_old_files
echo "Committing files..."
commit_website_files
echo "Pushing to remote..."
upload_files