Skip to content

Commit 5783cbc

Browse files
Merge pull request #784 from cert-manager/cleanup_trust_package_makefiles
Rename Makefile debian trust package variables and files
2 parents 45ab5bf + b9ea5c0 commit 5783cbc

12 files changed

+115
-115
lines changed

.github/workflows/debian-trust-package-release-bookworm.yaml renamed to .github/workflows/trust-package-release-debian-bookworm.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: debian-trust-package-release-bookworm
1+
name: trust-package-release-debian-bookworm
22
on:
33
push:
44
branches: ['main']
55
paths:
66
- make/00_debian_bookworm_version.mk
77

88
jobs:
9-
build_images:
9+
build_and_push:
1010
runs-on: ubuntu-latest
1111

1212
permissions:

.github/workflows/debian-trust-package-release-bullseye.yaml renamed to .github/workflows/trust-package-release-debian-bullseye.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: debian-trust-package-release-bullseye
1+
name: trust-package-release-debian-bullseye
22
on:
33
push:
44
branches: ['main']
55
paths:
6-
- make/00_debian_version.mk
6+
- make/00_debian_bullseye_version.mk
77

88
jobs:
99
build_and_push:
@@ -36,8 +36,8 @@ jobs:
3636
go-version: ${{ steps.go-version.outputs.result }}
3737

3838
- id: release
39-
run: make release-debian-trust-package
39+
run: make release-debian-bullseye-trust-package
4040

4141
outputs:
42-
RELEASE_OCI_MANAGER_IMAGE: ${{ steps.release.outputs.RELEASE_OCI_PACKAGE_DEBIAN_IMAGE }}
43-
RELEASE_OCI_MANAGER_TAG: ${{ steps.release.outputs.RELEASE_OCI_PACKAGE_DEBIAN_TAG }}
42+
RELEASE_OCI_MANAGER_IMAGE: ${{ steps.release.outputs.RELEASE_OCI_PACKAGE_DEBIAN_BULLSEYE_IMAGE }}
43+
RELEASE_OCI_MANAGER_TAG: ${{ steps.release.outputs.RELEASE_OCI_PACKAGE_DEBIAN_BULLSEYE_TAG }}

.github/workflows/debian-trust-package-upgrade-bookworm.yaml renamed to .github/workflows/trust-package-upgrade-debian-bookworm.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: debian-trust-package-upgrade-bookworm
2-
concurrency: debian-trust-package-upgrade-bookworm
1+
name: trust-package-upgrade-debian-bookworm
2+
concurrency: trust-package-upgrade-debian-bookworm
33
on:
44
workflow_dispatch: {}
55
schedule:
66
- cron: '1 1 * * *'
77

88
jobs:
9-
debian-trust-package-upgrade-bookworm:
9+
debian-bookworm-trust-package-upgrade:
1010
runs-on: ubuntu-latest
1111

1212
permissions:
@@ -15,7 +15,7 @@ jobs:
1515

1616
env:
1717
SOURCE_BRANCH: "${{ github.ref_name }}"
18-
SELF_UPGRADE_BRANCH: "debian-trust-package-upgrade-bookworm-${{ github.ref_name }}"
18+
SELF_UPGRADE_BRANCH: "trust-package-upgrade-debian-bookworm-${{ github.ref_name }}"
1919

2020
steps:
2121
- name: Fail if branch is not head of branch.
@@ -42,7 +42,7 @@ jobs:
4242
git checkout -B "$SELF_UPGRADE_BRANCH"
4343
4444
- run: |
45-
make -j upgrade-debian-trust-package-bookworm-version
45+
make -j upgrade-debian-bookworm-trust-package-version
4646
4747
- id: is-up-to-date
4848
shell: bash
@@ -60,7 +60,7 @@ jobs:
6060
run: |
6161
git config --global user.name "cert-manager-bot"
6262
git config --global user.email "cert-manager-bot@users.noreply.github.com"
63-
git add -A && git commit -m "BOT: run 'make upgrade-debian-trust-package-bookworm-version'" --signoff
63+
git add -A && git commit -m "BOT: run 'make upgrade-debian-bookworm-trust-package-version'" --signoff
6464
git push -f origin "$SELF_UPGRADE_BRANCH"
6565
6666
- if: ${{ steps.is-up-to-date.outputs.result != 'true' }}

.github/workflows/debian-trust-package-upgrade-bullseye.yaml renamed to .github/workflows/trust-package-upgrade-debian-bullseye.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: debian-trust-package-upgrade-bullseye
2-
concurrency: debian-trust-package-upgrade-bullseye
1+
name: trust-package-upgrade-debian-bullseye
2+
concurrency: trust-package-upgrade-debian-bullseye
33
on:
44
workflow_dispatch: {}
55
schedule:
66
- cron: '0 0 * * *'
77

88
jobs:
9-
debian-trust-package-upgrade:
9+
debian-bullseye-trust-package-upgrade:
1010
runs-on: ubuntu-latest
1111

1212
permissions:
@@ -15,7 +15,7 @@ jobs:
1515

1616
env:
1717
SOURCE_BRANCH: "${{ github.ref_name }}"
18-
SELF_UPGRADE_BRANCH: "debian-trust-package-upgrade-${{ github.ref_name }}"
18+
SELF_UPGRADE_BRANCH: "trust-package-upgrade-debian-bullseye-${{ github.ref_name }}"
1919

2020
steps:
2121
- name: Fail if branch is not head of branch.
@@ -42,7 +42,7 @@ jobs:
4242
git checkout -B "$SELF_UPGRADE_BRANCH"
4343
4444
- run: |
45-
make -j upgrade-debian-trust-package-version
45+
make -j upgrade-debian-bullseye-trust-package-version
4646
4747
- id: is-up-to-date
4848
shell: bash
@@ -60,7 +60,7 @@ jobs:
6060
run: |
6161
git config --global user.name "cert-manager-bot"
6262
git config --global user.email "cert-manager-bot@users.noreply.github.com"
63-
git add -A && git commit -m "BOT: run 'make upgrade-debian-trust-package-version'" --signoff
63+
git add -A && git commit -m "BOT: run 'make upgrade-debian-bullseye-trust-package-version'" --signoff
6464
git push -f origin "$SELF_UPGRADE_BRANCH"
6565
6666
- if: ${{ steps.is-up-to-date.outputs.result != 'true' }}
@@ -84,7 +84,7 @@ jobs:
8484
head: process.env.SELF_UPGRADE_BRANCH,
8585
base: process.env.SOURCE_BRANCH,
8686
body: [
87-
'This PR is auto-generated to bump the Debian package version',
87+
'This PR is auto-generated to bump the Debian Bullseye package version',
8888
].join('\n'),
8989
});
9090
}

make/00_debian_bookworm_version.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
# WARNING: Changing this file triggers a build and release of the Debian trust package for Bookworm (Debian 12)
1616
#
17-
# This file is used to store the latest version of the debian trust package and the DEBIAN_BUNDLE_BOOKWORM_VERSION
18-
# variable is automatically updated by the `upgrade-debian-trust-package-bookworm-version` target and cron GH action.
17+
# This file is used to store the latest version of the debian trust package and the DEBIAN_BOOKWORM_BUNDLE_VERSION
18+
# variable is automatically updated by the `upgrade-debian-bookworm-trust-package-version` target and cron GH action.
1919

20-
DEBIAN_BUNDLE_BOOKWORM_VERSION := 20230311+deb12u1.2
21-
DEBIAN_BUNDLE_BOOKWORM_SOURCE_IMAGE=docker.io/library/debian:12-slim
20+
DEBIAN_BOOKWORM_BUNDLE_VERSION := 20230311+deb12u1.2
21+
DEBIAN_BOOKWORM_BUNDLE_SOURCE_IMAGE=docker.io/library/debian:12-slim
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# WARNING: Changing this file triggers a build and release of the debian trust package
16-
# This file is used to store the latest version of the debian trust package and the DEBIAN_BUNDLE_VERSION
17-
# variable is automatically updated by the `upgrade-debian-trust-package-version` target and cron GH action.
15+
# WARNING: Changing this file triggers a build and release of the Debian trust package for Bullseye (Debian 11)
16+
#
17+
# This file is used to store the latest version of the debian trust package and the DEBIAN_BULLSEYE_BUNDLE_VERSION
18+
# variable is automatically updated by the `upgrade-debian-bullseye-trust-package-version` target and cron GH action.
1819

19-
DEBIAN_BUNDLE_VERSION := 20210119.2
20-
DEBIAN_BUNDLE_SOURCE_IMAGE=docker.io/library/debian:11-slim
20+
DEBIAN_BULLSEYE_BUNDLE_VERSION := 20210119.2
21+
DEBIAN_BULLSEYE_BUNDLE_SOURCE_IMAGE=docker.io/library/debian:11-slim

make/00_mod.mk

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414

1515
oci_platforms := linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
1616

17-
include make/00_debian_version.mk
17+
include make/00_debian_bullseye_version.mk
1818
include make/00_debian_bookworm_version.mk
1919

2020
repo_name := github.com/cert-manager/trust-manager
2121

2222
kind_cluster_name := trust-manager
2323
kind_cluster_config := $(bin_dir)/scratch/kind_cluster.yaml
2424

25-
build_names := manager package_debian package_debian_bookworm
25+
build_names := manager package_debian_bullseye package_debian_bookworm
2626

2727
go_manager_main_dir := ./cmd/trust-manager
2828
go_manager_mod_dir := .
@@ -32,25 +32,25 @@ oci_manager_image_name := quay.io/jetstack/trust-manager
3232
oci_manager_image_tag := $(VERSION)
3333
oci_manager_image_name_development := cert-manager.local/trust-manager
3434

35-
go_package_debian_main_dir := .
36-
go_package_debian_mod_dir := ./trust-packages/debian
37-
go_package_debian_ldflags :=
38-
oci_package_debian_base_image_flavor := static
39-
oci_package_debian_image_name := quay.io/jetstack/cert-manager-package-debian
40-
oci_package_debian_image_tag := $(DEBIAN_BUNDLE_VERSION)
41-
oci_package_debian_image_name_development := cert-manager.local/cert-manager-package-debian
42-
debian_package_layer := $(bin_dir)/scratch/debian-trust-package
43-
oci_package_debian_additional_layers += $(debian_package_layer)
35+
go_package_debian_bullseye_main_dir := .
36+
go_package_debian_bullseye_mod_dir := ./trust-packages/debian
37+
go_package_debian_bullseye_ldflags :=
38+
oci_package_debian_bullseye_base_image_flavor := static
39+
oci_package_debian_bullseye_image_name := quay.io/jetstack/cert-manager-package-debian
40+
oci_package_debian_bullseye_image_tag := $(shell echo $(DEBIAN_BULLSEYE_BUNDLE_VERSION) | tr '+' '-')
41+
oci_package_debian_bullseye_image_name_development := cert-manager.local/trust-pkg-debian-bullseye
42+
debian_bullseye_package_layer := $(bin_dir)/scratch/debian-bullseye-trust-package
43+
oci_package_debian_bullseye_additional_layers += $(debian_bullseye_package_layer)
4444

4545
go_package_debian_bookworm_main_dir := .
4646
go_package_debian_bookworm_mod_dir := ./trust-packages/debian
4747
go_package_debian_bookworm_ldflags :=
4848
oci_package_debian_bookworm_base_image_flavor := static
4949
oci_package_debian_bookworm_image_name := quay.io/jetstack/trust-pkg-debian-bookworm
5050
# '+' characters are not valid in docker image names. Transform it to a '.' for images
51-
oci_package_debian_bookworm_image_tag := $(shell echo $(DEBIAN_BUNDLE_BOOKWORM_VERSION) | tr '+' '-')
51+
oci_package_debian_bookworm_image_tag := $(shell echo $(DEBIAN_BOOKWORM_BUNDLE_VERSION) | tr '+' '-')
5252
oci_package_debian_bookworm_image_name_development := cert-manager.local/trust-pkg-debian-bookworm
53-
debian_bookworm_package_layer := $(bin_dir)/scratch/debian-trust-package-bookworm
53+
debian_bookworm_package_layer := $(bin_dir)/scratch/debian-bookworm-trust-package
5454
oci_package_debian_bookworm_additional_layers += $(debian_bookworm_package_layer)
5555

5656

make/02_mod.mk

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,35 @@ smoke:
3333
$(MAKE) test-smoke
3434

3535
include make/validate-trust-package.mk
36-
include make/debian-trust-package.mk
37-
include make/debian-trust-package-bookworm.mk
36+
include make/debian-bullseye-trust-package.mk
37+
include make/debian-bookworm-trust-package.mk
3838

3939
.PHONY: release
4040
## Publish all release artifacts (image + helm chart)
4141
## @category [shared] Release
4242
release:
4343
$(MAKE) oci-push-manager
4444
$(MAKE) helm-chart-oci-push
45-
$(MAKE) oci-maybe-push-package_debian
45+
$(MAKE) oci-maybe-push-package_debian_bullseye
4646
$(MAKE) oci-maybe-push-package_debian_bookworm
4747

4848
@echo "RELEASE_OCI_MANAGER_IMAGE=$(oci_manager_image_name)" >> "$(GITHUB_OUTPUT)"
4949
@echo "RELEASE_OCI_MANAGER_TAG=$(oci_manager_image_tag)" >> "$(GITHUB_OUTPUT)"
50-
@echo "RELEASE_OCI_PACKAGE_DEBIAN_IMAGE=$(oci_package_debian_image_name)" >> "$(GITHUB_OUTPUT)"
51-
@echo "RELEASE_OCI_PACKAGE_DEBIAN_TAG=$(oci_package_debian_image_tag)" >> "$(GITHUB_OUTPUT)"
50+
@echo "RELEASE_OCI_PACKAGE_DEBIAN_BULLSEYE_IMAGE=$(oci_package_debian_bullseye_image_name)" >> "$(GITHUB_OUTPUT)"
51+
@echo "RELEASE_OCI_PACKAGE_DEBIAN_BULLSEYE_TAG=$(oci_package_debian_bullseye_image_tag)" >> "$(GITHUB_OUTPUT)"
52+
@echo "RELEASE_OCI_PACKAGE_DEBIAN_BOOKWORM_IMAGE=$(oci_package_debian_bookworm_image_name)" >> "$(GITHUB_OUTPUT)"
53+
@echo "RELEASE_OCI_PACKAGE_DEBIAN_BOOKWORM_TAG=$(oci_package_debian_bookworm_image_tag)" >> "$(GITHUB_OUTPUT)"
5254
@echo "RELEASE_HELM_CHART_IMAGE=$(helm_chart_image_name)" >> "$(GITHUB_OUTPUT)"
5355
@echo "RELEASE_HELM_CHART_VERSION=$(helm_chart_version)" >> "$(GITHUB_OUTPUT)"
5456

5557
@echo "Release complete!"
5658

57-
.PHONY: release-debian-trust-package
58-
release-debian-trust-package:
59-
$(MAKE) oci-maybe-push-package_debian
59+
.PHONY: release-debian-bullseye-trust-package
60+
release-debian-bullseye-trust-package:
61+
$(MAKE) oci-maybe-push-package_debian_bullseye
6062

61-
@echo "RELEASE_OCI_PACKAGE_DEBIAN_IMAGE=$(oci_package_debian_image_name)" >> "$(GITHUB_OUTPUT)"
62-
@echo "RELEASE_OCI_PACKAGE_DEBIAN_TAG=$(oci_package_debian_image_tag)" >> "$(GITHUB_OUTPUT)"
63+
@echo "RELEASE_OCI_PACKAGE_DEBIAN_BULLSEYE_IMAGE=$(oci_package_debian_bullseye_image_name)" >> "$(GITHUB_OUTPUT)"
64+
@echo "RELEASE_OCI_PACKAGE_DEBIAN_BULLSEYE_TAG=$(oci_package_debian_bullseye_image_tag)" >> "$(GITHUB_OUTPUT)"
6365

6466
@echo "Release complete!"
6567

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,34 @@
1414

1515
package_name_bookworm := cert-manager-debian-bookworm
1616

17-
debian_package_bookworm_layer := $(bin_dir)/scratch/debian-trust-package-bookworm
18-
debian_package_bookworm_json := $(debian_package_bookworm_layer)/debian-package/cert-manager-package-debian.json
17+
debian_bookworm_package_json := $(debian_bookworm_package_layer)/debian-package/cert-manager-package-debian.json
1918

20-
$(debian_package_bookworm_layer)/debian-package:
19+
$(debian_bookworm_package_layer)/debian-package:
2120
mkdir -p $@
2221

23-
$(debian_package_bookworm_json): | $(bin_dir)/bin/validate-trust-package $(debian_package_bookworm_layer)/debian-package
22+
$(debian_bookworm_package_json): | $(bin_dir)/bin/validate-trust-package $(debian_bookworm_package_layer)/debian-package
2423
BIN_VALIDATE_TRUST_PACKAGE=$(bin_dir)/bin/validate-trust-package \
25-
./make/debian-trust-package-fetch.sh exact $(DEBIAN_BUNDLE_BOOKWORM_SOURCE_IMAGE) $@ $(DEBIAN_BUNDLE_BOOKWORM_VERSION) $(package_name_bookworm)
24+
./make/debian-trust-package-fetch.sh exact $(DEBIAN_BOOKWORM_BUNDLE_SOURCE_IMAGE) $@ $(DEBIAN_BOOKWORM_BUNDLE_VERSION) $(package_name_bookworm)
2625

2726
# Make sure the build the package json file when building
28-
# the OCI image. This will ensure that the $(debian_package_bookworm_layer)
27+
# the OCI image. This will ensure that the $(debian_bookworm_package_layer)
2928
# folder has the desired contents.
30-
oci-build-package_debian_bookworm: $(debian_package_bookworm_json)
31-
oci-build-package_debian_bookworm__local: $(debian_package_bookworm_json)
32-
oci_additional_layers_package_debian_bookworm += $(debian_package_bookworm_layer)
29+
oci-build-package_debian_bookworm: $(debian_bookworm_package_json)
30+
oci-build-package_debian_bookworm__local: $(debian_bookworm_package_json)
3331

3432
# see https://stackoverflow.com/a/53408233
3533
sed_inplace := sed -i''
3634
ifeq ($(HOST_OS),darwin)
3735
sed_inplace := sed -i ''
3836
endif
3937

40-
.PHONY: upgrade-debian-trust-package-bookworm-version
41-
upgrade-debian-trust-package-bookworm-version: | $(bin_dir)/bin/validate-trust-package $(bin_dir)/scratch
42-
$(eval temp_out := $(bin_dir)/scratch/debian-trust-package-bookworm.temp.json)
38+
.PHONY: upgrade-debian-bookworm-trust-package-version
39+
upgrade-debian-bookworm-trust-package-version: | $(bin_dir)/bin/validate-trust-package $(bin_dir)/scratch
40+
$(eval temp_out := $(bin_dir)/scratch/debian-bookworm-trust-package.temp.json)
4341
rm -rf $(temp_out)
4442

4543
BIN_VALIDATE_TRUST_PACKAGE=$(bin_dir)/bin/validate-trust-package \
46-
./make/debian-trust-package-fetch.sh latest $(DEBIAN_BUNDLE_BOOKWORM_SOURCE_IMAGE) $(temp_out) $(DEBIAN_BUNDLE_BOOKWORM_VERSION) $(package_name_bookworm)
44+
./make/debian-trust-package-fetch.sh latest $(DEBIAN_BOOKWORM_BUNDLE_SOURCE_IMAGE) $(temp_out) $(DEBIAN_BOOKWORM_BUNDLE_VERSION) $(package_name_bookworm)
4745

4846
latest_version=$$(jq -r '.version' $(temp_out)); \
49-
$(sed_inplace) "s/DEBIAN_BUNDLE_BOOKWORM_VERSION := .*/DEBIAN_BUNDLE_BOOKWORM_VERSION := $$latest_version/" make/00_debian_bookworm_version.mk
47+
$(sed_inplace) "s/DEBIAN_BOOKWORM_BUNDLE_VERSION := .*/DEBIAN_BOOKWORM_BUNDLE_VERSION := $$latest_version/" make/00_debian_bookworm_version.mk
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright 2023 The cert-manager Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
package_name_bullseye := cert-manager-debian-bullseye
16+
17+
debian_bullseye_package_json := $(debian_bullseye_package_layer)/debian-package/cert-manager-package-debian.json
18+
19+
$(debian_bullseye_package_layer)/debian-package:
20+
mkdir -p $@
21+
22+
$(debian_bullseye_package_json): | $(bin_dir)/bin/validate-trust-package $(debian_bullseye_package_layer)/debian-package
23+
BIN_VALIDATE_TRUST_PACKAGE=$(bin_dir)/bin/validate-trust-package \
24+
./make/debian-trust-package-fetch.sh exact $(DEBIAN_BULLSEYE_BUNDLE_SOURCE_IMAGE) $@ $(DEBIAN_BULLSEYE_BUNDLE_VERSION) $(package_name_bullseye)
25+
26+
# Make sure the build the package json file when building
27+
# the OCI image. This will ensure that the $(debian_bullseye_package_layer)
28+
# folder has the desired contents.
29+
oci-build-package_debian_bullseye: $(debian_bullseye_package_json)
30+
oci-build-package_debian_bullseye__local: $(debian_bullseye_package_json)
31+
32+
# see https://stackoverflow.com/a/53408233
33+
sed_inplace := sed -i''
34+
ifeq ($(HOST_OS),darwin)
35+
sed_inplace := sed -i ''
36+
endif
37+
38+
.PHONY: upgrade-debian-bullseye-trust-package-version
39+
upgrade-debian-bullseye-trust-package-version: | $(bin_dir)/bin/validate-trust-package $(bin_dir)/scratch
40+
$(eval temp_out := $(bin_dir)/scratch/debian-bullseye-trust-package.temp.json)
41+
rm -rf $(temp_out)
42+
43+
BIN_VALIDATE_TRUST_PACKAGE=$(bin_dir)/bin/validate-trust-package \
44+
./make/debian-trust-package-fetch.sh latest $(DEBIAN_BULLSEYE_BUNDLE_SOURCE_IMAGE) $(temp_out) $(DEBIAN_BULLSEYE_BUNDLE_VERSION) $(package_name_bullseye)
45+
46+
latest_version=$$(jq -r '.version' $(temp_out)); \
47+
$(sed_inplace) "s/DEBIAN_BULLSEYE_BUNDLE_VERSION := .*/DEBIAN_BULLSEYE_BUNDLE_VERSION := $$latest_version/" make/00_debian_bullseye_version.mk

0 commit comments

Comments
 (0)