Skip to content

Instantly share code, notes, and snippets.

@chiefy
Created February 3, 2016 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chiefy/0fe065c95fde8d36d103 to your computer and use it in GitHub Desktop.
Save chiefy/0fe065c95fde8d36d103 to your computer and use it in GitHub Desktop.
wercker
dev:
box:
id: quay.io/oddnetworks/alpine-nodejs-builder
tag: 4.2.6
registry: https://quay.io
services:
- elasticsearch
steps:
- script:
name: export env
code: |
export ODD_ES_HOST=${ELASTICSEARCH_PORT_9200_TCP_ADDR}:9200
export NODE_ENV=development
- internal/watch:
code: node index.js
reload: true
build:
box:
id: alpine
cmd: /bin/sh
services:
- elasticsearch
steps:
- script:
name: npm install
code: |
apk update && apk add git build-base python krb5-dev nodejs && npm install && apk del build-base git python krb5-dev
- script:
name: export env
code: |
export ODD_ES_HOST=${ELASTICSEARCH_PORT_9200_TCP_ADDR}:9200
export NODE_ENV=test
- npm-test
- script:
name: copy files
code: |
cp $(which node) "$WERCKER_OUTPUT_DIR"
cp -RL node_modules config lib middleware lib public routes services config.js index.js odd-device-service.js package.json "$WERCKER_OUTPUT_DIR"
deploy:
box:
id: alpine
cmd: /bin/sh
steps:
- internal/docker-scratch-push:
username: $DOCKER_USERNAME
password: $DOCKER_PASSWORD
cmd: ./node ./index.js
tag: $WERCKER_GIT_COMMIT
ports: "8000"
repository: chiefy/odd-device-api
registry: https://registry.hub.docker.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment