Skip to content

Commit e52f407

Browse files
committed
caa: Remove old build logic
Nothing should be calling the `image-with-arch` make target anymore now that the process is unified, so remove it and the code that only it called to simplify and remove duplication. Signed-off-by: stevenhorsman <[email protected]>
1 parent c126fb6 commit e52f407

File tree

2 files changed

+3
-53
lines changed

2 files changed

+3
-53
lines changed

src/cloud-api-adaptor/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ clean: ## Remove binaries.
112112
image: .git-commit ## Build and push docker image to $registry
113113
COMMIT=$(COMMIT) VERSION=$(VERSION) YQ_VERSION=$(YQ_VERSION) hack/build.sh -i
114114

115-
.PHONY: image-with-arch
116-
image-with-arch: .git-commit ## Build the per arch image
117-
COMMIT=$(COMMIT) VERSION=$(VERSION) YQ_VERSION=$(YQ_VERSION) hack/build.sh -a
118-
119115
##@ Deployment
120116

121117
.PHONY: deploy

src/cloud-api-adaptor/hack/build.sh

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ release_tags=${RELEASE_TAGS:-"${commit}"}
2222

2323
supported_arches=${ARCHES:-"linux/amd64"}
2424

25-
arch_file_prefix="${script_dir}/../tags-architectures-"
2625
arch_prefix="linux/"
2726

2827
# Get a list of comma-separated tags (e.g. latest,5d0da3dc9764-dev), return
@@ -36,8 +35,8 @@ function get_tag_string() {
3635

3736
# if we are building fora single arch, then also append this to the tag
3837
if [[ -n "${arch:-}" ]] && [[ "${arch:-}" != *,* ]];then
39-
# strip the `linux/` from the docker buildx platform format
40-
arch_suffix="-${arch#"linux/"}"
38+
# strip the `linux/` from the docker buildx platform format in the tag
39+
arch_suffix="-${arch#${arch_prefix}}"
4140
fi
4241

4342
for tag in ${tags/,/ };do
@@ -72,54 +71,9 @@ function build_caa_payload_image() {
7271
popd
7372
}
7473

75-
function get_arch_specific_tag_string() {
76-
local tags="$1"
77-
local arch="$2"
78-
local tag_string=""
79-
80-
for tag in ${tags/,/ };do
81-
tag_string+=" -t ${registry}/${name}:${tag}-${arch}"
82-
done
83-
84-
echo "$tag_string"
85-
}
86-
87-
# accept one arch as --platform
88-
function build_caa_payload_arch_specific() {
89-
pushd "${script_dir}/../../"
90-
91-
arch=${supported_arches#"$arch_prefix"}
92-
93-
echo "arch="$arch >> "$arch_file_prefix$arch"
94-
95-
local tag_string
96-
local build_type=dev
97-
98-
tag_string="$(get_arch_specific_tag_string "$dev_tags" "${arch}")"
99-
if [[ "$release_build" == "true" ]]; then
100-
tag_string="$(get_arch_specific_tag_string "$release_tags" "${arch}")"
101-
build_type=release
102-
fi
103-
104-
docker buildx build --platform "${supported_arches}" \
105-
--build-arg RELEASE_BUILD="${release_build}" \
106-
--build-arg BUILD_TYPE="${build_type}" \
107-
--build-arg VERSION="${version}" \
108-
--build-arg COMMIT="${commit}" \
109-
--build-arg YQ_VERSION="${YQ_VERSION}" \
110-
-f cloud-api-adaptor/Dockerfile \
111-
${tag_string} \
112-
--push \
113-
.
114-
popd
115-
}
116-
11774
# Get the options
118-
while getopts ":ai" option; do
75+
while getopts ":i" option; do
11976
case $option in
120-
a) # image arch specific
121-
build_caa_payload_arch_specific
122-
exit;;
12377
i) # image
12478
build_caa_payload_image
12579
exit;;

0 commit comments

Comments
 (0)