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

feat: publish release manifests as github release asset #33

Merged
merged 7 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
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
27 changes: 10 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ 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.
Expand All @@ -117,9 +117,9 @@ run-backend: fmt vet ## Run the api backend server
docker-build: ## Build docker image with the manager.
$(CONTAINER_TOOL) build -t ${IMG} .

.PHONY: docker-push
docker-push: ## Push docker image with the manager.
$(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:
Expand All @@ -144,6 +144,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 @@ -165,14 +170,6 @@ deploy-local: manifests kustomize ## Deploy controller to the K8s cluster specif
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.
$(KUBECTL) apply -f dist/install.yaml

.PHONY: undeploy
undeploy: kustomize ## Undeploy controller 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/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -

##@ Dependencies

## Location to install dependencies to
Expand Down Expand Up @@ -228,10 +225,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
Loading