Skip to content

Instantly share code, notes, and snippets.

@fguisso
Created September 4, 2017 17:51
Show Gist options
  • Save fguisso/20d9301c18645cc92e561000131df535 to your computer and use it in GitHub Desktop.
Save fguisso/20d9301c18645cc92e561000131df535 to your computer and use it in GitHub Desktop.
.circleci config
version: 2
jobs:
build:
working_directory: ~/dev
docker:
- image: circleci/node:latest
steps:
- checkout
- run:
name: update-npm
command: 'sudo npm install'
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: npm-install-semver
command: 'sudo npm install semver'
- run:
name: npm-install-semver
command: 'sudo npm install swagger'
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules
- run:
name: test
command: npm test
- setup_remote_docker
- run:
name: Build and push Docker image
command: |
TAG="1.0.${CIRCLE_BUILD_NUM}"
docker build -t mantris/repo-name:$TAG .
docker login -u $DOCKER_USER -p $DOCKER_PASS
docker push mantris/repo-name:$TAG
- add_ssh_keys:
fingerprints:
- "a1:a2:a3:b1:b2:b3:d4:d5:d6:e1:e2:e3:e4:ff:fe:fd"
- deploy:
name: Deploy image to AWS Instance
command: sudo chmod +x deploy.sh && ./deploy.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment