Closed glb-cblin closed 3 months ago
Hi
Hurl is the entrypoint of our Docker image so:
$ docker run --name mycontainer --rm -i -t ghcr.io/orange-opensource/hurl:latest
will run Hurl. For instance, to run hurl --version
, you can:
$ docker run --name mycontainer --rm -i -t ghcr.io/orange-opensource/hurl:latest --version
hurl 4.3.0 (aarch64-alpine-linux-musl) libcurl/8.5.0 OpenSSL/3.0.12 zlib/1.2.13 brotli/1.0.9 nghttp2/1.51.0
Features (libcurl): alt-svc AsynchDNS brotli HSTS HTTP2 IPv6 Largefile libz NTLM SSL TLS-SRP UnixSockets
Features (built-in): brotli
If you want an interactive shell inside the docker container, you can use --entrypoint
:
$ docker run --entrypoint /bin/sh --name mycontainer --rm -i -t ghcr.io/orange-opensource/hurl:latest
> hurl --version
hurl 4.3.0 (aarch64-alpine-linux-musl) libcurl/8.5.0 OpenSSL/3.0.12 zlib/1.2.13 brotli/1.0.9 nghttp2/1.51.0
Features (libcurl): alt-svc AsynchDNS brotli HSTS HTTP2 IPv6 Largefile libz NTLM SSL TLS-SRP UnixSockets
Features (built-in): brotli
>
thanks for the answer of my first point @jcamiel 👍
I did not know about this entrypoint subtelty, thanks
now can you also help with my second problem ?
easily launch the shell script from CI server
at the moment, I'm using gitlab anf I'm doing this
poc-ci-hurl:
stage: after-deploy
image: ghcr.io/orange-opensource/hurl:latest
script:
- cd apis/tests/hurl-tests
- sh run-all.sh
and I have this problem
Executing "step_script" stage of the job script
Using docker image sha256:cb35749cd4fab97d92d566328e10a83d6fbfbad64b66439379fc6d440ab72385 for ghcr.io/orange-opensource/hurl:latest with digest ghcr.io/orange-opensource/hurl@sha256:97f3514133e130a1fc026cda2d6e8fbce2a7e065c54965baca9d70c0d6b5afa6 ...
error: Cannot access 'sh': No such file or directory
@glb-cblin not a specialist of CI/CD wbut maybe you could try absolute path to binaries ? (i.e. /bin/sh
?)
Ok I've finally found the workaroud in https://forum.gitlab.com/t/how-to-override-entrypoint-in-gitlab-ci-yml/9429
poc-ci-hurl:
stage: after-deploy
image:
name: ghcr.io/orange-opensource/hurl:4.3.0
entrypoint: [""]
script:
- echo test
This is really the first time of my life that I need this ...
Usually, I can run a container with /bin/sh or sh or bash or etc...
Nothing works for the hurl image, can you provide any tip ?
the context is that I want to write a sh script in the directory where my hurl tests are located, so I'd like to
sorry if this is already explained somewhere, I cannot find it in the doc at https://hurl.dev/docs/tutorial/ci-cd-integration.html#running-tests-with-gitlab-cicd (i.e you are using docker-in-docker, this is not what I'd like) or https://about.gitlab.com/blog/2022/12/14/how-to-continously-test-web-apps-apis-with-hurl-and-gitlab-ci-cd/ (where you are directly calling hurl from the gitlab script and not from a shell script inside the docker container)