From 7aa2a9fa9949e6f23d589597ebb4edf124c2fdef Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 6 Jun 2018 14:22:25 +1200 Subject: [PATCH 1/6] 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 From 05d45e453554185aac2fb82dc5e21c21ded9251c Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 6 Jun 2018 21:06:53 +1200 Subject: [PATCH 2/6] Fix shell error --- scripts/markdown-to-markua.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/markdown-to-markua.sh b/scripts/markdown-to-markua.sh index de3928b..01aec10 100755 --- a/scripts/markdown-to-markua.sh +++ b/scripts/markdown-to-markua.sh @@ -1,3 +1,3 @@ -!#/bin/bash +#!/bin/bash # Do nothing, yet. This is where the sed magic will go From bb82393c4461f73964526cf7b2de6be96c8ae894 Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 6 Jun 2018 21:10:16 +1200 Subject: [PATCH 3/6] Add Travis test --- scripts/markdown-to-markua.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/markdown-to-markua.sh b/scripts/markdown-to-markua.sh index 01aec10..3abed57 100755 --- a/scripts/markdown-to-markua.sh +++ b/scripts/markdown-to-markua.sh @@ -1,3 +1,3 @@ #!/bin/bash - +echo "Nananana... Batman!" > manuscript/test.md # Do nothing, yet. This is where the sed magic will go From 0074f52832848442a4e119a32178384d4fc8077e Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 6 Jun 2018 21:13:00 +1200 Subject: [PATCH 4/6] Add Travis test --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b41b5a0..0d95ad1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,6 @@ lang: python script: - scripts/markdown-to-markua.sh after_success: - - scripts/push.sh + - scripts/push-markua-to-branch.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=" From 1c02882c506eb6a388626408b9acd485eb841498 Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 6 Jun 2018 21:14:20 +1200 Subject: [PATCH 5/6] Add Travis test 3 --- scripts/push-markua-to-branch.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/push-markua-to-branch.sh diff --git a/scripts/push-markua-to-branch.sh b/scripts/push-markua-to-branch.sh old mode 100644 new mode 100755 From 7c0ac4e49cca159ea0605094737b60036345fa78 Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 6 Jun 2018 21:16:41 +1200 Subject: [PATCH 6/6] Add Travis test 4 --- scripts/push-markua-to-branch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/push-markua-to-branch.sh b/scripts/push-markua-to-branch.sh index 6b47229..56a6544 100755 --- a/scripts/push-markua-to-branch.sh +++ b/scripts/push-markua-to-branch.sh @@ -13,7 +13,7 @@ commit_website_files() { 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 remote add origin-leanpub-preview https://${TOKEN}@github.com/funkypenguin/geek-cookbook.git git push --quiet --set-upstream origin-leanpub-preview leanpub-preview }