-
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.
Signed-off-by: Tamal Saha <[email protected]>
- Loading branch information
Showing
23 changed files
with
296 additions
and
150 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1 @@ | ||
# capi-scripts | ||
|
||
* `make release` | ||
# capi-deployer |
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,19 @@ | ||
FROM alpine AS builder | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/kluster-api/capi-deployer | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
ARG CLUSTERCTL="v1.6.3" | ||
ARG CLUSTERAWSADM_VERSION="v2.4.2" | ||
ARG INFRASTRUCTURE_VERSION="v2.4.2" | ||
ARG CLUSTER_API_VERSION="v1.6.3" | ||
ARG IAM_AUTHENTICATOR_VERSION="0.6.14" | ||
|
||
RUN apk add --update --no-cache bash ca-certificates curl openssl unzip wget | ||
|
||
COPY script.sh . | ||
|
||
RUN chmod +x script.sh | ||
RUN ./script.sh |
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
File renamed without changes.
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,18 @@ | ||
FROM alpine AS builder | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/kluster-api/capi-deployer | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
ARG CLUSTERCTL="v1.6.3" | ||
ARG INFRASTRUCTURE_VERSION="v1.6.0" | ||
ARG CLUSTER_API_VERSION="v1.6.3" | ||
ARG YQ_VERSION="v4.2.0" | ||
|
||
RUN apk add --update --no-cache bash ca-certificates curl openssl unzip wget | ||
|
||
COPY script.sh . | ||
|
||
RUN chmod +x script.sh | ||
RUN ./script.sh |
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,68 @@ | ||
SHELL=/bin/bash -o pipefail | ||
|
||
REGISTRY ?= ghcr.io/appscode | ||
BIN ?= $(notdir $(shell pwd))-deployer | ||
IMAGE := $(REGISTRY)/$(BIN) | ||
TAG ?= $(shell git describe --exact-match --abbrev=0 2>/dev/null || echo "") | ||
|
||
DOCKER_PLATFORMS := linux/amd64 linux/arm64 | ||
PLATFORM ?= linux/$(subst x86_64,amd64,$(subst aarch64,arm64,$(shell uname -m))) | ||
VERSION = $(TAG)_$(subst /,_,$(PLATFORM)) | ||
|
||
container-%: | ||
@$(MAKE) container \ | ||
--no-print-directory \ | ||
PLATFORM=$(subst _,/,$*) | ||
|
||
push-%: | ||
@$(MAKE) push \ | ||
--no-print-directory \ | ||
PLATFORM=$(subst _,/,$*) | ||
|
||
all-container: $(addprefix container-, $(subst /,_,$(DOCKER_PLATFORMS))) | ||
|
||
all-push: $(addprefix push-, $(subst /,_,$(DOCKER_PLATFORMS))) | ||
|
||
.PHONY: container | ||
container: | ||
@echo "container: $(IMAGE):$(VERSION)" | ||
@docker buildx build --platform $(PLATFORM) --load --pull -t $(IMAGE):$(VERSION) -f Dockerfile . | ||
@echo | ||
|
||
push: container | ||
@docker push $(IMAGE):$(VERSION) | ||
@echo "pushed: $(IMAGE):$(VERSION)" | ||
@echo | ||
|
||
.PHONY: docker-manifest | ||
docker-manifest: | ||
docker manifest create -a $(IMAGE):$(TAG) $(foreach PLATFORM,$(DOCKER_PLATFORMS),$(IMAGE):$(TAG)_$(subst /,_,$(PLATFORM))) | ||
docker manifest push $(IMAGE):$(TAG) | ||
|
||
.PHONY: release | ||
release: | ||
@$(MAKE) all-push docker-manifest --no-print-directory | ||
|
||
.PHONY: version | ||
version: | ||
@echo version=$(VERSION) | ||
|
||
.PHONY: fmt | ||
fmt: | ||
@find . -path ./vendor -prune -o -name '*.sh' -exec shfmt -l -w -ci -i 4 {} \; | ||
|
||
.PHONY: verify | ||
verify: fmt | ||
@if !(git diff --exit-code HEAD); then \ | ||
echo "files are out of date, run make fmt"; exit 1; \ | ||
fi | ||
|
||
.PHONY: ci | ||
ci: verify | ||
|
||
# make and load docker image to kind cluster | ||
.PHONY: push-to-kind | ||
push-to-kind: container | ||
@echo "Loading docker image into kind cluster...." | ||
@kind load docker-image $(IMAGE):$(VERSION) | ||
@echo "Image has been pushed successfully into kind cluster." |
File renamed without changes.
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,15 @@ | ||
FROM alpine AS builder | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/kluster-api/capi-deployer | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
ARG CLUSTERCTL="v1.6.3" | ||
|
||
RUN apk add --update --no-cache bash ca-certificates curl openssl unzip wget | ||
|
||
COPY script.sh . | ||
|
||
RUN chmod +x script.sh | ||
RUN ./script.sh |
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,68 @@ | ||
SHELL=/bin/bash -o pipefail | ||
|
||
REGISTRY ?= ghcr.io/appscode | ||
BIN ?= $(notdir $(shell pwd))-deployer | ||
IMAGE := $(REGISTRY)/$(BIN) | ||
TAG ?= $(shell git describe --exact-match --abbrev=0 2>/dev/null || echo "") | ||
|
||
DOCKER_PLATFORMS := linux/amd64 linux/arm64 | ||
PLATFORM ?= linux/$(subst x86_64,amd64,$(subst aarch64,arm64,$(shell uname -m))) | ||
VERSION = $(TAG)_$(subst /,_,$(PLATFORM)) | ||
|
||
container-%: | ||
@$(MAKE) container \ | ||
--no-print-directory \ | ||
PLATFORM=$(subst _,/,$*) | ||
|
||
push-%: | ||
@$(MAKE) push \ | ||
--no-print-directory \ | ||
PLATFORM=$(subst _,/,$*) | ||
|
||
all-container: $(addprefix container-, $(subst /,_,$(DOCKER_PLATFORMS))) | ||
|
||
all-push: $(addprefix push-, $(subst /,_,$(DOCKER_PLATFORMS))) | ||
|
||
.PHONY: container | ||
container: | ||
@echo "container: $(IMAGE):$(VERSION)" | ||
@docker buildx build --platform $(PLATFORM) --load --pull -t $(IMAGE):$(VERSION) -f Dockerfile . | ||
@echo | ||
|
||
push: container | ||
@docker push $(IMAGE):$(VERSION) | ||
@echo "pushed: $(IMAGE):$(VERSION)" | ||
@echo | ||
|
||
.PHONY: docker-manifest | ||
docker-manifest: | ||
docker manifest create -a $(IMAGE):$(TAG) $(foreach PLATFORM,$(DOCKER_PLATFORMS),$(IMAGE):$(TAG)_$(subst /,_,$(PLATFORM))) | ||
docker manifest push $(IMAGE):$(TAG) | ||
|
||
.PHONY: release | ||
release: | ||
@$(MAKE) all-push docker-manifest --no-print-directory | ||
|
||
.PHONY: version | ||
version: | ||
@echo version=$(VERSION) | ||
|
||
.PHONY: fmt | ||
fmt: | ||
@find . -path ./vendor -prune -o -name '*.sh' -exec shfmt -l -w -ci -i 4 {} \; | ||
|
||
.PHONY: verify | ||
verify: fmt | ||
@if !(git diff --exit-code HEAD); then \ | ||
echo "files are out of date, run make fmt"; exit 1; \ | ||
fi | ||
|
||
.PHONY: ci | ||
ci: verify | ||
|
||
# make and load docker image to kind cluster | ||
.PHONY: push-to-kind | ||
push-to-kind: container | ||
@echo "Loading docker image into kind cluster...." | ||
@kind load docker-image $(IMAGE):$(VERSION) | ||
@echo "Image has been pushed successfully into kind cluster." |
File renamed without changes.
Oops, something went wrong.