Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash -e
- # This script will create 10 different organizations
- # with 2 spaces within each org and 5 users in each org.
- # Written by Derek So on 23 Mar 2018
- cf login -u admin
- TEAMSIZE=10
- USERPERTEAM=5
- TEAMPREFIX=team
- PASSPREFIX=changeme
- for t in $(seq -f '%02g' 01 $TEAMSIZE)
- do
- cf create-org $TEAMPREFIX$t
- cf create-space dev -o $TEAMPREFIX$t
- cf create-space prod -o $TEAMPREFIX$t
- for u in $(seq -f '%02g' 01 $USERPERTEAM)
- do
- cf create-user user$t$u $PASSPREFIX$t$u
- cf set-org-role user$t$u $TEAMPREFIX$t OrgManager
- cf set-space-role user$t$u $TEAMPREFIX$t dev SpaceManager
- cf set-space-role user$t$u $TEAMPREFIX$t dev SpaceDeveloper
- cf set-space-role user$t$u $TEAMPREFIX$t prod SpaceManager
- cf set-space-role user$t$u $TEAMPREFIX$t prod SpaceDeveloper
- done
- done
Add Comment
Please, Sign In to add comment