From 317ea73b3a369e42cda84f8ec34274d47a1c84b2 Mon Sep 17 00:00:00 2001 From: Marc Carmier Date: Wed, 11 Nov 2020 00:26:54 +0100 Subject: [PATCH 1/5] Add Dockerfile Signed-off-by: Marc Carmier --- Dockerfile | 19 +++++++++++++++++++ README.md | 6 ++++++ 2 files changed, 25 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..3dde7f51 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM golang:1.15-buster as build + +RUN apt-get update && \ + apt-get install -y unixodbc unixodbc-dev + +WORKDIR /go/src/venom +COPY . . +RUN go build -a -installsuffix cgo -ldflags "-X github.com/ovh/venom.Version=$(git describe)" -o /go/bin ./... +RUN chmod a+rx /go/bin/venom + +FROM debian:buster-slim + +RUN apt-get update && \ + apt-get install -y unixodbc && \ + rm -rf /var/lib/apt/lists/* + +COPY --from=build /go/bin/venom /opt/venom + +ENTRYPOINT ["/opt/venom"] diff --git a/README.md b/README.md index 7a591b0f..bfc8dfb1 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,12 @@ Flags: --var-from-file strings --var-from-file filename.yaml --var-from-file filename2.yaml : hcl|json|yaml, must contains map[string]string' ``` +## Docker image + +A docker image is available. +```bash + docker run -it --rm -v $(pwd):/tests run /tests/testsuite.yaml +``` ## Executors * **dbfixtures**: https://github.com/ovh/venom/tree/master/executors/dbfixtures From 8a2ce9d12bb4a13c452e0770883b5f65c3bd5669 Mon Sep 17 00:00:00 2001 From: Marc Carmier Date: Fri, 13 Nov 2020 11:52:52 +0100 Subject: [PATCH 2/5] Add volumes for logs and testsuite Signed-off-by: Marc Carmier --- Dockerfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3dde7f51..4b8f705b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ COPY . . RUN go build -a -installsuffix cgo -ldflags "-X github.com/ovh/venom.Version=$(git describe)" -o /go/bin ./... RUN chmod a+rx /go/bin/venom -FROM debian:buster-slim +FROM debian:buster-slim RUN apt-get update && \ apt-get install -y unixodbc && \ @@ -16,4 +16,13 @@ RUN apt-get update && \ COPY --from=build /go/bin/venom /opt/venom -ENTRYPOINT ["/opt/venom"] +# Default volume for tests output and logs +VOLUME /outputs + +#Default volume for tests suite +VOLUME /testsuite +WORKDIR /testsuite + +ENTRYPOINT ["/opt/venom" ] + +CMD [ "run", "--output-dir", "/outputs"] \ No newline at end of file From 9a15558d0f91f21f26c22950027dabf0ad3d9d94 Mon Sep 17 00:00:00 2001 From: Marc Carmier Date: Fri, 13 Nov 2020 13:36:44 +0100 Subject: [PATCH 3/5] Update Dockerfile Sure, if it respect your release cycle, it should be done like this Co-authored-by: Yvonnick Esnault Signed-off-by: Marc Carmier --- Dockerfile | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4b8f705b..6ca07286 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,14 @@ -FROM golang:1.15-buster as build - -RUN apt-get update && \ - apt-get install -y unixodbc unixodbc-dev - -WORKDIR /go/src/venom -COPY . . -RUN go build -a -installsuffix cgo -ldflags "-X github.com/ovh/venom.Version=$(git describe)" -o /go/bin ./... -RUN chmod a+rx /go/bin/venom - FROM debian:buster-slim RUN apt-get update && \ - apt-get install -y unixodbc && \ + apt-get install -y curl unixodbc && \ rm -rf /var/lib/apt/lists/* -COPY --from=build /go/bin/venom /opt/venom +RUN LAST_RELEASE=$(curl -s https://api.github.com/repos/ovh/venom/releases | grep tag_name | head -n 1 | cut -d '"' -f 4) && \ + todl=$(curl -s https://api.github.com/repos/ovh/venom/releases | grep ${LAST_RELEASE} | grep browser_download_url | grep -E 'venom.linux-amd64' | cut -d '"' -f 4) && \ + curl -s $todl -L -o /opt/venom && \ + chmod +x /opt/venom -# Default volume for tests output and logs VOLUME /outputs #Default volume for tests suite @@ -25,4 +17,4 @@ WORKDIR /testsuite ENTRYPOINT ["/opt/venom" ] -CMD [ "run", "--output-dir", "/outputs"] \ No newline at end of file +CMD [ "run", "--output-dir", "/outputs"] From b94436eb03a9478d5d85bb5af89d100556fe93c8 Mon Sep 17 00:00:00 2001 From: Marc Carmier Date: Sat, 14 Nov 2020 22:26:12 +0100 Subject: [PATCH 4/5] Add outputs volume in example Signed-off-by: Marc Carmier --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bfc8dfb1..c4ff78d8 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ It can also output xUnit results files. ## Command Line -Download latest binary release from https://github.com/ovh/venom/releases +Download latest binary release from https://github.com/ovh/venom/releases If you want to go get it with: ```go get -u github.com/ovh/venom/cli/venom```, please check the dependencies in §Hacking section. @@ -39,7 +39,7 @@ Flags: A docker image is available. ```bash - docker run -it --rm -v $(pwd):/tests run /tests/testsuite.yaml + docker run -it --rm -v $(pwd)/outputs:/outputs -v $(pwd):/tests run /tests/testsuite.yaml ``` ## Executors @@ -185,7 +185,7 @@ Venom templating Beside venom variables, it is possible to use templating functions: -* expandEnv : {{expandEnv }}, rewrites the named file and replaces ${var} or $var in the string according to the values of the current environment variables. References to undefined variables are replaced by the empty string. You can use it a script step for instance: `script: cat {{expandEnv ./myFile}}`. +* expandEnv : {{expandEnv }}, rewrites the named file and replaces ${var} or $var in the string according to the values of the current environment variables. References to undefined variables are replaced by the empty string. You can use it a script step for instance: `script: cat {{expandEnv ./myFile}}`. ### Testsuite Versions From 9fd5d1dfcc02f86dd620cc6aa7e69e1db91f7320 Mon Sep 17 00:00:00 2001 From: Yvonnick Esnault Date: Tue, 17 Nov 2020 11:36:09 +0100 Subject: [PATCH 5/5] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index f28d9f78..430d0bb7 100644 --- a/README.md +++ b/README.md @@ -214,7 +214,6 @@ Builtin variables: ## Export test results as jUnit, json, yaml or tap reports - ```bash venom run --format=xml --output-dir="." ```