-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.cmd
More file actions
28 lines (20 loc) · 991 Bytes
/
setup.cmd
File metadata and controls
28 lines (20 loc) · 991 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@echo off
rem Login to the Google CLoud SDK
call gcloud auth login
rem Read the settings file
for /f "delims== tokens=1,2" %%G in (settings.conf) do set %%G=%%H
rem Set working project
call gcloud config set project %PROJECT_ID%
rem Create the service account
call gcloud iam service-accounts create %SERVICE_ACCOUNT_NAME%
rem Bind the service account to the project
call gcloud projects add-iam-policy-binding %PROJECT_ID% ^
--member "serviceAccount:%SERVICE_ACCOUNT_NAME%@%PROJECT_ID%.iam.gserviceaccount.com" ^
--role "roles/owner"
rem Create a service account JSON file to be used by the client libraries
call gcloud iam service-accounts keys create service-account.json ^
--iam-account %SERVICE_ACCOUNT_NAME%@%PROJECT_ID%.iam.gserviceaccount.com
rem Set the location of the service account to an environment variable
set GOOGLE_APPLICATION_CREDENTIALS=%cd%\service-account.json
rem Create the bucket to store the process
call gsutil mb -p %PROJECT_ID% gs://%BUCKET_NAME%/