-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: Add automatic Github Pages deployment #143
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of problems.
- Please use Travis-CI GitHub pages deployment feature: https://docs.travis-ci.com/user/deployment/pages/
- Your diff is so huge for such a simple thing, please remove the unnecessary stuff.
deack 454fe03 |
@yukiisbored Can you elaborate on the 2nd point? Most of the diff comes from putting the ‘data’ folder from gh-pages branch in master. I’ve only modified 2 files, .travis.yml and .ci/deploy.sh . |
@nalinbhardwaj About coala/community, no idea, @jayvdb probably didn't know about Travis CI GitHub Pages deployment feature. Anyway about the Data folder, didn't notice those are coala json output since I reviewed from my phone. But, can you confirm deployment go smoothly since it looks like the data folder isn't inside the |
Yep @yukiisbored deployment is currently smooth and fine with data where it is. If you want however I can move it to some other directory? Also there’s a problem with the Travis Github pages building, since it’s a yaml file, I don’t think we can do stuff like pushing to custom branch(as I require for this issue) like master pushes to gh-pages but any other branch “xyz” pushes to gh-pages-branch/xyz ? |
Also, If you want to see an example: https://github.com/yukiisbored/blog-archive/blob/blog/.travis.yml |
Asked other maintainers, seems like we prefer ssh deploy keys.
@nalinbhardwaj just asked @jayvdb, it seems SSH deploy keys are preferred so I'm gonna merge this, but I need to setup the deploy keys. |
.travis.yml
Outdated
@@ -32,6 +39,8 @@ script: | |||
- python -m pytest --cov | |||
- codecov | |||
- docker run --volume=$(pwd):/app --workdir=/app coala/base coala-ci | |||
- python3 setup.py install | |||
- bash ./.ci/deploy.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be done on deploy
phase so failing builds doesn't get deployed.
ssh-add ../deploy_key | ||
|
||
# Now that we're all set up, we can push. | ||
git push $SSH_REPO $TARGET_BRANCH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No EOL at EOF (copying ... :P)
Marking this as blocked since the builds are failing. |
data/Constants.json
Outdated
@@ -0,0 +1,7 @@ | |||
{ | |||
"data":"data", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add JSONBear to .coafile
@@ -0,0 +1 @@ | |||
/home/tushar/coala |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EOL at EOF
.travis.yml
Outdated
@@ -1,12 +1,19 @@ | |||
sudo: required | |||
dist: trusty | |||
|
|||
env: | |||
global: | |||
- ENCRYPTION_LABEL: "79272d66a36b" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yaml lint bear pls
.travis.yml
Outdated
@@ -32,6 +39,8 @@ script: | |||
- python -m pytest --cov | |||
- codecov | |||
- docker run --volume=$(pwd):/app --workdir=/app coala/base coala-ci | |||
- python3 setup.py install | |||
- bash ./.ci/deploy.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be in deploy:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s a workaround for now, I’ll do that once tests start passing(as noted in PR description).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few things to fix
For future readers, some discussion regarding the decisions can be found in Zulip. |
.travis.yml
Outdated
language: python | ||
node_js: | ||
- "4.1" | ||
- "4.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey this is not needed, it just makes some noise on the diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh, I just ran YAMLLintBear and applied patch to it without checking anything. Will fix everything.
.travis.yml
Outdated
python: | ||
- "3.4" | ||
- "3.4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey this is not needed, it just makes some noise on the diff.
.travis.yml
Outdated
directories: | ||
- node_modules | ||
- coalahtml/_coalahtml/bower_components | ||
pip: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey this is not needed, it just makes some noise on the diff.
.travis.yml
Outdated
- pip install colorama==0.3.7 | ||
- pip install -r requirements.txt | ||
- pip install -r test-requirements.txt | ||
- npm install - g bower |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey this is not needed, it just makes some noise on the diff.
This breaks CI as well due to that space between - and g
.travis.yml
Outdated
- cd - | ||
# colorama needs to be upgraded to fix error when installed colorama | ||
# version and required are different. | ||
- pip install colorama == 0.3.7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaks CI, due to that space between packaage and version
.travis.yml
Outdated
# colorama needs to be upgraded to fix error when installed colorama | ||
# version and required are different. | ||
- pip install colorama == 0.3.7 | ||
- pip install - r requirements.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Break CI due to that space between the flag and the indicator
.travis.yml
Outdated
# version and required are different. | ||
- pip install colorama == 0.3.7 | ||
- pip install - r requirements.txt | ||
- pip install - r test-requirements.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Break CI due to that space between the flag and the indicator
.travis.yml
Outdated
|
||
notifications: | ||
email: false | ||
email: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noise, not needed
.travis.yml
Outdated
- python -m pytest --cov | ||
- codecov | ||
- docker run --volume=$(pwd):/app --workdir=/app coala/base coala-ci | ||
- npm test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed.
Sadly we can't merge it, master is broken :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, is .rultor.yml
modified because you run YAMLLintBear
?
.ci/deploy.sh
Outdated
exit 0 | ||
fi | ||
|
||
# Commits to other branches should deploy to their respective gh-pages/<name> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be gh-pages-branch/<name>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, typo.
.travis.yml
Outdated
@@ -31,7 +36,11 @@ script: | |||
- npm test | |||
- python -m pytest --cov | |||
- codecov | |||
- docker run --volume=$(pwd):/app --workdir=/app coala/base coala-ci | |||
- docker run --volume =$(pwd): / app --workdir = /app coala/base coala-ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you shouldn't change this?
See https://travis-ci.org/coala/coala-html/builds/311194465#L686
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed the command is parsed like YAML
.rultor.yml
Outdated
fast-forward: only | ||
script: | ||
- bash .ci/check_maintainership.sh | ||
fast-forward: only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please undo this.
.rultor.yml
Outdated
|
||
decrypt: | ||
rultor_github_secrets.sh: "repo/.ci/rultor_github_secrets.sh.asc" | ||
rultor_github_secrets.sh: "repo/.ci/rultor_github_secrets.sh.asc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This as well.
Automates Github Pages deployment by making travis commit any changes to master to gh-pages branch, and other branch changes to gh-pages-branch/<original branch name>. Closes #133
ack 70dfa00 |
Umm, @yukiisbored I think you forgot about the TODO from my PR description? That encrypted deploy key won’t work for this repo? |
Automates Github Pages deployment by making travis commit any changes to master to gh-pages branch, and other branch changes to gh-pages-branch/"original branch name"
Currently, you can see it works on my fork. For example, commits to
master
automatically get pushed togh-pages
and deployed on my website http://nibnalin.me/coala-html/#/ . Branch CI-testing gets built and pushed to gh-pages-branch/CI-testing. Note that the original issue mentions usinggh-pages/<branch name>
but that couldn't be done since git would error out due to existence ofgh-pages
branch.data
folder used for building the website has to of course now be moved to master(I've done that), and the failing tests are unrelated to my PR, and have already been verified to fail on clean master by @MixihTODO: I would require an owner to provide a deploy key.
Closes #133
For short term contributors: we understand that getting your commits well
defined like we require is a hard task and takes some learning. If you
look to help without wanting to contribute long term there's no need
for you to learn this. Just drop us a message and we'll take care of brushing
up your stuff for merge!
Checklist
them.
individually. It is not sufficient to have "fixup commits" on your PR,
our bot will still report the issues for the previous commit.) You will
likely receive a lot of bot comments and build failures if coala does not
pass on every single commit!
After you submit your pull request, DO NOT click the 'Update Branch' button.
When asked for a rebase, consult coala.io/rebase
instead.
Please consider helping us by reviewing other peoples pull requests as well:
cobot mark wip <URL>
to get it outof the review queue.
The more you review, the more your score will grow at coala.io and we will
review your PRs faster!