From 5bff34383820c3e11087663076d55ce18fbde5cd Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Sat, 6 Aug 2022 12:52:21 +0430 Subject: [PATCH 1/6] update: dockerfile in runtime --- runtime/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/Dockerfile b/runtime/Dockerfile index 9d67d6e..1a59bc2 100644 --- a/runtime/Dockerfile +++ b/runtime/Dockerfile @@ -21,7 +21,7 @@ RUN go mod download # Build the Go app WORKDIR /app -RUN go build -o /app-runner +RUN {{GOOS}} {{GOARCH}} go build -o /app-runner # Start the main app FROM alpine:latest From 0c13c2b0d4c68b492c188f7838cbee6fc48c0e10 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Sat, 6 Aug 2022 12:56:39 +0430 Subject: [PATCH 2/6] add: go os --- bin/mustache | 20 ++++++++++++++++++++ runtime/Dockerfile | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/bin/mustache b/bin/mustache index 6f9dd9d..9da44da 100755 --- a/bin/mustache +++ b/bin/mustache @@ -187,6 +187,26 @@ if [[ $search != "" && $replace != "" ]]; then sed -i '' "s/$search/$replace/g" "$WORKING_DIR/build/Dockerfile" fi +# go os +printf "Which operating system?\n" + +goos_options=("linux" "darwin" "windows") + +select_opt "${goos_options[@]}" +go_os_choice=$? + +# shellcheck disable=SC2059 +printf "${On_Yellow}Selected Go OS:${color_off} ${green}${goos_options[$go_os_choice]}${color_off}\n" + +search="{{GOOS}}" +replace=${goos_options[$go_os_choice]} +if [[ $search != "" && $replace != "" ]]; then + sed -i '' "s/$search/$replace/g" "$WORKING_DIR/build/Dockerfile" +fi + +# go arch + + # managing docker compose file DOCKER_COMPOSE="./stubs/docker-compose.yaml" cp "$DOCKER_COMPOSE" $WORKING_DIR diff --git a/runtime/Dockerfile b/runtime/Dockerfile index 1a59bc2..bd8783a 100644 --- a/runtime/Dockerfile +++ b/runtime/Dockerfile @@ -21,7 +21,7 @@ RUN go mod download # Build the Go app WORKDIR /app -RUN {{GOOS}} {{GOARCH}} go build -o /app-runner +RUN GOOS={{GOOS}} GOARCH={{GOARCH}} go build -o /app-runner # Start the main app FROM alpine:latest From b266d091accec8697bc47bfb9c73cab46068e113 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Sat, 6 Aug 2022 13:00:01 +0430 Subject: [PATCH 3/6] add: go arch --- bin/mustache | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bin/mustache b/bin/mustache index 9da44da..503a3a6 100755 --- a/bin/mustache +++ b/bin/mustache @@ -205,7 +205,21 @@ if [[ $search != "" && $replace != "" ]]; then fi # go arch +printf "Which architecture?\n" +goarch_options=("amd" "amd64" "386" "arm" "arm64" "wasm") + +select_opt "${goarch_options[@]}" +goarch_choice=$? + +# shellcheck disable=SC2059 +printf "${On_Yellow}Selected Go OS:${color_off} ${green}${goarch_options[$goarch_choice]}${color_off}\n" + +search="{{GOARCH}}" +replace=${goarch_options[$goarch_choice]} +if [[ $search != "" && $replace != "" ]]; then + sed -i '' "s/$search/$replace/g" "$WORKING_DIR/build/Dockerfile" +fi # managing docker compose file DOCKER_COMPOSE="./stubs/docker-compose.yaml" From 6b179e4ab12411122fd23c75640468928e85e3e8 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Sat, 6 Aug 2022 13:01:09 +0430 Subject: [PATCH 4/6] feat: all archs --- bin/mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mustache b/bin/mustache index 503a3a6..5d13c39 100755 --- a/bin/mustache +++ b/bin/mustache @@ -207,7 +207,7 @@ fi # go arch printf "Which architecture?\n" -goarch_options=("amd" "amd64" "386" "arm" "arm64" "wasm") +goarch_options=("386" "amd64" "amd64p32" "arm" "arm64" "arm64be" "armbe" "loong64" "mips" "mips64" "mips64le" "mips64p32" "mips64p32le" "mipsle" "ppc" "ppc64" "ppc64le" "riscv" "riscv64" "s390" "s390x" "sparc" "sparc64" "wasm") select_opt "${goarch_options[@]}" goarch_choice=$? From 08997922093d37529b246c1908f007ca95cf3876 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Sat, 6 Aug 2022 13:02:26 +0430 Subject: [PATCH 5/6] feat: all go os --- bin/mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mustache b/bin/mustache index 5d13c39..a6fc80a 100755 --- a/bin/mustache +++ b/bin/mustache @@ -190,7 +190,7 @@ fi # go os printf "Which operating system?\n" -goos_options=("linux" "darwin" "windows") +goos_options=("aix" "android" "darwin" "dragonfly" "freebsd" "hurd" "illumos" "ios" "js" "linux" "nacl" "netbsd" "openbsd" "plan9" "solaris" "windows" "zos") select_opt "${goos_options[@]}" go_os_choice=$? From ca02167aac5d16183a4abea4e017a0a40caa7852 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Sat, 6 Aug 2022 13:03:55 +0430 Subject: [PATCH 6/6] refactor: go os --- bin/mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mustache b/bin/mustache index a6fc80a..d764a29 100755 --- a/bin/mustache +++ b/bin/mustache @@ -207,7 +207,7 @@ fi # go arch printf "Which architecture?\n" -goarch_options=("386" "amd64" "amd64p32" "arm" "arm64" "arm64be" "armbe" "loong64" "mips" "mips64" "mips64le" "mips64p32" "mips64p32le" "mipsle" "ppc" "ppc64" "ppc64le" "riscv" "riscv64" "s390" "s390x" "sparc" "sparc64" "wasm") +goarch_options=("386" "amd64" "amd64p32" "arm" "arm64" "arm64be" "armbe" "loong64" "mips" "mips64" "mips64le" "mips64p32" "mips64p32le" "mipsle" "ppc" "ppc64" "wasm") select_opt "${goarch_options[@]}" goarch_choice=$?