Skip to content

Instantly share code, notes, and snippets.

@krujos
Last active August 29, 2015 14:20
Show Gist options
  • Save krujos/53f50e48661047c3fc7c to your computer and use it in GitHub Desktop.
Save krujos/53f50e48661047c3fc7c to your computer and use it in GitHub Desktop.
Provision a new org into cloud foundry. This assumes emails are formatted in first_last@example.com format
[
{
"protocol": "all",
"destination": "10.0.1.0/24"
}
]
first_user@gmail.com
second_user@gmail.com
#!/bin/sh
for email in `cat org-admin-emails.txt` ; do
org=`echo $email | tr '_' "\n" | colrm 2 | tr -d "\n" && echo -org`
echo "INFO: Cleaning up $org: for $email"
cf delete-org $org -f
cf delete-user $email -f
done
#!/bin/sh
cf create-security-group development-security-group ./development-security-group.json
for email in `cat org-admin-emails.txt` ; do
org=`echo $email | tr '_' "\n" | colrm 2 | tr -d "\n" && echo -org`
echo "INFO: Setting up $org: for $email"
cf create-org $org
cf create-space development -o $org
cf create-space production -o $org
cf create-user $email password
cf set-org-role admin $org OrgManager
cf set-org-role $email $org OrgManager
cf set-space-role $email $org development SpaceManager
cf set-space-role $email $org development SpaceDeveloper
cf set-space-role $email $org production SpaceManager
cf set-space-role $email $org production SpaceDeveloper
cf bind-security-group development-security-group $org development
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment