forked from paullepoulpe/curriculum-vitae
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_cv.sh
executable file
·34 lines (24 loc) · 877 Bytes
/
update_cv.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
#!/usr/bin/env bash
set -x
readonly REPO="CurriculumVitae"
readonly SRC="build/cv.pdf"
readonly TARGET="dengels.ch/public/doc/cv.pdf"
if [ "$TRAVIS_REPO_SLUG" = "paullepoulpe/$REPO" -a "$TRAVIS_PULL_REQUEST" = "false" -a "$TRAVIS_BRANCH" = "master" ]; then
# Setup travis info
git config --global user.email "[email protected]"
git config --global user.name "travis-ci"
# Clone website repository
git clone --quiet --branch=master https://${GH_TOKEN}@github.com/paullepoulpe/dengels.ch
# Clear old file
rm -rf "$TARGET"
# Copy new file
cp -v "$SRC" "$TARGET"
# Step into repo
cd "${TARGET%%/*}"
# Mark for add and commit
git add "${TARGET#*/}"
git commit -m "Travis #$TRAVIS_BUILD_NUMBER: Update resume commit $TRAVIS_COMMIT"
git push origin master
else
echo "Conditions not met to update resume"
fi