From 92043b8e7d94dd4061b56b790ee34cdca4ea3100 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sat, 23 May 2015 14:08:35 +0100 Subject: [PATCH 01/10] Fix pull request script --- etc/pr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/pr.sh b/etc/pr.sh index d60dc1a..6b31714 100755 --- a/etc/pr.sh +++ b/etc/pr.sh @@ -6,7 +6,7 @@ branch=${TRAVIS_PULL_REQUEST} cd build git init git remote add origin git@github.com:LexBot/NeptuneDocs.git -if git ls-remote origin | grep -sw "$branch" +if git ls-remote origin | grep -sw "$branch"; then git fetch origin $branch git checkout $branch else From df1cbea81053de38e453750321982802064d107b Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sat, 23 May 2015 14:12:26 +0100 Subject: [PATCH 02/10] More fixes --- etc/pr.sh | 2 +- etc/requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/etc/pr.sh b/etc/pr.sh index 6b31714..533eb56 100755 --- a/etc/pr.sh +++ b/etc/pr.sh @@ -14,7 +14,7 @@ else fi git add . git commit -q -m "Deploy $(date)" -git push -q -f origin gh-pages +git push -q -f origin $branch echo "Done! Successfully published docs!" cd ../ diff --git a/etc/requirements.txt b/etc/requirements.txt index 73e352b..7642cec 100644 --- a/etc/requirements.txt +++ b/etc/requirements.txt @@ -1,2 +1,3 @@ sphinx==1.2 +requests==2.5.3 -e git+https://github.com/SpongePowered/sponge_docs_theme.git#egg=sponge_docs_theme From 53308b7e6268b66f47969e69ef151ca3cbfc3f78 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sat, 23 May 2015 14:19:22 +0100 Subject: [PATCH 03/10] Maybe this will work? --- .travis.yml | 1 + etc/comment.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 61791d3..220282f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,5 +7,6 @@ script: "./etc/build.sh" env: global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CXEf90lhDU9ByMWrIbdmf8e6qfCiP2LJ6T6YNaS+7RcxTKyb25qymCK+31D7EueP2+RPHmGDZrTOqw96YZNtDPi68UOODghdQwbTSjrCSVkowVoruWlfliIxEAcc9Zs+I0nO4IqcD2wst/rf7erT7S00XVXfmsN5BYTEG6PCZCZUBV+lJE0pTBv5/XEaXqW267M2KnO9YnP7MAlRryNB83FusHOaue8wxYYR+8ZwgZkL1hoXJIOzWqItk3dnnXCIVMpgcjWaC8CdRhoTBYZEg0HptRoXwa9mv0o4YmdrFRdDAbx0WEoEEN/XD4M=" notifications: email: false diff --git a/etc/comment.py b/etc/comment.py index e74a426..30a4a02 100644 --- a/etc/comment.py +++ b/etc/comment.py @@ -13,7 +13,7 @@ def mk_comment(commit, comment, changes): return {'body': comment_tpl % (rawgit, commit, '\n'.join('- %s %s/%s/%s.html' % (change['status'], rawgit, commit, change['filename']) for change in changes), comment)} pr = os.environ.get('TRAVIS_PULL_REQUEST') -token = os.environ.get('KEY_PASS') +token = os.environ.get('ACCESS_TOKEN') rawgit = 'https://cdn.rawgit.com/LexBot/SpongeDocs' repo = 'https://api.github.com/repos/NeptunePowered/NeptuneDocs' From 47310047e0f6c70763e25d9feb4021fdb4e180d9 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sat, 23 May 2015 14:45:57 +0100 Subject: [PATCH 04/10] Testing something --- etc/pr.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etc/pr.sh b/etc/pr.sh index 533eb56..d8ce2de 100755 --- a/etc/pr.sh +++ b/etc/pr.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash branch=${TRAVIS_PULL_REQUEST} +echo "Deploying PR #$branch" # Deploy cd build @@ -22,4 +23,4 @@ cd ../ sleep 5 # Make comment -python ./etc/comment.py +#python ./etc/comment.py From e2cfdc936f7613521932eb664a165fe244015b22 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sat, 23 May 2015 14:47:11 +0100 Subject: [PATCH 05/10] Testing more --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 220282f..61791d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,5 @@ script: "./etc/build.sh" env: global: secure: "Ggyj5gOT1+v//VdSS3ffXU3HKqdcQqXRqaoq8xRm0tFuBIXqNyztLVP31Z4Hp3bieSgyYksc0PRQnIWVPDJhcrARhvKBDNNadchEsFfrOGbBnDN0SmYA4GJfdWqv5mwzhFULo8nC2XbmTpgutBfHz3dUtcRzy+/UQuYec9tOK/BO4uAijFAgm20sqBL/OvdV29OvHylTp4KMp+0MsIsRJKlA5xsOhMwhXHpDhcEmylRUX/FCFNgv7783FEYLBcIK/ODAv5oddky+T6iKRbEmgoSV04+Xh7cY/WiwJR8cl6o2F3H3QoX1txYfXLiVEw2KS7T1hvVOPVI2mqhhzOQqnHc1ttqqzoFaPzHUjHGIn2F/OIs4+ArX1C4I2YqWo+6wnfT2fpeJaxGWhUaFKjrLC5o5kX1t0FDX5gyyxoTnvMEDdsIXSMczsAXtCJC2TfwcWjkQNJprOJJC+F3vM4TOKxNoVfZGtJkuxlAmAs6zbxzk9dE8Ace6U2ECIvh7iMJvQqsWDkYDzritVD0KuEkLbEzwhCmoCxcCVKfJSyD5KGa2PIdB3Bgia3kqlYos0qSa355DT6Cs6Mo8oMt0/wiHk/L27NGlHQESE5VbNBh9EL3k68iRgyrZ84n7uqsuW6sjyABL5Hh0HGQsjz8k1s9sHr9ol6SRXkjCQqm0FVIrjeo=" - secure: "AH1vgVK9YmOoqmkFMyXGCW+i1wPHmKEKqrrDuwBPewk1S0jxV0KQ61UERQobj8C8M6VwU9VlTrHeuraCqx0YlHqWKgqgtccHq3nNB4qfejHkerzZ1QmECHslA8EhoWd8ClUUd5pe/CdMsi8+Q9a1RcRxcD3zpwdop7tDeMpps7q3sg57+JYq4bmvYQcT9bR0UFfZ3WbBsyFyWPCVjfutuaXG7I5XZ3Jjk4JPl3GVWoYMi2/q4pM2dEgopOrgXVWGMfeBDa0D6iPwH0e8bIM6WaarwoJXGRq9B6wuWRWsNDfQF6IilYeS2pr2rIMoVzpDpA87kCwRWbsEyfSAqO+TeSUowFM7BAlBYhyG2SEyWqlbkPCRCXEf90lhDU9ByMWrIbdmf8e6qfCiP2LJ6T6YNaS+7RcxTKyb25qymCK+31D7EueP2+RPHmGDZrTOqw96YZNtDPi68UOODghdQwbTSjrCSVkowVoruWlfliIxEAcc9Zs+I0nO4IqcD2wst/rf7erT7S00XVXfmsN5BYTEG6PCZCZUBV+lJE0pTBv5/XEaXqW267M2KnO9YnP7MAlRryNB83FusHOaue8wxYYR+8ZwgZkL1hoXJIOzWqItk3dnnXCIVMpgcjWaC8CdRhoTBYZEg0HptRoXwa9mv0o4YmdrFRdDAbx0WEoEEN/XD4M=" notifications: email: false From f910301715720994beb16502a1d4ba3bd7738c60 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sat, 23 May 2015 14:52:51 +0100 Subject: [PATCH 06/10] Don't moan --- etc/pr.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/etc/pr.sh b/etc/pr.sh index d8ce2de..6b1402c 100755 --- a/etc/pr.sh +++ b/etc/pr.sh @@ -4,7 +4,8 @@ branch=${TRAVIS_PULL_REQUEST} echo "Deploying PR #$branch" # Deploy -cd build +mkdir deploy +cd deploy git init git remote add origin git@github.com:LexBot/NeptuneDocs.git if git ls-remote origin | grep -sw "$branch"; then @@ -13,14 +14,9 @@ if git ls-remote origin | grep -sw "$branch"; then else git checkout --orphan $branch fi +cp -R ../build/. . git add . git commit -q -m "Deploy $(date)" git push -q -f origin $branch echo "Done! Successfully published docs!" cd ../ - -# Give time for GitHub API to catch up -sleep 5 - -# Make comment -#python ./etc/comment.py From c582c09607a80a75df68805ce1b07683a8d115ad Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sat, 23 May 2015 15:00:33 +0100 Subject: [PATCH 07/10] Comment... again --- etc/pr.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/etc/pr.sh b/etc/pr.sh index 6b1402c..d5668b4 100755 --- a/etc/pr.sh +++ b/etc/pr.sh @@ -20,3 +20,9 @@ git commit -q -m "Deploy $(date)" git push -q -f origin $branch echo "Done! Successfully published docs!" cd ../ + +# Give time for GitHub API to catch up +sleep 5 + +# Make comment +python ./etc/comment.py From ab034a68e6f15858852e089311b4c9257985b594 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sat, 23 May 2015 15:10:53 +0100 Subject: [PATCH 08/10] /me is stupid --- etc/comment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/comment.py b/etc/comment.py index 30a4a02..05e3d78 100644 --- a/etc/comment.py +++ b/etc/comment.py @@ -15,9 +15,9 @@ def mk_comment(commit, comment, changes): pr = os.environ.get('TRAVIS_PULL_REQUEST') token = os.environ.get('ACCESS_TOKEN') -rawgit = 'https://cdn.rawgit.com/LexBot/SpongeDocs' +rawgit = 'https://cdn.rawgit.com/LexBot/NeptuneDocs' repo = 'https://api.github.com/repos/NeptunePowered/NeptuneDocs' -pr_repo = 'https://api.github.com/repos/LexBot/SpongeDocs' +pr_repo = 'https://api.github.com/repos/LexBot/NeptuneDocs' commit = requests.get('%s/branches/%s' % (pr_repo, pr), auth=('x-oauth-basic', token)).json()['commit']['sha'][:8] From af8a803429f8dcdf61051d57ab3555003dee8bf2 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sun, 24 May 2015 21:20:06 +0100 Subject: [PATCH 09/10] test --- source/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/source/index.rst b/source/index.rst index 87de9d8..2e8ea27 100644 --- a/source/index.rst +++ b/source/index.rst @@ -5,6 +5,7 @@ Introduction ============ Welcome to the Neptune Documentation, the official documentation for the `Neptune `__ project. +Testing 123........... .. warning:: From 4edee2e9bd204fe1b649fa1ede981f12192d2097 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Sun, 24 May 2015 21:29:10 +0100 Subject: [PATCH 10/10] and it works? pls --- etc/comment.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/comment.py b/etc/comment.py index 05e3d78..3c3ab46 100644 --- a/etc/comment.py +++ b/etc/comment.py @@ -4,8 +4,11 @@ comment_tpl = """ A preview for this pull request is available at %s/%s/index.html. + Here are some links to the pages that were modified: + %s + _Since the preview frequently changes, please link to [this comment](%s), not to the direct url to the preview._ """