Skip to content

Commit

Permalink
feat: publish release manifests as github release asset (#33)
Browse files Browse the repository at this point in the history
* feat: publish release manifests as github release asset

Signed-off-by: Leonardo Luz Almeida <[email protected]>

* remove the dist folder

Signed-off-by: Leonardo Luz Almeida <[email protected]>

* cleanup

Signed-off-by: Leonardo Luz Almeida <[email protected]>

* publish asset from goreleaser

Signed-off-by: Leonardo Luz Almeida <[email protected]>

* cleanup

Signed-off-by: Leonardo Luz Almeida <[email protected]>

* address review

Signed-off-by: Leonardo Luz Almeida <[email protected]>

* cleanup

Signed-off-by: Leonardo Luz Almeida <[email protected]>

---------

Signed-off-by: Leonardo Luz Almeida <[email protected]>
  • Loading branch information
leoluz authored Oct 10, 2024
1 parent c17f311 commit 0397f99
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 857 deletions.
8 changes: 8 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ before:
- go mod tidy
- go mod download
- make build-ui
- make manifests-release IMAGE_TAG={{ .Tag }}

builds:
- id: ephemeral-access
Expand Down Expand Up @@ -61,6 +62,13 @@ archives:
format_overrides:
- goos: windows
format: zip
- id: manifests
format: binary # necessary to publish the yaml as is
name_template: install.yaml
meta: true
files:
- src: dist/install.yaml
strip_parent: true
- id: ui-extension
format: gz
name_template: extension.tar
Expand Down
30 changes: 14 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,27 @@ build: manifests generate fmt vet ## Build manager binary.

.PHONY: run-controller
run-controller: manifests generate fmt vet ## Run a controller from your host.
go run ./cmd/main.go controller $(ARGS)
go run ./cmd/main.go controller

.PHONY: run-backend
run-backend: fmt vet ## Run the api backend server
go run ./cmd/main.go backend $(ARGS)
go run ./cmd/main.go backend

# If you wish to build the manager image targeting other platforms you can use the --platform flag.
# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: ## Build docker image with the manager.
docker-build: ## Build docker image.
$(CONTAINER_TOOL) build -t ${IMG} .

.PHONY: docker-push
docker-push: ## Push docker image with the manager.
docker-push: ## Push docker image.
$(CONTAINER_TOOL) push ${IMG}

.PHONY: goreleaser-build-local
goreleaser-build-local: goreleaser ## Run goreleaser build locally. Use to validate the goreleaser configuration.
$(GORELEASER) build --snapshot --clean --single-target --verbose

# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
Expand All @@ -144,6 +148,11 @@ build-installer: manifests generate kustomize ## Generate a consolidated YAML wi
cd config/default && $(KUSTOMIZE) edit set image argoproj-labs/argocd-ephemeral-access=${IMG}
$(KUSTOMIZE) build config/default > dist/install.yaml

.PHONY: manifests-release
manifests-release: generate manifests kustomize ## Generate the consolidated install.yaml with the release tag.
mkdir -p dist
./scripts/manifests-release.sh $(KUSTOMIZE) $(IMAGE_TAG)

##@ Deployment

ifndef ignore-not-found
Expand All @@ -158,15 +167,8 @@ install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -

.PHONY: deploy-local
deploy-local: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
rm -rf config/local
cp -R config/default config/local/
cd config/local && $(KUSTOMIZE) edit set image argoproj-labs/argocd-ephemeral-access=${IMG}
$(KUSTOMIZE) build config/local | $(KUBECTL) apply -f -

.PHONY: deploy
deploy: build-installer ## Deploy distribution to the K8s cluster specified in ~/.kube/config.
deploy: manifests-release ## Deploy distribution to the K8s cluster specified in ~/.kube/config.
$(KUBECTL) apply -f dist/install.yaml

.PHONY: undeploy
Expand Down Expand Up @@ -228,10 +230,6 @@ goreleaser: $(GORELEASER) ## Download goreleaser locally if necessary.
$(GORELEASER): $(LOCALBIN)
$(call go-install-tool,$(GORELEASER),github.com/goreleaser/goreleaser/v2,$(GORELEASER_VERSION))

.PHONY: goreleaser-build-local
goreleaser-build-local: goreleaser ## Run goreleaser build locally. Use to validate the goreleaser configuration.
$(GORELEASER) build --snapshot --clean --single-target

.PHONY: generate-mocks
generate-mocks: mockery ## Generate the mocks for the project as configured in .mockery.yaml
$(MOCKERY)
Expand Down
4 changes: 0 additions & 4 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,3 @@ resources:
- ../rbac
- ../controller
- ../backend
images:
- name: argoproj-labs/argocd-ephemeral-access
newName: argoproj-labs/argocd-ephemeral-access
newTag: latest
Loading

0 comments on commit 0397f99

Please sign in to comment.