New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker image: Add support to use as base image in CI/CD jobs #1077
Comments
Hi @dnsmichi 😀, Our goal being to have an executable Hurl image we naturally chose the However you can already use the hurl docker image in gitlab cd/cd simply by using gitlab keyword
I created an small example project on https://gitlab.com/lepapareil/hurl-gitlab-ci-sample that will be integrated in our doc shortly 😉. |
@lepapareil Thanks - @jcamiel was so kind to share the project in our Twitter DM yesterday. I was not aware that the entrypoint override really works in GitLab runner for the image, learned something new and will certainly update the blog post I am writing. For transparency, this is the blog MR: https://gitlab.com/gitlab-com/www-gitlab-com/-/merge_requests/115548 The other problem I am running into is the different library dependencies generating different HTTP protocol version responses, discussed in https://gitlab.com/everyonecancontribute/dev/hurl-playground/-/merge_requests/12#note_1203174103 and moving forward with #1077 |
Let's leave this issue open until the docs PR is ready, and then close it. :) |
FYI, I've written a blog post that details more GitLab CI/CD workflows with Hurl, including review app environments. Feel free to include it in your docs PR, or let me know if/how this would fit into the current docs. |
@jcamiel Awesome, thanks a lot! |
Created a doc issue for GitLab CI/CD integration #1215 |
Problem to solve
The Docker image provided with https://hub.docker.com/r/orangeopensource/hurl assumes that the entrypoint always will be
/usr/bin/hurl
thus not allowing to spawn a shell into the container - like a CI/CD pipeline and job would do.https://github.com/Orange-OpenSource/hurl/blob/master/contrib/docker/Dockerfile
Using the container image in GitLab CI/CD runs into weird error messages. The following .gitlab-ci.yml file uses the image as default, and runs a one line script to test hurl. The idea is to override any executed command, and also chain multiple commands for different actions; and/or provide additional commands that upload reports, call the API to add MR comments, etc.
error: hurl: cannot access 'sh': No such file or directory
leads into the problem thatENTRYPOINT
is always put on the command line, and the GitLab Runner essentially executesto run the container from the image, which won't work.
Pipeline run in https://gitlab.com/everyonecancontribute/dev/hurl-playground/-/commit/888d33906935979a098115ca2db09e4b65bc058e
Workaround
While this behavior is great for standalone container runtimes and containers that do not need supervision, it requires building custom container images for CI/CD pipelines.
For example using the Debian packages in https://gitlab.com/everyonecancontribute/dev/hurl-playground/-/blob/f84daac5aee893f444e8b1026ee8379310c2847e/Dockerfile
The resulting container image then works to build.
Proposal
ENTRYPOINT
attribute in the current Docker image would break existing workflows/docsCMD ["hurl"]
instead.@ maintainers - If you need access to the GitLab project https://gitlab.com/everyonecancontribute/dev/hurl-playground (or a copy of the same to play and break), please share your GitLab.com SaaS user handle with me, and I'll add you there to make things easier to reproduce :-)
The text was updated successfully, but these errors were encountered: