Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
update to use deployer accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
James C. Scott committed May 10, 2017
1 parent e6e8738 commit dcb2bb6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,15 @@ uaac client add <your-client-id> \


### CI
This project uses CircleCI
- The following environment variables need to be set in plain text in the global env section:
- `CONSOLE_API_URL`, `CONSOLE_UAA_URL`, `CONSOLE_LOG_URL`, `CONSOLE_LOGIN_URL`, `CONSOLE_HOSTNAME="http://localhost:9999"`, `CONSOLE_TEST_ORG_NAME`, `CONSOLE_TEST_SPACE_NAME`, and `CONSOLE_TEST_APP_NAME`
This project uses CircleCI.
- You will need to setup the credentials to deploy to the `dashboard-prod` and `dashboard-stage` spaces.
- In both spaces run: `cf create-service cloud-gov-service-account space-deployer dashboard-deployer`
- You will get the link for that space's credentials by running `cf service dashboard-deployer`
- You will need to set these [**secret**](https://circleci.com/docs/1.0/environment-variables/#setting-environment-variables-for-all-commands-without-adding-them-to-git) variables in the [CircleCI UI](https://circleci.com/gh/18F/cg-dashboard/edit#env-vars).
- `CF_USERNAME_PROD_SPACE` - The username for the `dashboard-prod` deployer
- `CF_PASSWORD_PROD_SPACE` - The password for the `dashboard-prod` deployer
- `CF_USERNAME_STAGE_SPACE` - The username for the `dashboard-stage` deployer
- `CF_PASSWORD_STAGE_SPACE` - The password for the `dashboard-stage` deployer
- In case you fork this project for your own use (no need to do this if forking to make a pull request), you will need to use the CircleCI CLI UI to set the variables


Expand Down
19 changes: 18 additions & 1 deletion deploy/circle_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ cf install-plugin -f /home/ubuntu/.go_workspace/bin/autopilot
# Only the organization, api, deployer account password differ.



if [[ "$CIRCLE_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)? ]]
then
CF_MANIFEST="manifest-prod.yml"
Expand All @@ -43,14 +44,30 @@ else
exit 1
fi

# We use the deployer-account broker and setup.
if [ "$CF_SPACE" == "dashboard-prod" ]
then
CF_USERNAME=$CF_USERNAME_PROD_SPACE
CF_PASSWORD=$CF_PASSWORD_PROD_SPACE
elif [ "$CF_SPACE" == "dashboard-stage" ]
then
CF_USERNAME=$CF_USERNAME_STAGE_SPACE
CF_PASSWORD=$CF_PASSWORD_STAGE_SPACE
else
echo "Unknown space. Do not know how to deploy $CF_SPACE."
exit 1
fi

echo env: $manifest_env
echo manifest: $CF_MANIFEST
echo space: $CF_SPACE

if [ $manifest_env == govcloud ]; then
CF_API=$CF_API_GC
CF_PASSWORD=$CF_PASSWORD_GC
CF_ORGANIZATION=$CF_ORGANIZATION_GC
else
echo "We only support deploying to govcloud, quitting." >&2
exit 1
fi

function deploy () {
Expand Down

0 comments on commit dcb2bb6

Please sign in to comment.