-
Notifications
You must be signed in to change notification settings - Fork 3
/
.push.sh
executable file
·31 lines (25 loc) · 916 Bytes
/
.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
#!/bin/bash
if [[ "$TRAVIS_BRANCH" != "master" ]]
then
echo "not master branch. skipping update of assets"
exit 0
fi
convert -density 600 cv.pdf -quality 90 cv.png
convert -density 600 cover.pdf -quality 90 cover.png
openssl aes-256-cbc -K $encrypted_da622da7f4d3_key -iv $encrypted_da622da7f4d3_iv -in .push-token.enc -out push-token -d
chmod 600 push-token
eval $(ssh-agent -s)
ssh-add push-token
rm push-token
git remote add origin-token [email protected]:hesseltuinhof/simpleCV.git
if [[ $(git ls-remote origin assets | wc -l) == "1" ]]
then
git push origin-token :assets
fi
git checkout --orphan assets
git rm -rf fonts/ && git rm -f *.tex *.sty *.cls .push-token.enc
git add -f cv.png cv.pdf cover.png cover.pdf
git config user.email "[email protected]"
git config user.name "travis ci"
git commit -m "travis auto upload $TRAVIS_BUILD_NUMBER"
git push -u origin-token assets > /dev/null 2>&1