Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name the app that's deployed to Heroku #2097

Merged
merged 3 commits into from
Nov 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions doc/factcheck.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Deploying changes for Factcheck

When making bigger changes that need to be tested or fact-checked before they are deployed to GOV.UK it is best to deploy the branch with changes to Heroku.

If you open a PR to review those changes, make sure to mention if it's being fact-checked and should not be merged to master until that's done.
When making bigger changes that need to be tested or fact-checked before they are deployed to GOV.UK you'll need to deploy the branch with changes to Heroku.

## Deploying to Heroku

The 'startup_heroku.sh' shell script will create and configure an app on Heroku, push the __current branch__ and open the marriage-abroad Smart Answer in the browser.
Start by creating a GitHub pull request with the changes you want to deploy. Add the ["Waiting on factcheck" label](https://github.com/alphagov/smart-answers/labels/Waiting%20on%20factcheck) to the pull request to let other developers know that it's not ready to be reviewed.

Make a note of the pull request number and use the `startup_heroku.sh` script to deploy your changes to Heroku:

$ PR=<number-of-pull-request> ./startup_heroku.sh

This script will create and configure an app on Heroku, push the __current branch__ and open the marriage-abroad Smart Answer in the browser.

Once deployed you'll need to use the standard `git push` mechanism to deploy your changes.

Expand Down
16 changes: 13 additions & 3 deletions startup_heroku.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
#!/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
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=preview.alphagov.co.uk \
PLEK_SERVICE_CONTENTAPI_URI=https://www.gov.uk/api \
PLEK_SERVICE_STATIC_URI=https://assets-origin.preview.alphagov.co.uk \
Expand All @@ -20,13 +30,13 @@ echo
echo "# Pushing the current branch to Heroku's master"
echo
export CURRENT_BRANCH_NAME=`git branch | grep "^\*" | cut -d" " -f2`
git push heroku $CURRENT_BRANCH_NAME:master
git push $HEROKU_REMOTE $CURRENT_BRANCH_NAME:master

echo
echo "# Opening Smart Answers"
echo "*NOTE.* You may have to refresh as the app can be slow to start"
echo
export HEROKU_URL=`heroku apps:info | grep "Web URL" | cut -c16-`
export HEROKU_URL=`heroku apps:info --app $APP_NAME | grep "Web URL" | cut -c16-`
export SMART_ANSWER_TO_OPEN="marriage-abroad"
open $HEROKU_URL$SMART_ANSWER_TO_OPEN

Expand Down