Table of contents generated with markdown-toc
export MY_VARIABLE=<your_VARIABLE>echo $MY_VARIABLEgcloud config set compute/zone $ZONEgcloud config set compute/region $REGIONgcloud compute instances create $INSTANCE_NAME --machine-type $MACHINE_TYPE --image-family $IMAGEIf you would like to run a set of commands to say install something as soon as the instance is running you can add a startup script:
gcloud compute instances create $INSTANCE_NAME --machine-type $MACHINE_TYPE --image-family $IMAGE --metadata-from-file startup-script=startup.shA bucket must have a globally unique name. A simple way is to define the bucket name is basing it off your Project ID which must also be globally unqiue:
export BUCKET=<project_id-bucket_name>
gsutil mb -p $PROJECT gs://$BUCKETFrom the cloud shell:
gsutil cp $FILENAME gs://$BUCKETFrom the cloud shell:
gsutil rm gs://$BUCKET/$FILENAMEFrom the cloud shell:
gsutil cp gs://$BUCKET/$FILENAME gs://$BUCKET/$FOLDER_NAME/From the cloud shell:
gsutil ls gs://$BUCKETFrom the cloud shell:
gsutil acl ch -u AllUsers:R gs://$BUCKET/$FILENAMEFrom the cloud shell:
gsutil acl ch -d AllUsers gs://$BUCKET/$FILENAME