forked from alphagov/smart-answers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
startup_heroku.sh
executable file
·55 lines (48 loc) · 1.53 KB
/
startup_heroku.sh
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
#!/bin/bash
if [ -z "$PR" ];
then
echo "Usage: PR=<pull-request-number> ./startup_heroku.sh"
exit 1
fi
export APP_NAME="smart-answers-pr-$PR"
export HEROKU_REMOTE="heroku-$APP_NAME"
echo
echo "# Creating a new Heroku App"
echo
heroku apps:create --region eu --remote $HEROKU_REMOTE $APP_NAME
echo
echo "# Configuring Heroku ready for Smart Answers"
echo
heroku config:set \
--app $APP_NAME \
GOVUK_APP_DOMAIN=integration.publishing.service.gov.uk \
PLEK_SERVICE_CONTENT_STORE_URI=https://www.gov.uk/api \
PLEK_SERVICE_STATIC_URI=https://assets-origin.integration.publishing.service.gov.uk/ \
RUNNING_ON_HEROKU=true \
EXPOSE_GOVSPEAK=true \
ERRBIT_ENV=integration
echo
echo "# Pushing the current branch to Heroku's master"
echo
export CURRENT_BRANCH_NAME=`git branch | grep "^\*" | cut -d" " -f2`
git push $HEROKU_REMOTE $CURRENT_BRANCH_NAME:master
export HEROKU_URL=`heroku apps:info --app $APP_NAME | grep "Web URL" | cut -c16-`
export SMART_ANSWER_TO_OPEN="marriage-abroad"
if type open 2>/dev/null; then
echo
echo "# Opening Smart Answers"
echo "*NOTE.* You may have to refresh as the app can be slow to start"
echo
open $HEROKU_URL$SMART_ANSWER_TO_OPEN
else
echo
echo "# Smart Answers URL"
echo "*NOTE.* You may have to refresh as the app can be slow to start"
echo
echo $HEROKU_URL$SMART_ANSWER_TO_OPEN
fi
echo
echo "*Set ERRBIT_API_KEY and ERRBIT_HOST manually to enable error reporting*"
echo "*You can find those key values on https://errbit.<environment>.publishing.service.gov.uk*"
echo "All done"
echo