-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
23 lines (20 loc) · 2.09 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
sudo: false
language: generic
before_install:
- if [ -n "$TRAVIS_PULL_REQUEST" ]; then openssl aes-256-cbc -K $encrypted_34922f73314b_key -iv $encrypted_34922f73314b_iv -in gh_rsa.enc -out gh_rsa -d; fi
script:
- cp webpage-head.htm non-minified.html
- echo "Y3VybCAtWCBQT1NUIC1UIFJFQURNRS5tZCAtSCAiQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyIgImh0dHBzOi8vYXBpLmdpdGh1Yi5jb20vbWFya2Rvd24vcmF3P2NsaWVudF9pZD1mMTM4MDY4Yzg4NWI4OTg5MGMxMyZjbGllbnRfc2VjcmV0PSRnaF9hcHBfc2VjcmV0IiA+PiBub24tbWluaWZpZWQuaHRtbAo=" | base64 -d | bash # TODO: extract into here, a Travis bug prevents having it inline
- echo '</div></div></body></html>' >> non-minified.html
- curl -X POST --form-string "html=$(cat non-minified.html)" www.willpeavy.com/minifier/ | tr -d '\n\r' | sed -e 's/.*<p><textarea id="html" name="html">//' -e 's:</textarea></p>.*::' -e 's/> </></g' | perl -pe 's|( ?)/\*.*?\*/( ?)||g' | perl -pe 's/&([[:alnum:]]+);/\&\1;/g' > ../index.html
after_success:
- if [ -n "$TRAVIS_PULL_REQUEST" ]; then echo "Update webpage for commits $TRAVIS_COMMIT_RANGE" > $TRAVIS_BUILD_DIR/../DOC_UPDATE_MSG; fi
- if [ -n "$TRAVIS_PULL_REQUEST" ]; then echo >> $TRAVIS_BUILD_DIR/../DOC_UPDATE_MSG; fi
- if [ -n "$TRAVIS_PULL_REQUEST" ]; then git log $TRAVIS_COMMIT_RANGE --pretty=oneline >> $TRAVIS_BUILD_DIR/../DOC_UPDATE_MSG; fi
- if [ -n "$TRAVIS_PULL_REQUEST" ]; then mkdir -p ~/.ssh && cp gh_rsa ~/.ssh/id_rsa && chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa; fi
- if [ -n "$TRAVIS_PULL_REQUEST" ]; then git clone -b gh-pages [email protected]:$TRAVIS_REPO_SLUG.git $TRAVIS_BUILD_DIR-gh-pages; fi
- if [ -n "$TRAVIS_PULL_REQUEST" ]; then cd $TRAVIS_BUILD_DIR-gh-pages; fi
- if [ -n "$TRAVIS_PULL_REQUEST" ]; then cp ../index.html .; fi
- if [ -n "$TRAVIS_PULL_REQUEST" ]; then git config --global user.email "[email protected]" && git config --global user.name "Nabijaczleweli Autouploader Bot" && git config --global push.default simple; fi
- if [ -n "$TRAVIS_PULL_REQUEST" ]; then git add * && git commit -F $TRAVIS_BUILD_DIR/../DOC_UPDATE_MSG; fi
- if [ -n "$TRAVIS_PULL_REQUEST" ]; then git push && cd $TRAVIS_BUILD_DIR; fi