Skip to content

Commit 045f27f

Browse files
committed
switch to yaml
1 parent 7b39ba4 commit 045f27f

File tree

3 files changed

+62
-33
lines changed

3 files changed

+62
-33
lines changed

README.md

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ From `rake deploy`
2323

2424
```
2525
Deploys the currently checked out revision to Heroku.
26-
Reads the project's app.json file to determine tasks for a target.
26+
Reads the project's deploy.yml file to determine tasks for a target.
2727
Tasks include:
2828
Tag the release and pushes it to github
2929
Deploy the release to Heroku
@@ -36,36 +36,39 @@ usage: rake deploy TARGET=target_name
3636
usage: rake deploy:{staging|production}
3737
```
3838

39-
## Example app.json
40-
41-
This is very similar and compatible with Heroku's `app.json`.
42-
43-
```json
44-
{
45-
"name": "Our Cool App",
46-
"description": "Great app to use all the time.",
47-
"website": "https://www.ourcoolapp.com",
48-
"heroku-environments": {
49-
"staging": {
50-
"app-name": "ourcoolapp-staging",
51-
"tag-name": false,
52-
"force-push": true,
53-
"scripts": [
54-
{ "cmd": "rake db:migrate", "restart": true }
55-
]
56-
},
57-
"production": {
58-
"app-name": "ourcoolapp-production",
59-
"force-push": false,
60-
"tag-name": "prod",
61-
"scripts": [
62-
{ "cmd": "rake db:migrate", "restart": true, "remote": true },
63-
{ "cmd": "say 'deploy complete'"}
64-
]
65-
}
66-
},
67-
"source-repo": "[email protected]:wizarddevelopment/ourcoolapp.git"
68-
}
39+
## Example deploy.yml
40+
41+
This is very similar to Heroku's `app.json` but as a yml file
42+
43+
```yml
44+
---
45+
name: Our Cool App
46+
description: Great app to use all the time.
47+
website: "https://www.ourcoolapp.com"
48+
heroku-environments:
49+
staging:
50+
app-name: "ourcoolapp-staging"
51+
tag-name: false
52+
force-push: true
53+
scripts:
54+
- cmd: "rake db:migrate"
55+
restart: true
56+
remote: true
57+
- cmd: "rake coolapp:do_something_on_deploy"
58+
remote: true
59+
production:
60+
app-name: "ourcoolapp-production"
61+
force-push: false
62+
tag-name: prod
63+
scripts:
64+
- cmd: "rake db:migrate"
65+
restart: true
66+
remote: true
67+
- cmd: "rake coolapp:do_something_on_deploy"
68+
remote: true
69+
- cmd: "say 'deploy complete'"
70+
source-repo: "[email protected]:wizarddevelopment/ourcoolapp.git"
71+
6972
```
7073
7174

lib/wizarddev/heroku/deploy.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def restart
8888
end
8989

9090
def load_config
91-
JSON.parse(File.read('app.json'))
91+
YAML.load_file('deploy.yml')
9292
end
9393

9494
def source_repo
@@ -116,7 +116,6 @@ def config
116116
raise "No configuration for #{target} in app.js" unless c
117117
c
118118
end
119-
120119
end
121120
end
122121
end

sample.deploy.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Our Cool App
3+
description: Great app to use all the time.
4+
website: "https://www.ourcoolapp.com"
5+
heroku-environments:
6+
staging:
7+
app-name: "ourcoolapp-staging"
8+
tag-name: false
9+
force-push: true
10+
scripts:
11+
- cmd: "rake db:migrate"
12+
restart: true
13+
remote: true
14+
- cmd: "rake coolapp:do_something_on_deploy"
15+
remote: true
16+
production:
17+
app-name: "ourcoolapp-production"
18+
force-push: false
19+
tag-name: prod
20+
scripts:
21+
- cmd: "rake db:migrate"
22+
restart: true
23+
remote: true
24+
- cmd: "rake coolapp:do_something_on_deploy"
25+
remote: true
26+
- cmd: "say 'deploy complete'"
27+
source-repo: "[email protected]:wizarddevelopment/ourcoolapp.git"

0 commit comments

Comments
 (0)