Skip to content

Commit

Permalink
chore: fix docker.sh script (#6005)
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
  • Loading branch information
jakubdyszkiewicz committed Feb 13, 2023
1 parent d2c5e04 commit 62cf6c1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tools/releases/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ source "${SCRIPT_DIR}/../common.sh"
KUMA_DOCKER_REPO="${KUMA_DOCKER_REPO:-docker.io}"
KUMA_DOCKER_REPO_ORG="${KUMA_DOCKER_REPO_ORG:-${KUMA_DOCKER_REPO}/kumahq}"
KUMA_COMPONENTS="${KUMA_COMPONENTS:-kuma-cp kuma-dp kumactl kuma-init kuma-prometheus-sd}"
ENVOY_VERSION="${ENVOY_VERSION:-1.21.3}"
BUILD_INFO=$("${SCRIPT_DIR}/../releases/version.sh")
ENVOY_VERSION=$(echo "$BUILD_INFO" | cut -d " " -f 5)
KUMA_VERSION=$(echo "$BUILD_INFO" | cut -d " " -f 1)

function build() {
for component in ${KUMA_COMPONENTS}; do
Expand All @@ -21,6 +23,8 @@ function build() {
}

function docker_login() {
[ -z "$DOCKER_USERNAME" ] && msg_err "\$DOCKER_USERNAME required"
[ -z "$DOCKER_API_KEY" ] && msg_err "\$DOCKER_API_KEY required"
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_API_KEY" "$KUMA_DOCKER_REPO"
}

Expand All @@ -46,8 +50,6 @@ function usage() {
}

function main() {
KUMA_VERSION=$("${SCRIPT_DIR}/version.sh")

while [[ $# -gt 0 ]]; do
flag=$1
case $flag in
Expand All @@ -68,9 +70,6 @@ function main() {
shift
done

[ -z "$DOCKER_USERNAME" ] && msg_err "\$DOCKER_USERNAME required"
[ -z "$DOCKER_API_KEY" ] && msg_err "\$DOCKER_API_KEY required"

case $op in
build)
build
Expand Down

0 comments on commit 62cf6c1

Please sign in to comment.