Files
gitlab-gcp-deployment/3-create-virtual-machine.sh
Daljit Singh a5189e154b Aligned all section and script names.
Co-authored-by: jmhbnz <mail@jamesblair.net>
2021-01-27 17:17:41 +13:00

17 lines
591 B
Bash
Executable File

#!/bin/bash
# Step 3 - Create vertual 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:
# Ensure compute engine apis are enabled in the project
gcloud services enable compute.googleapis.com
# Create name for virtual machine based on date
export gcp_machine_name="gitlab-gcp-"$(date +"%s")
# Create the new machine
gcloud compute instances create $gcp_machine_name --zone australia-southeast1-a