From c579c9e2ffc4038f9140a27efa1095db2f9088b0 Mon Sep 17 00:00:00 2001 From: Julien Bonastre <71309253+julienbonastre@users.noreply.github.com> Date: Thu, 12 Aug 2021 16:58:23 +1000 Subject: [PATCH 01/12] trimming out non-Go components for now --- entrypoint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index d1ef21a..204b80d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -97,9 +97,10 @@ ${output} function main(){ parseInputs cd ${GITHUB_WORKSPACE}/${INPUT_WORKING_DIR} - installTypescript + ls ${GITHUB_WORKSPACE} + #installTypescript installAwsCdk - installPipRequirements + #installPipRequirements runCdk ${INPUT_CDK_ARGS} } From 9e9cd1fa435a2202feb55aa82c19458c4f6bd706 Mon Sep 17 00:00:00 2001 From: Julien Bonastre <71309253+julienbonastre@users.noreply.github.com> Date: Thu, 12 Aug 2021 17:12:49 +1000 Subject: [PATCH 02/12] Added Golang packages --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index edd8459..8e56c50 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,13 @@ FROM alpine:3.13 -RUN apk --update --no-cache add nodejs npm python3 py3-pip jq curl bash git docker && \ +RUN apk --update --no-cache add nodejs npm python3 py3-pip jq curl bash git docker go && \ ln -sf /usr/bin/python3 /usr/bin/python +# Configure Go +ENV GOROOT /usr/lib/go +ENV GOPATH /go +ENV PATH /go/bin:$PATH + COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] From c658bc2a89594b8516bf7eb735d39fb91acfef71 Mon Sep 17 00:00:00 2001 From: Julien Bonastre <71309253+julienbonastre@users.noreply.github.com> Date: Thu, 12 Aug 2021 17:22:38 +1000 Subject: [PATCH 03/12] Added go module fetch --- entrypoint.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 204b80d..3e5abba 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -14,6 +14,10 @@ function installTypescript(){ npm install typescript } +function runGoModuleFetch() { + go mod tidy +} + function installAwsCdk(){ echo "Install aws-cdk ${INPUT_CDK_VERSION}" if [ "${INPUT_CDK_VERSION}" == "latest" ]; then @@ -99,6 +103,7 @@ function main(){ cd ${GITHUB_WORKSPACE}/${INPUT_WORKING_DIR} ls ${GITHUB_WORKSPACE} #installTypescript + runGoModuleFetch installAwsCdk #installPipRequirements runCdk ${INPUT_CDK_ARGS} From 14017cf9e6522e86aad3a1d3858f48e75eef35e4 Mon Sep 17 00:00:00 2001 From: Julien Bonastre <71309253+julienbonastre@users.noreply.github.com> Date: Thu, 12 Aug 2021 17:58:18 +1000 Subject: [PATCH 04/12] go version setting --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8e56c50..887c8dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.13 -RUN apk --update --no-cache add nodejs npm python3 py3-pip jq curl bash git docker go && \ +RUN apk --update --no-cache add nodejs npm python3 py3-pip jq curl bash git docker go>=1.16 && \ ln -sf /usr/bin/python3 /usr/bin/python # Configure Go From 1dab64f6bd4ef5acef9c21871384cebe4b0d48f3 Mon Sep 17 00:00:00 2001 From: Julien Bonastre <71309253+julienbonastre@users.noreply.github.com> Date: Thu, 12 Aug 2021 18:02:38 +1000 Subject: [PATCH 05/12] Update Dockerfile --- Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 887c8dc..ff0e9d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,14 @@ FROM alpine:3.13 -RUN apk --update --no-cache add nodejs npm python3 py3-pip jq curl bash git docker go>=1.16 && \ +RUN apk --update --no-cache add nodejs npm python3 py3-pip jq curl bash git docker && \ ln -sf /usr/bin/python3 /usr/bin/python +COPY --from=docker pull golang:alpine /usr/local/go/ /usr/local/go/ + +ENV PATH="/usr/local/go/bin:${PATH}" # Configure Go -ENV GOROOT /usr/lib/go -ENV GOPATH /go -ENV PATH /go/bin:$PATH +# ENV GOROOT /usr/lib/go +# ENV GOPATH /go COPY entrypoint.sh /entrypoint.sh From 7641cd067d5f1b37143fe7689fc55a5825990136 Mon Sep 17 00:00:00 2001 From: Julien Bonastre <71309253+julienbonastre@users.noreply.github.com> Date: Thu, 12 Aug 2021 18:03:38 +1000 Subject: [PATCH 06/12] Update entrypoint.sh --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 3e5abba..9405f4c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -15,6 +15,7 @@ function installTypescript(){ } function runGoModuleFetch() { + echo ">>> We are running: $(go version)" go mod tidy } @@ -101,7 +102,6 @@ ${output} function main(){ parseInputs cd ${GITHUB_WORKSPACE}/${INPUT_WORKING_DIR} - ls ${GITHUB_WORKSPACE} #installTypescript runGoModuleFetch installAwsCdk From 3ba3779ff7d930ec964f0632e4855694ba3d06b3 Mon Sep 17 00:00:00 2001 From: Julien Bonastre <71309253+julienbonastre@users.noreply.github.com> Date: Thu, 12 Aug 2021 18:18:17 +1000 Subject: [PATCH 07/12] What a fool.. :D --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ff0e9d0..70762c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM alpine:3.13 RUN apk --update --no-cache add nodejs npm python3 py3-pip jq curl bash git docker && \ ln -sf /usr/bin/python3 /usr/bin/python -COPY --from=docker pull golang:alpine /usr/local/go/ /usr/local/go/ +COPY --from=golang:alpine /usr/local/go/ /usr/local/go/ ENV PATH="/usr/local/go/bin:${PATH}" # Configure Go From a2c4376c4423243eac5fe0474394a069eb6f4736 Mon Sep 17 00:00:00 2001 From: Julien Bonastre <71309253+julienbonastre@users.noreply.github.com> Date: Fri, 13 Aug 2021 10:36:31 +1000 Subject: [PATCH 08/12] Test: believe to be redundant as cdk app does it --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 9405f4c..f06e8b0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -16,7 +16,7 @@ function installTypescript(){ function runGoModuleFetch() { echo ">>> We are running: $(go version)" - go mod tidy +# go mod tidy } function installAwsCdk(){ From 652d6f554facd0e629f64c13d3e1c29367b42efa Mon Sep 17 00:00:00 2001 From: Julien Bonastre <71309253+julienbonastre@users.noreply.github.com> Date: Tue, 17 Aug 2021 16:35:13 +1000 Subject: [PATCH 09/12] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b33340a..e28cdd8 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ AWS-CDK GitHub Actions allow you to run `cdk deploy` and `cdk diff` and ... on y - TypeScript - JavaScript - Python +- Golang ## Example usage From 3bd8615bd575baee17c35d664cddd1a6d331f9a6 Mon Sep 17 00:00:00 2001 From: Julien Bonastre <71309253+julienbonastre@users.noreply.github.com> Date: Tue, 17 Aug 2021 16:36:23 +1000 Subject: [PATCH 10/12] Tidy up --- Dockerfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 70762c5..d8fa44a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,11 +4,7 @@ RUN apk --update --no-cache add nodejs npm python3 py3-pip jq curl bash git dock ln -sf /usr/bin/python3 /usr/bin/python COPY --from=golang:alpine /usr/local/go/ /usr/local/go/ - ENV PATH="/usr/local/go/bin:${PATH}" -# Configure Go -# ENV GOROOT /usr/lib/go -# ENV GOPATH /go COPY entrypoint.sh /entrypoint.sh From fb813ae693fef7da435eba8b9eefac304de46266 Mon Sep 17 00:00:00 2001 From: Julien Bonastre <71309253+julienbonastre@users.noreply.github.com> Date: Tue, 17 Aug 2021 16:37:24 +1000 Subject: [PATCH 11/12] Restore functionality for Python/JS/TS CDK apps --- entrypoint.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index f06e8b0..9e7f79f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -14,10 +14,6 @@ function installTypescript(){ npm install typescript } -function runGoModuleFetch() { - echo ">>> We are running: $(go version)" -# go mod tidy -} function installAwsCdk(){ echo "Install aws-cdk ${INPUT_CDK_VERSION}" @@ -102,10 +98,9 @@ ${output} function main(){ parseInputs cd ${GITHUB_WORKSPACE}/${INPUT_WORKING_DIR} - #installTypescript - runGoModuleFetch + installTypescript installAwsCdk - #installPipRequirements + installPipRequirements runCdk ${INPUT_CDK_ARGS} } From 2ec02c9567798872c76101e29299f25d9dc7cbfb Mon Sep 17 00:00:00 2001 From: Julien Bonastre <71309253+julienbonastre@users.noreply.github.com> Date: Tue, 17 Aug 2021 16:55:23 +1000 Subject: [PATCH 12/12] Update entrypoint.sh --- entrypoint.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 9e7f79f..d1ef21a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -14,7 +14,6 @@ function installTypescript(){ npm install typescript } - function installAwsCdk(){ echo "Install aws-cdk ${INPUT_CDK_VERSION}" if [ "${INPUT_CDK_VERSION}" == "latest" ]; then