Skip to content

Commit

Permalink
Allow other startup options for staging etc
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotcm committed Feb 22, 2019
1 parent 74ba4bb commit e299dbe
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,30 @@

bundle install

function set_env() {
export GOVUK_APP_DOMAIN=www.$1
export GOVUK_WEBSITE_ROOT=https://www.$1
export PLEK_SERVICE_CONTENT_STORE_URI=${PLEK_SERVICE_CONTENT_STORE_URI-https://www.$1/api}
export PLEK_SERVICE_RUMMAGER_URI=${PLEK_SERVICE_RUMMAGER_URI-https://www.$1/api}
export PLEK_SERVICE_SEARCH_URI=${PLEK_SERVICE_SEARCH_URI-https://www.$1/api}
}

if [[ $1 == "--live" ]] ; then
GOVUK_APP_DOMAIN=www.gov.uk \
GOVUK_WEBSITE_ROOT=https://www.gov.uk \
PLEK_SERVICE_CONTENT_STORE_URI=${PLEK_SERVICE_CONTENT_STORE_URI-https://www.gov.uk/api} \
PLEK_SERVICE_STATIC_URI=${PLEK_SERVICE_STATIC_URI-assets.publishing.service.gov.uk} \
PLEK_SERVICE_RUMMAGER_URI=${PLEK_SERVICE_RUMMAGER_URI-https://www.gov.uk/api} \
PLEK_SERVICE_SEARCH_URI=${PLEK_SERVICE_SEARCH_URI-https://www.gov.uk/api} \
bundle exec rails s -p 3090
set_env "gov.uk"
export PLEK_SERVICE_STATIC_URI=${PLEK_SERVICE_STATIC_URI-assets.publishing.service.gov.uk}
elif [[ $1 == "--staging" ]] ; then
set_env "staging.publishing.service.gov.uk"
export PLEK_SERVICE_STATIC_URI=${PLEK_SERVICE_STATIC_URI-assets.staging.publishing.service.gov.uk}
elif [[ $1 == "--integration" ]] ; then
set_env "integration.publishing.service.gov.uk"
export PLEK_SERVICE_STATIC_URI=${PLEK_SERVICE_STATIC_URI-assets.integration.publishing.service.gov.uk}
elif [[ $1 == "--dummy" ]] ; then
GOVUK_APP_DOMAIN=www.gov.uk \
GOVUK_WEBSITE_ROOT=https://www.gov.uk \
PLEK_SERVICE_CONTENT_STORE_URI=${PLEK_SERVICE_CONTENT_STORE_URI-https://govuk-content-store-examples.herokuapp.com/api} \
PLEK_SERVICE_STATIC_URI=${PLEK_SERVICE_STATIC_URI-assets.publishing.service.gov.uk} \
PLEK_SERVICE_RUMMAGER_URI=${PLEK_SERVICE_RUMMAGER_URI-https://www.gov.uk/api} \
PLEK_SERVICE_SEARCH_URI=${PLEK_SERVICE_SEARCH_URI-https://www.gov.uk/api} \
bundle exec rails s -p 3090
else
bundle exec rails s -p 3090
export GOVUK_APP_DOMAIN=www.gov.uk
export GOVUK_WEBSITE_ROOT=https://www.gov.uk
export PLEK_SERVICE_CONTENT_STORE_URI=${PLEK_SERVICE_CONTENT_STORE_URI-https://govuk-content-store-examples.herokuapp.com/api}
export PLEK_SERVICE_STATIC_URI=${PLEK_SERVICE_STATIC_URI-assets.publishing.service.gov.uk}
export PLEK_SERVICE_RUMMAGER_URI=${PLEK_SERVICE_RUMMAGER_URI-https://www.gov.uk/api}
export PLEK_SERVICE_SEARCH_URI=${PLEK_SERVICE_SEARCH_URI-https://www.gov.uk/api}
fi

bundle exec rails s -p 3090

0 comments on commit e299dbe

Please sign in to comment.