Changed to seconds for project and vm name.
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Once we have a project we can create a new virtual machine.
|
# Once we have a project we can create a new virtual machine. To create a virtual machine we need to ensure compute engine apis are enabled.
|
||||||
|
|
||||||
# Tangle the shell block below to a shell script by pressing *, b t* in emacs command mode:
|
# Tangle the shell block below to a shell script by pressing *, b t* in emacs command mode:
|
||||||
|
|
||||||
|
|||||||
@ -57,7 +57,7 @@ Tangle the shell block below to a shell script by pressing *, b t* in emacs comm
|
|||||||
#+NAME: Create a new google cloud project
|
#+NAME: Create a new google cloud project
|
||||||
#+begin_src bash :shebang #!/bin/bash :tangle 2-configure-gcp-project.sh
|
#+begin_src bash :shebang #!/bin/bash :tangle 2-configure-gcp-project.sh
|
||||||
# Create a project id based on date
|
# Create a project id based on date
|
||||||
export gcp_project_id="gitlab-gcp-"$(date +"%Y-%m-%d")
|
export gcp_project_id="gitlab-gcp-"$(date +"%s")
|
||||||
|
|
||||||
# Create new project using a random project id
|
# Create new project using a random project id
|
||||||
gcloud projects create $gcp_project_id
|
gcloud projects create $gcp_project_id
|
||||||
@ -80,7 +80,7 @@ Tangle the shell block below to a shell script by pressing *, b t* in emacs comm
|
|||||||
gcloud services enable compute.googleapis.com
|
gcloud services enable compute.googleapis.com
|
||||||
|
|
||||||
# Create name for virtual machine based on date
|
# Create name for virtual machine based on date
|
||||||
export gcp_machine_name="gitlab-gcp-"$(date +"%Y-%m-%d")
|
export gcp_machine_name="gitlab-gcp-"$(date +"%s")
|
||||||
|
|
||||||
# Create the new machine
|
# Create the new machine
|
||||||
gcloud compute instances create $gcp_machine_name --zone australia-southeast1-a
|
gcloud compute instances create $gcp_machine_name --zone australia-southeast1-a
|
||||||
|
|||||||
Reference in New Issue
Block a user