-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwercker.yml
64 lines (60 loc) · 1.93 KB
/
wercker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
box: ruby:2.3.1
# This is the build pipeline. Pipelines are the core of wercker
# Read more about pipelines on our dev center
# http://devcenter.wercker.com/docs/pipelines/index.html
build:
services:
- id: postgres
env:
POSTGRES_PASSWORD: $PG_PASS
POSTGRES_USER: $PG_USER
# Steps make up the actions in your pipeline
steps:
- bundle-install:
jobs: 4
# Prepare postgresql for Rails
- rails-database-yml:
service: postgresql-docker
# - install-packages:
# name: Install node.js, build-essential, libpq-dev
# packages: build-essential libpq-dev nodejs
- script:
name: Set up db
code: |
RAILS_ENV=test bundle exec rake db:schema:load
- script:
name: rspec
code: bundle exec rspec
#Slack Notification
after-steps:
- slack-notifier:
url: $SLACK_URL
channel: $SLACK_CHANNEL
username: werckerbot
notify_on: "failed"
deploy:
# Deploy to staging server
steps:
- add-to-known_hosts:
hostname: $STAGING_IP_ADDRESS
- add-ssh-key:
keyname: $KEYNAME
- mktemp:
envvar: PRIVATEKEY_PATH
- create-file:
name: write key
filename: $PRIVATEKEY_PATH
content: $FLORENCE_PRIVATE
overwrite: true
- script:
name: transfer application
code: |
pwd
ls -la
echo "cd $PROJECT_FOLDER && git pull origin dev && bundle install && kill \`cat $PROJECT_FOLDER/tmp/pids/server.pid\` && rails s -d -b $STAGING_IP_ADDRESS -p 8080" | ssh root@$STAGING_IP_ADDRESS
after-steps:
- slack-notifier:
url: $SLACK_URL
channel: $SLACK_CHANNEL
username: werckerbot
#notify_on: "failed"