From 7aa2a9fa9949e6f23d589597ebb4edf124c2fdef Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 6 Jun 2018 14:22:25 +1200 Subject: [PATCH 01/11] 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 02/11] 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 03/11] 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 04/11] 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 05/11] 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 06/11] 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 } From 8330e540a2c7e9706fbe816873b719e848840b8e Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 6 Jun 2018 21:23:47 +1200 Subject: [PATCH 07/11] Excluded some branches from travis --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0d95ad1..8316e46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,9 @@ lang: python -#before_install: -# - sudo apt-get install pandoc -# - gem install asciidoctor +# blocklist +branches: + except: + - leanpub-preview + - leanpub-publish script: - scripts/markdown-to-markua.sh after_success: From 576272204f8f163b174074fa0a898f41270c9c75 Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 6 Jun 2018 21:25:37 +1200 Subject: [PATCH 08/11] Add Travis test 6 --- scripts/push-markua-to-branch.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/push-markua-to-branch.sh b/scripts/push-markua-to-branch.sh index 56a6544..8f03faa 100755 --- a/scripts/push-markua-to-branch.sh +++ b/scripts/push-markua-to-branch.sh @@ -7,6 +7,7 @@ setup_git() { commit_website_files() { git checkout -b leanpub-preview + git pull git add manuscript git commit --message "Travis build: $TRAVIS_BUILD_NUMBER" } From 068342a36554581ca57a4a2b9999bb2c48be3445 Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 6 Jun 2018 21:28:13 +1200 Subject: [PATCH 09/11] Add Travis test 7 --- scripts/push-markua-to-branch.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/push-markua-to-branch.sh b/scripts/push-markua-to-branch.sh index 8f03faa..aa1c10e 100755 --- a/scripts/push-markua-to-branch.sh +++ b/scripts/push-markua-to-branch.sh @@ -7,15 +7,15 @@ setup_git() { commit_website_files() { git checkout -b leanpub-preview - git pull 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://${TOKEN}@github.com/funkypenguin/geek-cookbook.git - git push --quiet --set-upstream origin-leanpub-preview leanpub-preview + #git remote add origin-leanpub-preview https://${TOKEN}@github.com/funkypenguin/geek-cookbook.git + #git push --quiet --set-upstream origin-leanpub-preview leanpub-preview + git push --quiet --set-upstream origin leanpub-preview } setup_git From a8b24cd3e53c268100827fa9e0dae0071b279585 Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 6 Jun 2018 21:29:28 +1200 Subject: [PATCH 10/11] Add Travis test 8 --- 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 aa1c10e..1210fb4 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://${TOKEN}@github.com/funkypenguin/geek-cookbook.git + git remote add origin https://${TOKEN}@github.com/funkypenguin/geek-cookbook.git #git push --quiet --set-upstream origin-leanpub-preview leanpub-preview git push --quiet --set-upstream origin leanpub-preview } From b59d465d74bedf11e4bfa975470ee94a403b2a56 Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 6 Jun 2018 21:32:03 +1200 Subject: [PATCH 11/11] Add Travis test 9 --- scripts/push-markua-to-branch.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/push-markua-to-branch.sh b/scripts/push-markua-to-branch.sh index 1210fb4..1c70a66 100755 --- a/scripts/push-markua-to-branch.sh +++ b/scripts/push-markua-to-branch.sh @@ -13,9 +13,10 @@ 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 https://${TOKEN}@github.com/funkypenguin/geek-cookbook.git + git remote add origin-leanpub-preview https://${TOKEN}@github.com/funkypenguin/geek-cookbook.git + git pull origin-leanpub-preview leanpub-preview #git push --quiet --set-upstream origin-leanpub-preview leanpub-preview - git push --quiet --set-upstream origin leanpub-preview + git push --quiet --set-upstream origin-leanpub-preview leanpub-preview } setup_git