Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a prepare-release target… #4

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: task-git
version: 0.0.1
version: 0.1.0
description: |
This Task represents Git and is able to initialize and clone a remote
repository on the informed Workspace. It's likely to become the first `step`
on a Pipeline.
type: application
type: application
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# 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)
CHART_VERSION ?= $(shell awk '/^version:/ { print $$2 }' Chart.yaml)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch! Thank you 🙏

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😛 I spend a few mintues figuring out why it would create task-git- as a folder 😛


# release directory where the Tekton resources are rendered into.
RELEASE_DIR ?= /tmp/$(CHART_NAME)-$(CHART_VERSION)

# bats entry point and default flags
BATS_CORE = ./test/.bats/bats-core/bin/bats
Expand Down Expand Up @@ -30,6 +33,18 @@ helm-template:
install:
$(call render-template) |kubectl $(ARGS) apply -f -

# pepare a release
prepare-release:
mkdir -p $(RELEASE_DIR)/task/$(CHART_NAME) || true
helm template $(ARGS) . > $(RELEASE_DIR)/task/$(CHART_NAME)/$(CHART_NAME).yaml
cp README.md $(RELEASE_DIR)/task/$(CHART_NAME)/
go run github.com/openshift-pipelines/tektoncd-catalog/cmd/catalog-cd@main release --output release --version $(CHART_VERSION) $(RELEASE_DIR)/task/$(CHART_NAME)
@echo "Now you can release:"
@echo " git tag v$(CHART_VERSION) && git push v$(CHART_VERSION)"
@echo " gh release create v$(CHART_VERSION) --generate-notes"
@echo " gh release upload v$(CHART_VERSION) release/catalog.yaml"
@echo " gh release upload v$(CHART_VERSION) release/resources.tar.gz"

# packages the helm-chart as a single tarball, using it's name and version to compose the file
helm-package: clean
helm package $(ARGS) .
Expand All @@ -53,4 +68,4 @@ test-e2e: install
# and end-to-end) to avoid running the release workflow accidently
act: ARGS = --workflows=./.github/workflows/test.yaml
act:
act $(ARGS)
act $(ARGS)
Loading