mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Trigger rebuild of hugo branch instead of deploying ourselves
This commit is contained in:
@@ -22,4 +22,8 @@ install:
|
|||||||
|
|
||||||
script: bash scripts/travis-build.sh
|
script: bash scripts/travis-build.sh
|
||||||
|
|
||||||
after_success: sh scripts/travis-blog-update.sh
|
after_success: bash scripts/travis-trigger-hugo-build.sh
|
||||||
|
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
secure: YQvZpLe32k8N+vLMa8PB80LKJdiD4WEUuw2lPFk3AJLSK6dojWq8MKjGuedxLvtmjURu401m7D06NFCjwd6j0dpR4L2xmVJ/EgufP2Wc62BUa2XvIIU/zURv0dFpGvaOTyHKl4j46SIk2LDugIzB1WyYRqeYTCpiN0xHuWsywXjPpCCJ04ftxHwrjYjzA8vvtyehjMeN4HC3J9r6anFlN9Ka7RFVSQ0Bun79pd6Xa/OPIxTsZuw24Ru4v458e4QxVh0atJif0lqmu5tZAeR/S0FTnG3XlKqfIYDmDWKJVKUwk6AHnsgaYAFASQhi9XOcr+cMir38/8k8FQpx80hjqkWXCZafUWuypgQnZOKS8K1oZLmMAQnrssM8HbMZEIYH40I8G5MqcpgPUvdwFO2PMGRNimMk6bEvrtheNwZn1XBTxgNOW4huCBoR0/E95FFGiTH5HL2kZi5N5+1EGJMdhPGjybIdJgawsAY2SOdw6rvHgf+ZMkJFBU2R9ftS88DHygMhkOifLDUq3GFPiFePNrE97LBFH3WN48fxPTcske00tAPTMcMGvw8zDBH4tZAHQikH6oMZFzKNQ0GvBTiKNvLMl1HaCcM/h1QmGXho4HtVD6PNrgOocdVxxXBcntQMVewkcr3hwDwaAZ/7+AqjeG9M+V2wEkI20Y4XYiq24HY=
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# update blog if current branch is `master`
|
|
||||||
[ "$TRAVIS_BRANCH" = master ]
|
|
||||||
[ "$TRAVIS_PULL_REQUEST" = false ]
|
|
||||||
|
|
||||||
# decrypt ssh key
|
|
||||||
eval SSH_KEY_TRAVIS_ID=aaae456e27e9
|
|
||||||
eval key=\$encrypted_${SSH_KEY_TRAVIS_ID}_key
|
|
||||||
eval iv=\$encrypted_${SSH_KEY_TRAVIS_ID}_iv
|
|
||||||
|
|
||||||
mkdir -p ~/.ssh
|
|
||||||
openssl aes-256-cbc -K $key -iv $iv -in scripts/travis-blog_os.enc -out ~/.ssh/id_rsa -d
|
|
||||||
chmod 600 ~/.ssh/id_rsa
|
|
||||||
|
|
||||||
# clone gh-pages to `deploy_blog`
|
|
||||||
git clone --branch gh-pages git@github.com:$TRAVIS_REPO_SLUG deploy_blog
|
|
||||||
cd deploy_blog
|
|
||||||
|
|
||||||
# set git user/email
|
|
||||||
git config user.name "travis-update-bot"
|
|
||||||
git config user.email "travis-update-bot@phil-opp.com"
|
|
||||||
|
|
||||||
# update blog
|
|
||||||
rm -r *
|
|
||||||
cp -r ../hugo/public .
|
|
||||||
rm -r post post.html page page.html # remove per-category pages/feeds
|
|
||||||
|
|
||||||
# commit
|
|
||||||
git add --all .
|
|
||||||
git commit -qm "Update blog to $TRAVIS_COMMIT"
|
|
||||||
|
|
||||||
# push changes
|
|
||||||
git push -q origin gh-pages
|
|
||||||
Binary file not shown.
19
scripts/travis-trigger-hugo-build.sh
Normal file
19
scripts/travis-trigger-hugo-build.sh
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
[ "$TRAVIS_BRANCH" = master ]
|
||||||
|
[ "$TRAVIS_PULL_REQUEST" = false ]
|
||||||
|
|
||||||
|
body='{
|
||||||
|
"request": {
|
||||||
|
"branch":"hugo"
|
||||||
|
}}'
|
||||||
|
|
||||||
|
curl -s -X POST \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-H "Accept: application/json" \
|
||||||
|
-H "Travis-API-Version: 3" \
|
||||||
|
-H "Authorization: token $TRAVIS_TOKEN" \
|
||||||
|
-d "$body" \
|
||||||
|
https://api.travis-ci.org/repo/phil-opp%2Fblog_os/requests
|
||||||
Reference in New Issue
Block a user