diff --git a/etc/comment.py b/etc/comment.py index e74a426..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._ """ @@ -13,11 +16,11 @@ 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' +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] diff --git a/etc/pr.sh b/etc/pr.sh index d60dc1a..d5668b4 100755 --- a/etc/pr.sh +++ b/etc/pr.sh @@ -1,20 +1,23 @@ #!/usr/bin/env bash 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" +if git ls-remote origin | grep -sw "$branch"; then git fetch origin $branch git checkout $branch else git checkout --orphan $branch fi +cp -R ../build/. . 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 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::