Skip to content

Commit c80bae8

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 ff3818f commit c80bae8

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
@@ -119,10 +119,6 @@ clean: ## Remove binaries.
119119
image: .git-commit ## Build and push docker image to $registry
120120
COMMIT=$(COMMIT) VERSION=$(VERSION) YQ_VERSION=$(YQ_VERSION) hack/build.sh -i
121121

122-
.PHONY: image-with-arch
123-
image-with-arch: .git-commit ## Build the per arch image
124-
COMMIT=$(COMMIT) VERSION=$(VERSION) YQ_VERSION=$(YQ_VERSION) hack/build.sh -a
125-
126122
##@ Deployment
127123

128124
.PHONY: deploy

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

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ fi
2626

2727
supported_arches=${ARCHES:-"linux/amd64"}
2828

29-
arch_file_prefix="${script_dir}/../tags-architectures-"
3029
arch_prefix="linux/"
3130

3231
# Get a list of comma-separated tags (e.g. latest,5d0da3dc9764-dev), return
@@ -40,8 +39,8 @@ function get_tag_string() {
4039

4140
# if we are building for a single arch, then also append this to the tag
4241
if [[ -n "${arch:-}" ]] && [[ "${arch:-}" != *,* ]];then
43-
# strip the `linux/` from the docker buildx platform format
44-
arch_suffix="-${arch#"linux/"}"
42+
# strip the `linux/` from the docker buildx platform format in the tag
43+
arch_suffix="-${arch#${arch_prefix}}"
4544
fi
4645

4746
for tag in ${tags/,/ };do
@@ -75,54 +74,9 @@ function build_caa_payload_image() {
7574
popd
7675
}
7776

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

0 commit comments

Comments
 (0)