Skip to content

Website build on commit #58

@rvagg

Description

@rvagg

cc @iojs/website

Currently we are using github-webhook with the following configuration on the server:

{
  "port": 9999,
  "path": "/webhook",
  "secret": "orly?",
  "log": "/home/iojs/github-webhook.log",
  "rules": [{
    "event": "push",
    "match": "ref == \"refs/heads/master\" && repository.full_name == \"iojs/website\"",
    "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/"
  }]
}

i.e. the "build" process is:

  1. in the existing clone of iojs/website, do a reset and clean
  2. fetch from origin
  3. checkout origin/master
  4. rsync the ./public/ directory of the repo into the live site directory

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:

docker pull iojs:latest && \
docker run \
  --rm \
  -v /home/iojs/website.github/:/website/ \
  -v /home/iojs/.npm:/npm/ \
  iojs:latest \
  bash -c " \
    adduser iojs --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 \
    ' \
  "

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions