daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Apr 17th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/bash -e
  2.  
  3. # This script will create 10 different organizations
  4. # with 2 spaces within each org and 5 users in each org.
  5. # Written by Derek So on 23 Mar 2018
  6.  
  7. cf login -u admin
  8.  
  9. TEAMSIZE=10
  10. USERPERTEAM=5
  11. TEAMPREFIX=team
  12. PASSPREFIX=changeme
  13. for t in $(seq -f '%02g' 01 $TEAMSIZE)
  14.   do
  15.     cf create-org $TEAMPREFIX$t
  16.     cf create-space dev -o $TEAMPREFIX$t
  17.     cf create-space prod -o $TEAMPREFIX$t
  18.     for u in $(seq -f '%02g' 01 $USERPERTEAM)
  19.       do
  20.       cf create-user user$t$u $PASSPREFIX$t$u
  21.       cf set-org-role user$t$u $TEAMPREFIX$t OrgManager
  22.       cf set-space-role user$t$u $TEAMPREFIX$t dev SpaceManager
  23.       cf set-space-role user$t$u $TEAMPREFIX$t dev SpaceDeveloper
  24.       cf set-space-role user$t$u $TEAMPREFIX$t prod SpaceManager
  25.       cf set-space-role user$t$u $TEAMPREFIX$t prod SpaceDeveloper
  26.       done
  27.   done
RAW Paste Data
Top