Skip to content

Instantly share code, notes, and snippets.

@xjunior
Created July 26, 2018 22:17
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 xjunior/b43abae4f33c80672ec082a4e1b601aa to your computer and use it in GitHub Desktop.
Save xjunior/b43abae4f33c80672ec082a4e1b601aa to your computer and use it in GitHub Desktop.
image: docker:latest
services:
- docker:dind
variables:
BACKEND_IMAGE: 'rainbows-backend:$CI_COMMIT_SHA'
stages:
- frontend
- backend
- deploy
frontend:
image: node:alpine
stage: frontend
before_script:
- yarn --cwd web_ui install
script:
- yarn --cwd web_ui test
- yarn --cwd web_ui build --dest ../dist
artifacts:
paths:
- dist
backend:
image: tmaier/docker-compose:latest
stage: backend
before_script:
- mv dist server/apps/server_web/priv/static
- docker build server/ -t $BACKEND_IMAGE
script:
- ./compose.sh ci run web deps.get, test
- ./compose.sh ci run cucumber
artifacts:
when: on_failure
expire_in: 1 week
paths:
- cucumber/videos
production:
stage: deploy
before_script:
- mv dist server/apps/server_web/priv/static
- docker build server/ -t $BACKEND_IMAGE
- apk -U add curl
script:
- ./deploy.sh $BACKEND_IMAGE $HEROKU_APP $HEROKU_DEPLOY_KEY
environment:
name: Production
url: https://rainbows.ai
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment