-
Notifications
You must be signed in to change notification settings - Fork 5
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
1 parent
02a5e22
commit 87c1a15
Showing
7 changed files
with
139 additions
and
0 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,3 @@ | ||
/.env | ||
/.vscode/ | ||
/*.tgz |
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,12 @@ | ||
/.DS_Store | ||
/.git/ | ||
/.github/ | ||
/.gitignore | ||
/.gitmodules | ||
/.helmignore | ||
/.vscode/ | ||
/*.md | ||
/LICENSE | ||
/Makefile | ||
/OWNERS | ||
/test/ |
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,5 @@ | ||
apiVersion: v2 | ||
name: task-oc | ||
version: 0.0.1 | ||
description: TODO... | ||
type: application |
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,48 @@ | ||
# using the chart name and version from chart's metadata | ||
CHART_NAME ?= $(shell awk '/^name:/ { print $$2 }' Chart.yaml) | ||
CHART_VESION ?= $(shell awk '/^version:/ { print $$2 }' Chart.yaml) | ||
|
||
# bats entry point and default flags | ||
BATS_CORE = ./test/.bats/bats-core/bin/bats | ||
BATS_FLAGS ?= --print-output-on-failure --show-output-of-passing-tests --verbose-run | ||
|
||
# path to the bats test files, overwite the variables below to tweak the test scope | ||
E2E_TESTS ?= ./test/e2e/*.bats | ||
|
||
# generic arguments employed on most of the targets | ||
ARGS ?= | ||
|
||
# making sure the variables declared in the Makefile are exported to the excutables/scripts invoked | ||
# on all targets | ||
.EXPORT_ALL_VARIABLES: | ||
|
||
# renders the task resource file printing it out on the standard output, you can redirect the output | ||
# of this target to a `kubectl apply -f -`, for istance | ||
helm-template: | ||
helm template $(ARGS) $(CHART_NAME) . | ||
|
||
# renders and installs the task in the current namespace | ||
install: | ||
helm template $(CHART_NAME) . |kubectl $(ARGS) apply -f - | ||
|
||
# packages the helm-chart as a single tarball, using it's name and version to compose the file | ||
helm-package: | ||
rm -f $(CHART_NAME)-*.tgz || true | ||
helm package $(ARGS) . | ||
tar -ztvpf $(CHART_NAME)-$(CHART_VESION).tgz | ||
|
||
# removes the package helm chart, and also the chart-releaser temporary directories | ||
clean: | ||
rm -rf $(CHART_NAME)-*.tgz > /dev/null 2>&1 || true | ||
|
||
# run end-to-end tests against the current kuberentes context, it will required a cluster with tekton | ||
# pipelines and other requirements installed, before start testing the target invokes the | ||
# installation of the current project's task (using helm). | ||
test-e2e: install | ||
$(BATS_CORE) $(BATS_FLAGS) $(ARGS) $(E2E_TESTS) | ||
|
||
# act runs the github actions workflows, so by default only running the test workflow (integration | ||
# and end-to-end) to avoid running the release workflow accidently | ||
act: ARGS = --workflows=./.github/workflows/test.yaml | ||
act: | ||
act $(ARGS) |
Empty file.
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,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "..name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "..fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "..chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "..labels" -}} | ||
helm.sh/chart: {{ include "..chart" . }} | ||
{{ include "..selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "..selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "..name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "..serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "..fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
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,9 @@ | ||
--- | ||
images: | ||
bash: registry.access.redhat.com/ubi8-minimal:latest | ||
openshift-cli: registry.redhat.io/openshift-pipelines/pipelines-cli-tkn-rhel8 | ||
|
||
annotations: | ||
tekton.dev/pipelines.minVersion: "0.17.0" | ||
tekton.dev/tags: cli | ||
tekton.dev/displayName: "openshift client" |