File tree 2 files changed +26
-6
lines changed
2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
59
59
FROM ${ALPINE_IMAGE} as runner
60
60
RUN apk update && \
61
61
apk upgrade && \
62
- apk add bash ca-certificates
62
+ apk add bash ca-certificates git
63
+
63
64
COPY --from=downloader /usr/bin/helm /usr/bin/helm
64
65
COPY --from=downloader /usr/bin/kustomize /usr/bin/kustomize
65
66
COPY --from=builder /usr/bin/kube-score /kube-score
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ set -euo pipefail
4
+
5
+ function echoinfo() {
6
+ LIGHT_GREEN=' \033[1;32m'
7
+ NC=' \033[0m' # No Color
8
+ printf " ${LIGHT_GREEN} %s${NC} \n" " $1 "
9
+ }
10
+
11
+
3
12
VERSION=" $( git describe --tags --abbrev=0) "
13
+ TAG_ARGS=" -t zegl/kube-score:${VERSION} "
14
+ PLATFORM_ARGS=" "
15
+ PUSH_OR_LOAD_ARG=" --load"
4
16
5
- # TODO(gustav): also push latest!
17
+ if [ -z ${PUSH_LATEST+x} ]; then
18
+ echoinfo " [x] Dry run. (Set PUSH_LATEST if you want to push and tag latest)"
19
+ else
20
+ echoinfo " [x] Making production build. Will push to Docker Hub!"
21
+ TAG_ARGS=" ${TAG_ARGS} -t zegl/kube-score:latest"
22
+ PLATFORM_ARGS=" --platform linux/arm64 --platform linux/amd64"
23
+ PUSH_OR_LOAD_ARG=" --push"
24
+ PUSH_OR_LOAD_ARG=" "
25
+ fi
6
26
7
27
docker buildx build \
8
28
--build-arg KUBE_SCORE_VERSION=${VERSION} \
9
29
--build-arg " KUBE_SCORE_COMMIT=$( git rev-parse HEAD) " \
10
30
--build-arg " KUBE_SCORE_DATE=$( date -Iseconds) " \
11
- --platform linux/arm64 \
12
- --platform linux/amd64 \
13
- -t zegl/kube-score:${VERSION} \
14
- --push \
31
+ ${PLATFORM_ARGS} \
32
+ ${TAG_ARGS} \
33
+ ${PUSH_OR_LOAD_ARG} \
15
34
--target runner \
16
35
.
You can’t perform that action at this time.
0 commit comments