-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The CI builds and pushes Linux amd64 images to quay.io tagged using the full commit revision. Signed-off-by: Chris Doherty <[email protected]>
- Loading branch information
1 parent
ac59c9a
commit d6bdc81
Showing
5 changed files
with
84 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Actions | ||
on: | ||
push: | ||
branches: | ||
- "*" | ||
tags-ignore: | ||
- "v*" | ||
pull_request: {} | ||
workflow_dispatch: {} | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
platform: [amd64] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build linux/${{ matrix.platform }} | ||
run: make images -j$(nproc) GOOS=linux GOARCH=${{ matrix.platform }} |
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,21 @@ | ||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
workflow_dispatch: {} | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
platform: [amd64] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build linux/${{ matrix.platform }} | ||
run: make images -j $(nproc) GOOS=linux GOARCH=${{ matrix.platform }} | ||
|
||
- name: Push linux/${{ matrix.platform }} | ||
run: make push -j $(nprox) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,52 @@ | ||
BINS = archive2disk cexec grub2disk kexec oci2disk qemuimg2disk rootio slurp syslinux writefile | ||
# Use bash | ||
SHELL := bash | ||
.SHELLFLAGS := -o pipefail -euc | ||
.ONESHELL: | ||
|
||
include rules.mk | ||
# Second expansion is used by the image targets to depend on their respective binaries. It is | ||
# necessary because automatic variables are not set on first expansion. | ||
# See https://www.gnu.org/software/make/manual/html_node/Secondary-Expansion.html. | ||
.SECONDEXPANSION: | ||
|
||
all: $(BINS) | ||
# Define the list of actions that can be built. | ||
ACTIONS := archive2disk cexec grub2disk kexec oci2disk qemuimg2disk rootio slurp syslinux writefile | ||
|
||
.PHONY: $(BINS) | ||
$(BINS): | ||
# Define the commit for tagging images. | ||
GIT_COMMIT := $(shell git rev-parse HEAD) | ||
|
||
# Define Docker registry details. | ||
DOCKER_REPOSITORY := quay.io/tinkerbell/actions | ||
|
||
include Rules.mk | ||
|
||
.PHONY: help | ||
help: ## Print this help | ||
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[%\/0-9A-Za-z_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
@echo | ||
@echo Individual actions can be built with their name. For example, \`make archive2disk\`. | ||
|
||
|
||
.PHONY: $(ACTIONS) | ||
$(ACTIONS): ## Build a specific action image. | ||
docker buildx build --platform linux/amd64 --load -t $@:latest -f ./$@/Dockerfile . | ||
|
||
.PHONY: images | ||
images: ## Build all action images. | ||
images: $(ACTIONS) | ||
|
||
.PHONY: push | ||
push: ## Push all action images. | ||
push: $(addprefix push-,$(ACTIONS)) | ||
|
||
.PHONY: push-% | ||
push-%: ## Push a specific action image to the registry. This recipe assumes you are already authenticated with the registry. | ||
IMAGE_NAME=$(DOCKER_REPOSITORY)/$*:$(GIT_COMMIT) | ||
docker tag $*:latest $$IMAGE_NAME | ||
docker push $$IMAGE_NAME | ||
|
||
formatters: ## Run all formatters. | ||
formatters: $(toolBins) | ||
git ls-files '*.go' | xargs -I% sh -c 'sed -i "/^import (/,/^)/ { /^\s*$$/ d }" % && bin/gofumpt -w %' | ||
git ls-files '*.go' | xargs -I% bin/goimports -w % | ||
|
||
tidy-all: | ||
for d in $(BINS); do (cd $$d; go mod tidy); done | ||
|
||
include lint.mk | ||
include Lint.mk |
File renamed without changes.