-
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.
- Loading branch information
Showing
69 changed files
with
13,032 additions
and
42 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,28 @@ | ||
name: E2e Deploy Module | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
e2e: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Homebrew | ||
uses: Homebrew/actions/setup-homebrew@master | ||
- name: Install cli tools | ||
run: make tools | ||
- name: Run CUE test | ||
run: make test | ||
- name: Create cluster with kind | ||
run: make kind | ||
- name: Deploy deployment | ||
run: make e2e |
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,36 @@ | ||
name: Release Deploy module | ||
on: | ||
push: | ||
tags: ['*'] | ||
|
||
permissions: | ||
contents: read # needed for checkout | ||
packages: write # needed for GHCR access | ||
|
||
jobs: | ||
push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup CUE | ||
uses: cue-lang/[email protected] | ||
with: | ||
version: v0.5.0 | ||
- name: Setup Timoni | ||
uses: stefanprodan/timoni/actions/setup@main | ||
with: | ||
version: 0.11.1 | ||
- name: Test instance build | ||
id: test | ||
run: make test | ||
- name: Push | ||
id: push | ||
env: | ||
USER: ${{ github.actor }} | ||
PASS: ${{ secrets.GITHUB_TOKEN }} | ||
OWNER: ${{ github.repository_owner }} | ||
TAG: ${{ github.ref_name }} | ||
run: make push |
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,59 @@ | ||
# Setting SHELL to bash allows bash commands to be executed by recipes. | ||
# Options are set to exit when a recipe line exits non-zero or a piped command fails. | ||
SHELL = /usr/bin/env bash -o pipefail | ||
.SHELLFLAGS = -ec | ||
DEFAULT=help | ||
|
||
MODULE=deploy | ||
|
||
.PHONY: help test build push tools | ||
|
||
help: ## Display this help | ||
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
|
||
tools: ## Install cue, kind, Timoni | ||
brew bundle | ||
|
||
get: ## Update Kubernetes API CUE definitions | ||
@go mod init | ||
@go get -u k8s.io/api/... | ||
@go get -u k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 | ||
@cue get go k8s.io/api/core/v1 | ||
@cue get go k8s.io/api/apps/v1 | ||
@cue get go k8s.io/api/rbac/v1 | ||
@cue get go k8s.io/apimachinery/pkg/apis/meta/v1 | ||
@cue get go k8s.io/apimachinery/pkg/runtime | ||
@cue get go k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 | ||
@rm go.mod go.sum | ||
|
||
test: ## Build with test_tool.cue + test_values.cue | ||
@cue cmd -t name=test -t namespace=test -t mv=0.0.1 -t kv=1.28.0 build . | ||
|
||
gen: vet ## Print the CUE generated objects | ||
@cue gen | ||
|
||
kind: ## Create kind cluster | ||
@kind create cluster --config ./test/kind.yaml | ||
|
||
build: ## Build with timoni with ns+name provided as arg/flag | ||
@timoni build -n testing test . | ||
|
||
|
||
e2e: ## Run full flow + ep validate | ||
@$(MAKE) apply | ||
@tests/validate.sh | ||
@$(MAKE) delete | ||
|
||
apply: ## Apply the module with default values | ||
@kubectl create ns test | ||
@timoni apply -n test test-deploy ./ --timeout=1m | ||
|
||
delete: ## Delete the module with default values | ||
@timoni delete -n test test-deploy ./ --timeout=1m | ||
@kubectl delete ns test | ||
|
||
push: ## Push the module with timoni | ||
@timoni mod push . \ | ||
oci://ghcr.io/${OWNER}/cue-modules/$(MODULE) \ | ||
--version ${TAG} \ | ||
--creds ${USER}:${PASS} |
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,7 @@ | ||
// Code generated by cue get go. DO NOT EDIT. | ||
|
||
//cue:generate cue get go k8s.io/api/apps/v1 | ||
|
||
package v1 | ||
|
||
#GroupName: "apps" |
Oops, something went wrong.