-
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.
- update readme with getting started & usage guide - add examples validation on CI
- Loading branch information
Showing
9 changed files
with
238 additions
and
99 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
on: [ push, pull_request ] | ||
name: Test | ||
jobs: | ||
CheckExamples: | ||
strategy: | ||
matrix: | ||
go-version: [ 1.17.x ] | ||
os: [ ubuntu-latest, macos-latest, windows-latest ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build | ||
run: go build | ||
|
||
- name: Check examples | ||
run: ./ci/check_examples.sh |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
echo "Checking examples..." | ||
|
||
for example_directory in examples/*/; do | ||
echo "⌛ Checking $example_directory..." | ||
./goal -c "$example_directory/goal.yaml" | ||
echo "✅ $example_directory ok" | ||
echo | ||
done |
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,32 @@ | ||
# This example combines two `goal` features: | ||
# 1. Environmental executions: `goal run ssh --on dev` | ||
# 2. Built-in `gcloud_project` assertions upon execution | ||
# to prevent accidental runs on wrong environment. | ||
# | ||
# NOTE: list your projects with `gcloud projects list` | ||
# | ||
# Usage: | ||
# goal run ssh --on dev | ||
# goal run ssh --on stage | ||
ssh: | ||
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 |
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# This example combines two `goal` features: | ||
# 1. Environmental executions: `goal run apply --on dev` | ||
# 2. Built-in `kubectl_context` assertions upon execution | ||
# to prevent accidental runs on wrong environment. | ||
# | ||
# NOTE: list your contexts with `kubectl config get-contexts` | ||
# | ||
# Usage: | ||
# goal run pods --on dev | ||
# goal run pods --on stage | ||
# | ||
# goal run apply --on dev | ||
# goal run apply --on stage | ||
|
||
pods: | ||
envs: | ||
dev: | ||
desc: Kubectl get app pods on dev | ||
cmd: kubectl | ||
args: | ||
- get | ||
- pods | ||
- -l | ||
- app=nginx | ||
assert: | ||
- kubectl_context: gke_project_region_dev | ||
stage: | ||
desc: Kubectl get app pods on stage | ||
cmd: kubectl | ||
args: | ||
- get | ||
- pods | ||
- -l | ||
- app=nginx | ||
assert: | ||
- kubectl_context: gke_project_region_stage | ||
|
||
apply: | ||
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 |
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,25 @@ | ||
# This example demonstrates simply local alias management. | ||
# Goals(aliases) defined in this file would be available only in | ||
# project directory. | ||
# | ||
# Usage: | ||
# goal run pods | ||
# | ||
# goal run svc | ||
|
||
pods: | ||
desc: Get nginx pods | ||
cmd: kubectl | ||
args: | ||
- get | ||
- pods | ||
- -l | ||
- app=nginx | ||
svc: | ||
desc: Get nginx svc | ||
cmd: kubectl | ||
args: | ||
- get | ||
- svc | ||
- -l | ||
- app=nginx |
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
Oops, something went wrong.