Will Munn
works at: focusrite/novation
github: @willm
Team A
Team B
Team C
4.x.x
7.10.0
#! /env/sh
npm install
npm test
git push heroku masterYour build script
git clone git@github.com:willm/speed-up-ci.gitCheckout source
Build step to build and deploy your code
#!/usr/bin/env/ sh
npm install
npm test
git push heroku masterYour build script
git clone git@github.com:willm/speed-up-ci.gitCheckout source
Build step to build and deploy your code
0 9 * * *Cron to run build at 9:00am daily
Plugin that configures canned test data
Plugin that reports awesome test output
Your build script
Plugin that emails stake holders when a release happens
Plugin that zips your built source only and stores it somewhere
Super awesome plugin that is critical to making a release functional.
You can't deploy because the CI server that holds the of the necessary steps is down
#!/usr/bin/env bash
npm init
npm install --save express request mocha typescript grunt$ du -h -d 1
50M ./node_modules
50M .
$ ls -al node_modules | wc -l
199
$ find . -type f | wc -l
4086const http = require('http');
http.createServer((req, res) => {
res.writeHead(200, {'Content-Type': 'application/json'});
res.end(JSON.stringify({greeting: 'Hello World'}));
}).listen(3000);needle 808Kb vs request 6.3Mb
tape 2.1Mb vs ava 34Mb
router 1.1Mb vs express 1.7Mb
npm scripts vs $BUILD_TOOL
FROM node:7.10.0-alpine
RUN mkdir /app
ADD package.json /app/package.json
WORKDIR /app
RUN npm install
ADD . /app
RUN npm run build$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
node 6.9.2 178934e73268 6 days ago 651.2 MB
node 6.9.2-alpine de529845c111 6 days ago 50.69 MBFROM 7.10.0-alpine
ADD . /app
WORKDIR /app
CMD npm start
'.' should be a directory containing your built application without dev dependencies, tests and anything else that isn't needed by your application at runtime.
https://codefresh.io/blog/node_docker_multistage/
version: '2'
services:
openshift:
build:
context: './src/test/containers/openshift'
dockerfile: 'Dockerfile'
service:
build:
context: './src/test/containers/service'
dockerfile: 'Dockerfile'
mutual-ssl-service:
build:
context: './src/test/containers/mutual-ssl-service'
dockerfile: 'Dockerfile'
api:
build:
context: '.'
dockerfile: dev.Dockerfile
image: 'yaapi'
expose:
- '3000'
links:
- service
- mutual-ssl-service
- openshift
environment: '...'
command: sh -c 'npm start | node_modules/.bin/bunyan'
tests:
container_name: tests
image: yaapi
command: 'npm test'
working_dir: /app
links:
- api
- service