Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- image: "ruby:2.3"
- services:
- - postgres:latest
- variables:
- POSTGRES_DB: staging
- POSTGRES_USER: postgres
- POSTGRES_PASSWORD: postgres
- HEROKU_STAGING_API_KEY: 4bdb9a3e-204e-4dff-ae30
- LOCAL_DIR: ~/src
- REMOTE_DIR: /src/www/public/live
- USERNAME: zhiephie
- PASSWORD: password
- HOST: IP
- cache:
- paths:
- - vendor/ruby
- before_script:
- - ruby -v
- - apt-get update -q && apt-get install nodejs -yqq
- - gem install bundler --no-ri --no-rdoc
- - bundle install -j $(nproc) --path vendor
- test:
- script:
- - bundle exec rake db:create RAILS_ENV=test
- - bundle exec rake db:migrate
- - bundle exec rake test
- staging:
- type: deploy
- script:
- - gem install dpl
- - dpl --provider=heroku --app=staging-timexstudio --api-key=$HEROKU_STAGING_API_KEY
- only:
- - master
- production:
- type: deploy
- script:
- - apt-get install lftp
- - lftp -e "mirror -R $LOCAL_DIR $REMOTE_DIR" -u $USERNAME,$PASSWORD $HOST
- only:
- - tags
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement