-
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.
Merge remote-tracking branch 'origin/tc-scripts-1' into main
- Loading branch information
Showing
3 changed files
with
70 additions
and
7 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 |
|---|---|---|
| @@ -1,10 +1,24 @@ | ||
| .PHONY: plan apply destroy | ||
| # | ||
| # | ||
| # I2 Capstone Project | ||
| # Allissa Dillman, Ananya Ravipati, Bala Desinghu, Tony Cricell, John Hicks, Timothy Middelkoop | ||
| # | ||
| .PHONY: init plan apply destroy | ||
|
|
||
| init: | ||
| terraform init | ||
|
|
||
| validate: | ||
| terraform validate | ||
|
|
||
| plan: | ||
| terraform plan -var-file=basic.tfvars -var-file=local.tfvars -out terraform.tfplan | ||
| terraform plan -var-file=basic.tfvars -var-file=local.tfvars -out terraform.tfplan | ||
|
|
||
| apply: | ||
| terraform apply -var-file=basic.tfvars -var-file=local.tfvars -auto-approve | ||
| terraform apply -var-file=basic.tfvars -var-file=local.tfvars -auto-approve | ||
|
|
||
| destroy: | ||
| terraform destroy -var-file=basic.tfvars -var-file=local.tfvars -auto-approve | ||
| terraform destroy -var-file=basic.tfvars -var-file=local.tfvars -auto-approve | ||
|
|
||
| show: | ||
| terraform show |
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 |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #!/bin/sh | ||
| # | ||
| # CLASS-HCP-GCP | ||
| # | ||
| # | ||
| # | ||
|
|
||
| GCLOUDUSER="" | ||
| PROJECT_ID="" | ||
| SAUSER="" | ||
| ZONE="" | ||
| FOLDER_ID="" | ||
|
|
||
| gcloud config set account $GCLOUDUSER | ||
| gcloud projects create $PROJECT_ID --folder=$FOLDER_ID | ||
| sleep 30 | ||
| gcloud config set project $PROJECT_ID | ||
| gcloud services enable compute.googleapis.com iam.googleapis.com kubernetes.googleapis.com file.googleapis.com | ||
| gcloud iam service-accounts create $SAUSER --display-name "Tony Terraform" | ||
| gcloud projects add-iam-policy-binding $PROJECT_ID --member serviceAccount:$SAUSER@$PROJECT_ID.iam.gserviceaccount.com --role='roles/editor' | ||
| gcloud projects add-iam-policy-binding $PROJECT_ID --member serviceAccount:$SAUSER@$PROJECT_ID.iam.gserviceaccount.com --role='roles/iam.securityAdmin' | ||
| gcloud iam service-accounts keys create $SAUSER-credentials.json --iam-account=$SAUSER@$PROJECT_ID.iam.gserviceaccount.com | ||
| echo "$SAUSER-credentials.json" >>.gitignore | ||
| echo "local*" >>.gitignore | ||
| echo " Initialize Terraform" | ||
| make init | ||
| sleep 30 | ||
| echo " Validating Terraform input files " | ||
| make validate | ||
| sleep 30 | ||
| echo " Running Terraform plan" | ||
| make plan | ||
| sleep 30 | ||
| echo " Applying Terraform plan" | ||
| make apply | ||
|
|
||
| # | ||
| # | ||
| # commands to run after the cluster is made. | ||
| # | ||
| # gcloud compute instances list | ||
| # gcloud beta compute ssh --zone "$ZONE" "class-login0" --project "$PROJECT_ID" | ||
| # sinfo | ||
| # srun hostname | ||
| # sinfo | ||
| # make destroy |