Skip to content

Instantly share code, notes, and snippets.

@lvjian700
Last active January 8, 2018 03:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save lvjian700/7c295e6a596e96526049f831d0eb8b13 to your computer and use it in GitHub Desktop.
Save lvjian700/7c295e6a596e96526049f831d0eb8b13 to your computer and use it in GitHub Desktop.
CD of microservices session
steps:
-
name: "Run my tests"
command: "ci/bin/test"
agents:
queue: test
- wait
-
name: "Push docker image"
command: "ci/bin/docker-tag"
branches: "master"
agents:
queue: test
- wait
-
name: "Deploy To Test"
command: "deploy"
branches: "master"
env:
DEPLOYMENT_ENV: test
agents:
queue: test
- block
- name: "Deploy to Production"
command: "deploy"
branches: "master"
env:
DEPLOYMENT_ENV: production
agents:
queue: production
db:
image: postgres:9.4
ports:
- "5432"
web:
build: .
command: ./bin/run
volumes:
- .:/app
ports:
- "3000:3000"
dev:
extends:
file: docker-compose.yml
service: web
links:
- db
environment:
- RAILS_ENV=development
ci:
extends:
file: docker-compose.yml
service: web
links:
- db
environment:
- RAILS_ENV=test
FROM ubuntu-ruby2.3:latest
RUN apt-get update -y
RUN apt-get install -y libpq-dev nodejs git
WORKDIR /app
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN bundle install --jobs 8 --retry 3
ADD . /app
EXPOSE 80
CMD ["bin/run"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment