Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Jul 17, 2024
1 parent 874eb3d commit accd98a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Setup Melange
uses: chainguard-dev/actions/setup-melange@main

- name: Build and push local-artifact-mirror image
run: |
SHA=${{ github.event.pull_request.head.sha }}
Expand All @@ -62,7 +65,6 @@ jobs:
export REGISTRY=docker.io
export USERNAME=${{ secrets.DOCKERHUB_USER }}
export PASSWORD=${{ secrets.DOCKERHUB_PASSWORD }}
sudo apt-get -y install bubblewrap
make build-and-push-local-artifact-mirror-image VERSION="${SHORT_SHA}"
make build-and-push-local-artifact-mirror-image VERSION="${SHORT_SHA}-previous-k0s"
make build-and-push-local-artifact-mirror-image VERSION="${SHORT_SHA}-upgrade"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Setup Melange
uses: chainguard-dev/actions/setup-melange@main

- name: Build and push local-artifact-mirror image
run: |
export SHORT_SHA=dev-${GITHUB_SHA::7}
export LOCAL_ARTIFACT_MIRROR_IMAGE=replicated/embedded-cluster-local-artifact-mirror-staging
export REGISTRY=docker.io
export USERNAME=${{ secrets.DOCKERHUB_USER }}
export PASSWORD=${{ secrets.DOCKERHUB_PASSWORD }}
sudo apt-get -y install bubblewrap
make build-and-push-local-artifact-mirror-image VERSION="${SHORT_SHA}"
make build-and-push-local-artifact-mirror-image VERSION="${SHORT_SHA}-previous-k0s"
make build-and-push-local-artifact-mirror-image VERSION="${SHORT_SHA}-upgrade"
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Setup Melange
uses: chainguard-dev/actions/setup-melange@main

- name: Build and push local-artifact-mirror image (production)
run: |
export REGISTRY=docker.io
export USERNAME=${{ secrets.DOCKERHUB_USER }}
export PASSWORD=${{ secrets.DOCKERHUB_PASSWORD }}
sudo apt-get -y install bubblewrap
make build-and-push-local-artifact-mirror-image VERSION=$TAG_NAME
- name: Build and push local-artifact-mirror image (staging)
Expand All @@ -43,7 +45,6 @@ jobs:
export REGISTRY=docker.io
export USERNAME=${{ secrets.DOCKERHUB_USER }}
export PASSWORD=${{ secrets.DOCKERHUB_PASSWORD }}
sudo apt-get -y install bubblewrap
make build-and-push-local-artifact-mirror-image VERSION=$TAG_NAME
- name: Build linux-amd64
Expand Down
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ KOTS_VERSION = v$(shell echo $(ADMIN_CONSOLE_CHART_VERSION) | sed 's/\([0-9]\+\.
KOTS_BINARY_URL_OVERRIDE =
LOCAL_ARTIFACT_MIRROR_IMAGE ?= replicated/embedded-cluster-local-artifact-mirror
LOCAL_ARTIFACT_MIRROR_IMAGE_VERSION ?= $(subst +,-,$(VERSION))
LOCAL_ARTIFACT_MIRROR_IMAGE_LOCATION = proxy.replicated.com/anonymous/${LOCAL_ARTIFACT_MIRROR_IMAGE}:${LOCAL_ARTIFACT_MIRROR_IMAGE_VERSION}
LOCAL_ARTIFACT_MIRROR_IMAGE_LOCATION = proxy.replicated.com/anonymous/$(LOCAL_ARTIFACT_MIRROR_IMAGE):$(LOCAL_ARTIFACT_MIRROR_IMAGE_VERSION)
LD_FLAGS = -X github.com/replicatedhq/embedded-cluster/pkg/defaults.K0sVersion=$(K0S_VERSION) \
-X github.com/replicatedhq/embedded-cluster/pkg/defaults.Version=$(VERSION) \
-X github.com/replicatedhq/embedded-cluster/pkg/defaults.TroubleshootVersion=$(TROUBLESHOOT_VERSION) \
Expand All @@ -54,6 +54,8 @@ LD_FLAGS = -X github.com/replicatedhq/embedded-cluster/pkg/defaults.K0sVersion=$
-X github.com/replicatedhq/embedded-cluster/pkg/addons/velero.VeleroTag=$(VELERO_IMAGE_VERSION) \
-X github.com/replicatedhq/embedded-cluster/pkg/addons/velero.AwsPluginTag=$(VELERO_AWS_PLUGIN_IMAGE_VERSION)

export PATH := $(shell pwd)/bin:$(PATH)

.DEFAULT_GOAL := default
default: embedded-cluster-linux-amd64

Expand Down Expand Up @@ -204,8 +206,8 @@ APKO_CMD = docker run -v "${PWD}":/work -w /work -v "${PWD}"/build/.docker:/root
MELANGE_CMD = docker run --privileged --rm -v "${PWD}":/work -w /work -v "$(shell go env GOMODCACHE)":${MELANGE_CACHE_DIR} cgr.dev/chainguard/melange
else
MELANGE_CACHE_DIR = $(shell go env GOMODCACHE)
APKO_CMD = $(shell pwd)/bin/apko
MELANGE_CMD = $(shell pwd)/bin/melange
APKO_CMD = apko
MELANGE_CMD = melange
endif

.PHONY: apko-build
Expand Down Expand Up @@ -271,17 +273,21 @@ else
GOBIN=$(shell go env GOBIN)
endif

.PHONY: bin/apko
bin/apko:
ifneq ($(CHAINGUARD_TOOLS_USE_DOCKER),"1")
mkdir -p bin
command -v apko &> /dev/null || \
go install chainguard.dev/apko@latest && \
test -s $(GOBIN)/apko && \
ln -sf $(GOBIN)/apko bin/apko
endif

.PHONY: bin/melange
bin/melange:
ifneq ($(CHAINGUARD_TOOLS_USE_DOCKER),"1")
mkdir -p bin
command -v melange &> /dev/null || \
go install chainguard.dev/melange@latest && \
test -s $(GOBIN)/melange && \
ln -sf $(GOBIN)/melange bin/melange
Expand Down

0 comments on commit accd98a

Please sign in to comment.