Skip to content

Commit

Permalink
Add make targets to build devel image of syncer
Browse files Browse the repository at this point in the history
This image can be used with the metal-toolbox/sandbox
  • Loading branch information
diogomatsubara committed Nov 9, 2023
1 parent 85e3f84 commit 5c55a14
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
export DOCKER_BUILDKIT=1
GIT_COMMIT := $(shell git rev-parse --short HEAD)
GIT_BRANCH := $(shell git symbolic-ref -q --short HEAD)
GIT_SUMMARY := $(shell git describe --tags --dirty --always)
VERSION := $(shell git describe --tags 2> /dev/null)
BUILD_DATE := $(shell date +%s)
GIT_COMMIT_FULL := $(shell git rev-parse HEAD)
DOCKER_IMAGE := "ghcr.io/metal-toolbox/firmware-syncer"
REPO := "https://github.com/metal-toolbox/firmware-syncer.git"

.DEFAULT_GOAL := help


## Go test
test:
CGO_ENABLED=0 go test -covermode=atomic ./...
Expand All @@ -22,6 +33,17 @@ build-linux: go-mod
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o firmware-syncer -mod vendor
sha256sum firmware-syncer > firmware-syncer_checksum.txt

build-image: build-linux
docker build --rm=true -f Dockerfile -t ${DOCKER_IMAGE}:latest . \
--label org.label-schema.schema-version=1.0 \
--label org.label-schema.vcs-ref=$(GIT_COMMIT_FULL) \
--label org.label-schema.vcs-url=$(REPO)

## Build devel docker image
build-image-devel: build-image
docker tag ${DOCKER_IMAGE}:latest localhost:5001/firmware-syncer:latest
docker push localhost:5001/firmware-syncer:latest
kind load docker-image localhost:5001/firmware-syncer:latest

# https://gist.github.com/prwhite/8168133
# COLORS
Expand Down

0 comments on commit 5c55a14

Please sign in to comment.