-
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.
- add
kubectl_context
& gcloud_project
built-in assertions
- update all examples - clean up code a bit
- Loading branch information
Showing
7 changed files
with
241 additions
and
161 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 was deleted.
Oops, something went wrong.
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,39 +1,66 @@ | ||
current-context: | ||
desc: Current kubectl context | ||
cmd: kubectl | ||
args: | ||
- config | ||
- current-context | ||
# This example combines two `goal` features: | ||
# 1. Environmental executions: `goal run helm-upgrade --on dev` | ||
# 2. Built-in `kubectl_context` assertions upon execution | ||
# to prevent accidental runs on wrong environment. | ||
# | ||
# NOTE: Your can list available `kubectl` contexts with `kubectl config get-contexts` | ||
|
||
helm-upgrade-dev-dry-run: | ||
desc: Dry run upgrade on dev | ||
assert: | ||
desc: Check if on dev cluster | ||
ref: current-context | ||
expect: dev-cluster | ||
cmd: helm | ||
args: | ||
- upgrade | ||
- release-name | ||
- -f | ||
- values.yaml | ||
- -f | ||
- values/dev.yaml | ||
- . | ||
- --dry-run | ||
helm-dry-run: | ||
envs: | ||
dev: | ||
desc: Dry run upgrade on dev | ||
assert: | ||
- kubectl_context: dev-cluster | ||
cmd: helm | ||
args: | ||
- upgrade | ||
- release-name | ||
- -f | ||
- values.yaml | ||
- -f | ||
- values/dev.yaml | ||
- . | ||
- --dry-run | ||
stage: | ||
desc: Dry run upgrade on stage | ||
assert: | ||
- kubectl_context: stage-cluster | ||
cmd: helm | ||
args: | ||
- upgrade | ||
- release-name | ||
- -f | ||
- values.yaml | ||
- -f | ||
- values/stage.yaml | ||
- . | ||
- --dry-run | ||
|
||
helm-upgrade-dev: | ||
desc: Upgrade on dev | ||
assert: | ||
desc: Check if on dev cluster | ||
ref: current-context | ||
expect: dev-cluster | ||
cmd: helm | ||
args: | ||
- upgrade | ||
- release-name | ||
- -f | ||
- values.yaml | ||
- -f | ||
- values/dev.yaml | ||
- . | ||
helm-upgrade: | ||
envs: | ||
dev: | ||
desc: Run upgrade on dev | ||
assert: | ||
- kubectl_context: dev-cluster | ||
cmd: helm | ||
args: | ||
- upgrade | ||
- release-name | ||
- -f | ||
- values.yaml | ||
- -f | ||
- values/dev.yaml | ||
- . | ||
stage: | ||
desc: Run upgrade on stage | ||
assert: | ||
- kubectl_context: stage-cluster | ||
cmd: helm | ||
args: | ||
- upgrade | ||
- release-name | ||
- -f | ||
- values.yaml | ||
- -f | ||
- values/stage.yaml | ||
- . |
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,32 +1,77 @@ | ||
tf-apply: | ||
# simple alias: `goal run pods` | ||
pods: | ||
desc: Get nginx pods | ||
cmd: kubectl | ||
args: | ||
- get | ||
- pods | ||
- -l | ||
- app=nginx | ||
|
||
# list your workspaces with `terraform workspace list` | ||
terraform: | ||
envs: | ||
dev: | ||
desc: Terraform apply on dev | ||
cmd: terraform | ||
args: | ||
- apply | ||
- -var-file | ||
- vars/dev.tfvars | ||
assert: | ||
- desc: Check if on dev workspace | ||
ref: workspace | ||
expect: dev | ||
fix: terraform workspace select dev | ||
desc: Terraform apply on dev | ||
- terraform_workspace: dev | ||
stage: | ||
desc: Terraform apply on stage | ||
cmd: terraform | ||
args: | ||
- apply | ||
- -var-file | ||
- vars/stage.tfvars | ||
assert: | ||
- desc: Check if on stage workspace | ||
ref: workspace | ||
expect: stage | ||
fix: terraform workspace select stage | ||
desc: Terraform apply on stage | ||
workspace: | ||
cmd: terraform | ||
args: | ||
- apply | ||
- -var-file | ||
- vars/dev.tfvars | ||
- terraform_workspace: stage | ||
|
||
# list your contexts with `kubectl config get-contexts` | ||
k8s: | ||
envs: | ||
dev: | ||
desc: Kubectl apply on dev | ||
cmd: kubectl | ||
args: | ||
- apply | ||
- -f | ||
- deployment.yaml | ||
assert: | ||
- kubectl_context: gke_project_region_dev | ||
stage: | ||
desc: Kubectl apply on stage | ||
cmd: kubectl | ||
args: | ||
- apply | ||
- -f | ||
- deployment.yaml | ||
assert: | ||
- kubectl_context: gke_project_region_stage | ||
|
||
# list your projects with `gcloud projects list` | ||
gcloud: | ||
envs: | ||
dev: | ||
desc: SSH to dev | ||
cmd: gcloud | ||
args: | ||
- compute | ||
- ssh | ||
- dev-vm | ||
- --zone=us-central1-c | ||
assert: | ||
- gcloud_project: dev-project | ||
stage: | ||
desc: SSH to stage | ||
cmd: gcloud | ||
args: | ||
- compute | ||
- ssh | ||
- stage-vm | ||
- --zone=us-central1-c | ||
assert: | ||
- gcloud_project: stage-project |
Oops, something went wrong.