-
-
Notifications
You must be signed in to change notification settings - Fork 170
Website build on commit #58
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
Comments
Would we have access to the releases.json from inside the |
Yep, can do, how about we copy it in to the root of the project directory and name it |
+1 to that @rvagg. That would make it simplistic to pull into |
+1 to just pulling it down via HTTP (with a local fallback, perhaps), although if we do "inject it" I'd prefer to overwrite it at This way this publish script can also be triggered when new versions hit the web. How long would this take to switch over? I'm all for the change happening any time. |
What I might do is put the above script into a stand-alone file so it can be run by the webhook and also as a result of an update to index.json, so the site gets rebuilt when you push new stuff and when there's new stuff available to it. How about I set up a test version of this so you can play with it first and then we can go live later. Will try and do it this weekend. |
I'll try to prep a proof-of-concept of using https://iojs.org/dist/index.json for version numbers, download links, etc. when I get a chance. I have an unrelated PR in queue which should make this pretty easy to switch over. Tracking on nodejs/iojs.org#284 |
let's use a test branch on iojs/website, maybe actually call it "test" and we can webhook/pull from that instead of master for testing purposes |
Sure. Should we wait for the "new stuff" or just test randomly as-is without the new .json hooks? Edit: I guess we can do "both". Start with the current master, then push the new stuff when ready, and see if it all works as expected :) |
yes, both! |
Looks like I need to destroy an old "test" branch first, ha. Edit: done. Master === Test |
nodejs/iojs.org#287 is now sitting on https://github.com/iojs/website/tree/test It'll generate a |
Is there going to be a domain where we can see the site running from the test branch? nodejs/iojs.org#291 is now the latest PR for this work. |
/cc @kenperkins
"event": "push",
"match": "ref == \"refs/heads/test\" && repository.full_name == \"iojs/website\"",
"exec": "/home/iojs/build-site.sh" and #!/bin/bash
set -e
pidof -s -o '%PPID' -x $(basename $0) > /dev/null 2>&1 && \
echo "$(basename $0) already running" && \
exit 1
cd /home/iojs/website.github.test
git reset --hard
git clean -fdx
git fetch origin
git checkout origin/test
docker pull iojs:latest
docker run \
--rm \
-v /home/iojs/website.github.test/:/website/ \
-v /home/iojs/.npm:/npm/ \
iojs:latest \
bash -c " \
addgroup iojs --gid 1000 && \
adduser iojs --uid 1000 --gid 1000 --gecos iojs --disabled-password && \
su iojs -c ' \
npm config set loglevel http && \
npm config set cache /npm/ && \
cd /website/ && \
npm install && \
node_modules/.bin/gulp build \
' \
"
rsync -avz --delete --exclude .git /home/iojs/website.github.test/public/ /home/iojs/www.test/ There is also a new line in
And #!/bin/bash
indexjson=/home/dist/public/release/index.json
indexhtml=/home/iojs/www.test/en/index.html
buildsite=/home/iojs/build-site.sh
[ $indexjson -nt $indexhtml ] && $buildsite (Note the hardwiring of en/index.html, this is a little unfortunate and brittle.) There's also an nginx site setup for
i.e. pushing to the @snostorm you can give it a go now if you want to push any changes to |
Thanks @rvagg, everything sounds great. I have a push (hopefully) generating right now. Minor change where I lined up some out of date content (i18n mostly) between test..master. I'll try to sneak in a build change which adds a copy of the en/index.html to /index.html. Awkward indeed. |
How long should we expect? Like 10+ minutes?. If so, things might be working as expected (it has been about that long.) If shorter, then it was a no-go on the auto push working. Sanity checks:
I'll check back later myself to see if it finished. |
@snostorm you pushed to the |
should only be ~1 min, the time it takes to |
Hmm. https://github.com/iojs/website/blob/test/public/es/index.html#L29 is confirming the changes I'm looking for but not showing on the test subdomain. I can try a 2nd push. |
"Test" is now at nodejs/iojs.org@8750053 ... verifiable by view source and seeing if |
@snostorm it looks correct to me .. can you double-check for me and maybe test some more? It could also be that I promoted the armv6l build of 1.6.2 which should have triggered a build too. I'll leave it to you to make a call on whether this is solid enough to move to the next step and do |
No go still. I did a test ~14 hours ago, just remembered to check on it. Looks like the Github hook isn't quite working. |
Any luck confirming the lack of build-on-push? FYI the build code of test is also in master now. Maybe we should try our luck targeting iojs/website#master vs #test? |
figured it out -- github-webhook uses |
Great. I saw on the 1.6.3 release this is now live for master as well? Hurray for less "published public" type commits. |
So where is iojs.org currently coming from? The |
|
hmmm, the website isn't updating after the 1.6.4 release.. |
a previous build was blocking it, I had to manually kill it but it was paused somewhere in the build process -- perhaps in the gulp build? I'm manually running the build again now. |
cc @iojs/website
Currently we are using github-webhook with the following configuration on the server:
i.e. the "build" process is:
What I want to suggest we add is a build step in between 3 and 4 here, but it needs to be done inside a container so we don't give free reign for code in the website repo to run on the server.
Something like this:
I've just run this and it seems to work fine and I could enable it right now if that's suitable to the website team.
Note for build team (@kenperkins in particular) our Ansible script for the website needs an initial git clone of iojs/website to /home/iojs/website.github/, I don't think we are doing that currently. The above command will also need /home/iojs/.npm/ to be made and owned by iojs.
The text was updated successfully, but these errors were encountered: