-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-heroku.sh
More file actions
42 lines (24 loc) · 898 Bytes
/
deploy-heroku.sh
File metadata and controls
42 lines (24 loc) · 898 Bytes
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
#!/bin/bash
# deploy_heroku - A script to deploy app to free heroku cloud server
# Usage: $> sh deploy-heroku.sh <appname> <base_configfile_url>
# Exemple: $> sh deploy-heroku.sh opendisqueeconomia https://opencuritiba.herokuapp.com/bases/disqueeconomia.json
##### Constants
TITLE="Deploy to Heroku: $1"
RIGHT_NOW=$(date +"%x %r %Z")
TIME_STAMP="Updated on $RIGHT_NOW by $USER"
##### Main
echo "$TITLE"
echo "$TIME_STAMP"
if [[ $# -gt 1 ]]; then
heroku create $1
git remote add $1 https://git.heroku.com/$1.git
heroku addons:create mongolab:sandbox --app $1
heroku config:set BASE_JSON=$2 --app $1
heroku config:set NODE_ENV=production --app $1
heroku config:set CONFIG={} --app $1
git push $1 master
heroku run node sync.js --app $1
echo "Finished"
else
echo "Wrong number of arguments: call should be like 'sh deploy-heroku.sh <appname> <base_configfile_url>'"
fi