Skip to content

Commit

Permalink
build: usea a commit based scheme for podman build
Browse files Browse the repository at this point in the history
  • Loading branch information
faiq committed Oct 16, 2023
1 parent ec7bf9a commit ae9d668
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/podman-aws-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Build snapshot
run: |-
make build-for-podman
goreleaser build --id konvoy-image-wrapper-for-podman --snapshot --clean
goreleaser build --id konvoy-image-wrapper-for-podman --clean --skip-validate
- name: Run E2E test for AWS centos 7.9 using podman
run: |-
Expand Down
8 changes: 1 addition & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,7 @@ builds:
- EMBED_DOCKER_IMAGE
ldflags:
- -s -w
- -X {{ .ModulePath }}/pkg/version.version=v{{trimprefix .Version "v"}}
- -X {{ .ModulePath }}/pkg/version.major={{ .Major }}
- -X {{ .ModulePath }}/pkg/version.minor={{ .Minor }}
- -X {{ .ModulePath }}/pkg/version.patch={{ .Patch }}
- -X {{ .ModulePath }}/pkg/version.revision={{ .FullCommit }}
- -X {{ .ModulePath }}/pkg/version.commitDate={{ .CommitDate }}
- -X {{ .ModulePath }}/pkg/version.branch={{ .Branch }}
- -X {{ .ModulePath }}/pkg/version.version={{ .FullCommit }}
- -X {{ .ModulePath }}/pkg/version.builtBy=goreleaser
goos:
- linux
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ INTERACTIVE := $(shell [ -t 0 ] && echo 1)
root_mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
export REPO_ROOT_DIR := $(patsubst %/,%,$(dir $(root_mkfile_path)))
export REPO_REV ?= $(shell cd $(REPO_ROOT_DIR) && git describe --abbrev=12 --tags --match='v*' HEAD)
export COMMIT := $(shell git log -n1 | grep commit | cut -d' ' -f2)

UID ?= $(shell id -u)
GID ?= $(shell id -g)
Expand Down Expand Up @@ -507,5 +508,5 @@ cmd/konvoy-image-wrapper/image/konvoy-image-builder.tar.gz: kib-image-push-manif
docker save $(DOCKER_REPOSITORY):$(REPO_REV) | gzip -c - > "$(REPO_ROOT_DIR)/cmd/konvoy-image-wrapper/image/konvoy-image-builder.tar.gz"

build-for-podman: kib-image-build-amd64
docker tag $(DOCKER_REPOSITORY):$(REPO_REV)-$(BUILDARCH) $(DOCKER_REPOSITORY):$(REPO_REV)
docker save $(DOCKER_REPOSITORY):$(REPO_REV) | gzip -c - > "$(REPO_ROOT_DIR)/cmd/konvoy-image-wrapper/image/konvoy-image-builder.tar.gz"
docker tag $(DOCKER_REPOSITORY):$(REPO_REV)-$(BUILDARCH) $(DOCKER_REPOSITORY):$(COMMIT)
docker save $(DOCKER_REPOSITORY):$(COMMIT) | gzip -c - > "$(REPO_ROOT_DIR)/cmd/konvoy-image-wrapper/image/konvoy-image-builder.tar.gz"

0 comments on commit ae9d668

Please sign in to comment.