From 7aa2a9fa9949e6f23d589597ebb4edf124c2fdef Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 6 Jun 2018 14:22:25 +1200 Subject: [PATCH] First cut at auto-processing --- .travis.yml | 10 ++++++++++ scripts/markdown-to-markua.sh | 3 +++ scripts/push-markua-to-branch.sh | 22 ++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 .travis.yml create mode 100755 scripts/markdown-to-markua.sh create mode 100644 scripts/push-markua-to-branch.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b41b5a0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +lang: python +#before_install: +# - sudo apt-get install pandoc +# - gem install asciidoctor +script: + - scripts/markdown-to-markua.sh +after_success: + - scripts/push.sh +env: + secure: "X0ruiXtzArHPaOAd5cQS0axHGwMM5HwqSHASr/KnzV1yZUPzJIrzJQYSCJmFPzk6zuboA2Tsa96zu+DftgA9N9WgzTYmjp8M10y9vcK4cpkfi5frs7GVorVLPQ5kcWwYPf/j+YzpP5OwrRSxDDG853GJ4OhoALcjmmBJk8NwIKZOkA6x2RvvcDRx6dc216QdhmouD5Hz0tImkE2rYdQNm44IN7OF6wekbEhOzN2Chz6yGit3duRvxBrNOPqmGqkFwtg0sxyQO0iBa4qvg88qrKQOIHwUG5y4rp8QcdqfRMv/lSNGEg1Mh7iDUHbZpvcAoXREXp9FMEY/SJ1uYkcEMn+GvLDQ/BOFwKjC/duWM3oMPgzjqI+gwpIdlTZt5+Qu9v4Z6+XJ5P+JIWZYtzudDVuOzVMSIzwk9y2a/ufYXGQdvGktf6H51WCcA8CO2muxLtDwDtV1okAVm+HXkgQ/pcwjqqq3n3RojN6Xxm+TJggn3HgU21qug/K1lukycwCjQbI8s0ey3soT1+oPc8Fl95n35eXTUY3DOd0u14e0Y3XKIbG9Rvyp9U8gJC2Ij6+EXSdHlFhvr5tJJLNwXkXjV3yMnLgtlSnuGBGHUpv0+XZuSsGqOropl/KDUurb2TGkIH7PjpBpFm6PhSbLViGXrupuxTvKLdsXBXospzODuEQ=" diff --git a/scripts/markdown-to-markua.sh b/scripts/markdown-to-markua.sh new file mode 100755 index 0000000..de3928b --- /dev/null +++ b/scripts/markdown-to-markua.sh @@ -0,0 +1,3 @@ +!#/bin/bash + +# Do nothing, yet. This is where the sed magic will go diff --git a/scripts/push-markua-to-branch.sh b/scripts/push-markua-to-branch.sh new file mode 100644 index 0000000..6b47229 --- /dev/null +++ b/scripts/push-markua-to-branch.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +setup_git() { + git config --global user.email "travis@travis-ci.org" + git config --global user.name "Travis CI" +} + +commit_website_files() { + git checkout -b leanpub-preview + git add manuscript + git commit --message "Travis build: $TRAVIS_BUILD_NUMBER" +} + +upload_files() { + #git remote add origin-leanpub-preview https://${LEANPUB-PREVIEW-TOKEN}@github.com/funkypenguin/geek-cookbook.git > /dev/null 2>&1 + git remote add origin-leanpub-preview https://${LEANPUB-PREVIEW-TOKEN}@github.com/funkypenguin/geek-cookbook.git + git push --quiet --set-upstream origin-leanpub-preview leanpub-preview +} + +setup_git +commit_website_files +upload_files