diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bfa4134..1dd885d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: [ '1.14' ] + go: [ '1.18' ] name: Build ${{ matrix.go }} steps: - uses: aws-actions/configure-aws-credentials@v1 diff --git a/Dockerfile b/Dockerfile index d0a3117..8d15759 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.14-alpine +FROM golang:1.18-alpine COPY goroot/ /go/ # this is used to lint and build tarball diff --git a/README.md b/README.md index 40a5108..febcabf 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,10 @@ git remote set-head origin -a ``` ## Installation -`go get github.com/signalsciences/sigsci-module-golang` + +```console +go get github.com/signalsciences/sigsci-module-golang@latest +``` ## Example Code Snippet ```go diff --git a/go.mod b/go.mod index c009874..8f60d90 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ module github.com/signalsciences/sigsci-module-golang -go 1.12 +go 1.13 require ( - github.com/mitchellh/mapstructure v1.1.2 // indirect - github.com/philhofer/fwd v1.0.0 // indirect github.com/signalsciences/tlstext v1.2.0 github.com/tinylib/msgp v1.1.0 ) + +require github.com/philhofer/fwd v1.0.0 // indirect diff --git a/go.sum b/go.sum index fa39b00..43d1d59 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,3 @@ -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/signalsciences/tlstext v1.2.0 h1:ps1ZCoDz93oMK0ySe7G/2J0dpTT32cN20U+/xy0S7uk= diff --git a/scripts/test-golang114/Dockerfile b/scripts/test-golang117/Dockerfile similarity index 80% rename from scripts/test-golang114/Dockerfile rename to scripts/test-golang117/Dockerfile index 17a6ba0..459a2d6 100644 --- a/scripts/test-golang114/Dockerfile +++ b/scripts/test-golang117/Dockerfile @@ -1,6 +1,4 @@ -FROM golang:1.14-alpine - -COPY goroot/ /go/ +FROM golang:1.17-alpine # we will mount the current directory here VOLUME [ "/go/src/github.com/signalsciences/sigsci-module-golang" ] diff --git a/scripts/test-golang110/docker-compose.override.yml b/scripts/test-golang117/docker-compose.override.yml similarity index 100% rename from scripts/test-golang110/docker-compose.override.yml rename to scripts/test-golang117/docker-compose.override.yml diff --git a/scripts/test-golang114/docker-compose.yml b/scripts/test-golang117/docker-compose.yml similarity index 100% rename from scripts/test-golang114/docker-compose.yml rename to scripts/test-golang117/docker-compose.yml diff --git a/scripts/test-golang114/test.sh b/scripts/test-golang117/test.sh similarity index 80% rename from scripts/test-golang114/test.sh rename to scripts/test-golang117/test.sh index c2140da..b703739 100755 --- a/scripts/test-golang114/test.sh +++ b/scripts/test-golang117/test.sh @@ -37,9 +37,5 @@ $DOCKERCOMPOSE pull --ignore-pull-failures # > /dev/null --> output of all servers is mixed together and ugly # we get the individual logs at end # -if [ -d "goroot" ]; then - rm -rf goroot -fi -docker run -v ${PWD}/goroot:/go/ --rm golang:1.14-alpine /bin/sh -c 'apk --update add git && go get github.com/signalsciences/tlstext && go get github.com/tinylib/msgp && go get github.com/alecthomas/gometalinter' $DOCKERCOMPOSE up --no-color --build --abort-on-container-exit --exit-code-from mtest > /dev/null diff --git a/scripts/test-golang110/Dockerfile b/scripts/test-golang118/Dockerfile similarity index 78% rename from scripts/test-golang110/Dockerfile rename to scripts/test-golang118/Dockerfile index b43d134..4f44f9b 100644 --- a/scripts/test-golang110/Dockerfile +++ b/scripts/test-golang118/Dockerfile @@ -1,6 +1,4 @@ -FROM golang:1.10.6-alpine3.8 - -COPY goroot/ /go/ +FROM golang:1.18-alpine # we will mount the current directory here VOLUME [ "/go/src/github.com/signalsciences/sigsci-module-golang" ] diff --git a/scripts/test-golang111/docker-compose.override.yml b/scripts/test-golang118/docker-compose.override.yml similarity index 100% rename from scripts/test-golang111/docker-compose.override.yml rename to scripts/test-golang118/docker-compose.override.yml diff --git a/scripts/test-golang111/docker-compose.yml b/scripts/test-golang118/docker-compose.yml similarity index 96% rename from scripts/test-golang111/docker-compose.yml rename to scripts/test-golang118/docker-compose.yml index 25ad43b..9b8a2b0 100644 --- a/scripts/test-golang111/docker-compose.yml +++ b/scripts/test-golang118/docker-compose.yml @@ -53,5 +53,6 @@ services: - DISABLE_NOCOOKIE=1 - MTEST_BASEURL=web:8085 - MTEST_AGENT=agent:12345 + - "MTEST_RUN_TEST_BLOCK_VIA_REDIRECT=true" command: [ "/bin/wait-for", "web:8085", "--", "/bin/mtest", "-test.v" ] diff --git a/scripts/test-golang111/test.sh b/scripts/test-golang118/test.sh similarity index 80% rename from scripts/test-golang111/test.sh rename to scripts/test-golang118/test.sh index 87139d2..b703739 100755 --- a/scripts/test-golang111/test.sh +++ b/scripts/test-golang118/test.sh @@ -37,9 +37,5 @@ $DOCKERCOMPOSE pull --ignore-pull-failures # > /dev/null --> output of all servers is mixed together and ugly # we get the individual logs at end # -if [ -d "goroot" ]; then - rm -rf goroot -fi -docker run -v ${PWD}/goroot:/go/ --rm golang:1.11.3-alpine3.8 /bin/sh -c 'apk --update add git && go get github.com/signalsciences/tlstext && go get github.com/tinylib/msgp && go get github.com/alecthomas/gometalinter' $DOCKERCOMPOSE up --no-color --build --abort-on-container-exit --exit-code-from mtest > /dev/null diff --git a/scripts/test-golang111/Dockerfile b/scripts/test-golang119/Dockerfile similarity index 78% rename from scripts/test-golang111/Dockerfile rename to scripts/test-golang119/Dockerfile index cbd58ce..d805bb0 100644 --- a/scripts/test-golang111/Dockerfile +++ b/scripts/test-golang119/Dockerfile @@ -1,6 +1,4 @@ -FROM golang:1.11.3-alpine3.8 - -COPY goroot/ /go/ +FROM golang:1.19-alpine # we will mount the current directory here VOLUME [ "/go/src/github.com/signalsciences/sigsci-module-golang" ] diff --git a/scripts/test-golang114/docker-compose.override.yml b/scripts/test-golang119/docker-compose.override.yml similarity index 100% rename from scripts/test-golang114/docker-compose.override.yml rename to scripts/test-golang119/docker-compose.override.yml diff --git a/scripts/test-golang110/docker-compose.yml b/scripts/test-golang119/docker-compose.yml similarity index 96% rename from scripts/test-golang110/docker-compose.yml rename to scripts/test-golang119/docker-compose.yml index c40f8a8..9b8a2b0 100644 --- a/scripts/test-golang110/docker-compose.yml +++ b/scripts/test-golang119/docker-compose.yml @@ -53,6 +53,6 @@ services: - DISABLE_NOCOOKIE=1 - MTEST_BASEURL=web:8085 - MTEST_AGENT=agent:12345 + - "MTEST_RUN_TEST_BLOCK_VIA_REDIRECT=true" command: [ "/bin/wait-for", "web:8085", "--", "/bin/mtest", "-test.v" ] - diff --git a/scripts/test-golang110/test.sh b/scripts/test-golang119/test.sh similarity index 79% rename from scripts/test-golang110/test.sh rename to scripts/test-golang119/test.sh index e37f631..b703739 100755 --- a/scripts/test-golang110/test.sh +++ b/scripts/test-golang119/test.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -ex +set -e DOCKERCOMPOSE="docker-compose" @@ -20,6 +20,8 @@ cleanup() { } trap cleanup 0 1 2 3 6 +set -x + # attempt to clean up any leftover junk $DOCKERCOMPOSE down @@ -35,10 +37,5 @@ $DOCKERCOMPOSE pull --ignore-pull-failures # > /dev/null --> output of all servers is mixed together and ugly # we get the individual logs at end # -if [ -d "goroot" ]; then - rm -rf goroot -fi -docker run -v ${PWD}/goroot:/go/ --rm golang:1.10.6-alpine3.8 /bin/sh -c 'apk --update add git && go get github.com/signalsciences/tlstext && go get github.com/tinylib/msgp && go get github.com/alecthomas/gometalinter' - $DOCKERCOMPOSE up --no-color --build --abort-on-container-exit --exit-code-from mtest > /dev/null diff --git a/scripts/test.sh b/scripts/test.sh index b653f5f..636ad15 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -2,6 +2,6 @@ set -ex -(cd ./scripts/test-golang110 && ./test.sh) -(cd ./scripts/test-golang111 && ./test.sh) -(cd ./scripts/test-golang114 && ./test.sh) +(cd ./scripts/test-golang117 && ./test.sh) +(cd ./scripts/test-golang118 && ./test.sh) +(cd ./scripts/test-golang119 && ./test.sh)