{"action":"created","issue":{"url":"https://api.github.com/repos/iojs/build/issues/58","labels_url":"https://api.github.com/repos/iojs/build/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/iojs/build/issues/58/comments","events_url":"https://api.github.com/repos/iojs/build/issues/58/events","html_url":"https://github.com/iojs/build/issues/58","id":58512116,"number":58,"title":"Website build on commit","user":{"login":"rvagg","id":495647,"avatar_url":"https://avatars.githubusercontent.com/u/495647?v=3","gravatar_id":"","url":"https://api.github.com/users/rvagg","html_url":"https://github.com/rvagg","followers_url":"https://api.github.com/users/rvagg/followers","following_url":"https://api.github.com/users/rvagg/following{/other_user}","gists_url":"https://api.github.com/users/rvagg/gists{/gist_id}","starred_url":"https://api.github.com/users/rvagg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvagg/subscriptions","organizations_url":"https://api.github.com/users/rvagg/orgs","repos_url":"https://api.github.com/users/rvagg/repos","events_url":"https://api.github.com/users/rvagg/events{/privacy}","received_events_url":"https://api.github.com/users/rvagg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/iojs/build/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/iojs/build/labels/website","name":"website","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-02-22T18:18:08Z","updated_at":"2015-03-15T12:22:06Z","closed_at":null,"body":"cc @iojs/website \r\n\r\nCurrently we are using [github-webhook](https://github.com/rvagg/github-webhook) with the following configuration on the server:\r\n\r\n```json\r\n{\r\n  \"port\": 9999,\r\n  \"path\": \"/webhook\",\r\n  \"secret\": \"orly?\",\r\n  \"log\": \"/home/iojs/github-webhook.log\",\r\n  \"rules\": [{\r\n    \"event\": \"push\",\r\n    \"match\": \"ref == \\\"refs/heads/master\\\" && repository.full_name == \\\"iojs/website\\\"\",\r\n    \"exec\": \"cd /home/iojs/website.github/ && git reset --hard && git clean -fdx && git fetch origin && git checkout origin/master && rsync -avz --delete --exclude .git /home/iojs/website.github/public/ /home/iojs/www/\"\r\n  }]\r\n}\r\n```\r\n\r\ni.e. the \"build\" process is:\r\n\r\n1. in the existing clone of iojs/website, do a reset and clean\r\n2. fetch from origin\r\n3. checkout origin/master\r\n4. rsync the ./public/ directory of the repo into the live site directory\r\n\r\nWhat 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.\r\n\r\nSomething like this:\r\n\r\n```\r\ndocker pull iojs:latest && \\\r\ndocker run \\\r\n  --rm \\\r\n  -v /home/iojs/website.github/:/website/ \\\r\n  -v /home/iojs/.npm:/npm/ \\\r\n  iojs:latest \\\r\n  bash -c \" \\\r\n    adduser iojs --gecos iojs --disabled-password && \\\r\n    su iojs -c ' \\\r\n      npm config set loglevel http && \\\r\n      npm config set cache /npm/ && \\\r\n      cd /website/ && \\\r\n      npm install && \\\r\n      node_modules/.bin/gulp build \\\r\n    ' \\\r\n  \"\r\n```\r\n\r\nI'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.\r\n\r\nNote 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."},"comment":{"url":"https://api.github.com/repos/iojs/build/issues/comments/80988937","html_url":"https://github.com/iojs/build/issues/58#issuecomment-80988937","issue_url":"https://api.github.com/repos/iojs/build/issues/58","id":80988937,"user":{"login":"snostorm","id":6534,"avatar_url":"https://avatars.githubusercontent.com/u/6534?v=3","gravatar_id":"","url":"https://api.github.com/users/snostorm","html_url":"https://github.com/snostorm","followers_url":"https://api.github.com/users/snostorm/followers","following_url":"https://api.github.com/users/snostorm/following{/other_user}","gists_url":"https://api.github.com/users/snostorm/gists{/gist_id}","starred_url":"https://api.github.com/users/snostorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snostorm/subscriptions","organizations_url":"https://api.github.com/users/snostorm/orgs","repos_url":"https://api.github.com/users/snostorm/repos","events_url":"https://api.github.com/users/snostorm/events{/privacy}","received_events_url":"https://api.github.com/users/snostorm/received_events","type":"User","site_admin":false},"created_at":"2015-03-15T12:22:06Z","updated_at":"2015-03-15T12:22:06Z","body":"https://github.com/iojs/website/pull/287 is now sitting on https://github.com/iojs/website/tree/test\r\n\r\nIt'll generate a `releases.html` from the latest https://iojs.org/dist/index.json as well as using it to power the version info seen throughout the site."}}