forked from knative/client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A few updates to permissions.sh (knative#771)
Nits, nits, nits. :)
- Loading branch information
1 parent
b3ba92e
commit ddaab49
Showing
3 changed files
with
29 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,28 +14,36 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
project=$1 | ||
owners=("[email protected]") | ||
groups=("[email protected]") | ||
sas=("[email protected]" "[email protected]" "[email protected]" "[email protected]") | ||
apis=("compute.googleapis.com" "container.googleapis.com") | ||
set -e | ||
|
||
# Add an owner to the project | ||
for owner in ${owners[@]}; do | ||
gcloud projects add-iam-policy-binding $project --member group:$owner --role roles/OWNER | ||
readonly PROJECT=${1:?"First argument must be the new boskos project name."} | ||
readonly OWNERS=("[email protected]") | ||
readonly GROUPS=("[email protected]") | ||
readonly SAS=( | ||
"[email protected]" \ | ||
"[email protected]" \ | ||
"[email protected]" \ | ||
"[email protected]") | ||
readonly APIS=( | ||
"compute.googleapis.com" \ | ||
"container.googleapis.com") | ||
|
||
# Add an owner to the PROJECT | ||
for owner in ${OWNERS[@]}; do | ||
gcloud projects add-iam-policy-binding ${PROJECT} --member group:${owner} --role roles/OWNER | ||
done | ||
|
||
# Add all groups as editors | ||
for group in ${groups[@]}; do | ||
gcloud projects add-iam-policy-binding $project --member group:$group --role roles/EDITOR | ||
# Add all GROUPS as editors | ||
for group in ${GROUPS[@]}; do | ||
gcloud projects add-iam-policy-binding ${PROJECT} --member group:${group} --role roles/EDITOR | ||
done | ||
|
||
# Add all service accounts as editors | ||
for sa in ${sas[@]}; do | ||
gcloud projects add-iam-policy-binding $project --member serviceAccount:$sa --role roles/EDITOR | ||
for sa in ${SAS[@]}; do | ||
gcloud projects add-iam-policy-binding ${PROJECT} --member serviceAccount:${sa} --role roles/EDITOR | ||
done | ||
|
||
# Enable apis | ||
for api in ${apis[@]}; do | ||
gcloud services enable $api --project=$1 | ||
# Enable APIS | ||
for api in ${APIS[@]}; do | ||
gcloud services enable ${api} --project=${PROJECT} | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters