Skip to content

Instantly share code, notes, and snippets.

@coorasse
Created September 13, 2018 08:46
Show Gist options
  • Save coorasse/10c726ad91332a688d44f805927e3b5b to your computer and use it in GitHub Desktop.
Save coorasse/10c726ad91332a688d44f805927e3b5b to your computer and use it in GitHub Desktop.
Example of Bitbucket Pipeline for Ruby 2.5.1 + Webpacker + System Tests + Deployment to Elastic Beanstalk
image: circleci/ruby:2.5.1-node-browsers
pipelines:
default:
- step: &tests
name: Tests
caches:
- bundler
- node
services:
- postgres
script:
- bundle install --path vendor/bundle --without production development --jobs 3 --retry 3
- cp .env.example .env
- yarn install
- bundle exec rspec
- bundle exec rubocop
branches:
master:
- step:
<<: *tests
- step:
name: Deploy
deployment: master
caches:
- pip
script:
- pwd
- sudo apt-get update && sudo apt-get install -y python-dev
- curl -O https://bootstrap.pypa.io/get-pip.py
- python get-pip.py --user
- export PATH=~/.local/bin:$PATH
- pip install 'awsebcli==3.14.4' --upgrade --user
- pip install 'awscli==1.15.59' --upgrade --user
- eb init 'Your Website Name' -r eu-central-1 -p 'Ruby 2.5 (Puma)'
- eb deploy master
definitions:
services:
postgres:
image: postgres
environment:
POSTGRES_DB: database_schema_name
POSTGRES_USER: circleci
caches:
bundler: vendor/bundle
pip: ~/.cache/pip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment