diff options
author | Quentin Schulz <quentin.schulz@theobroma-systems.com> | 2023-06-29 16:02:17 +0200 |
---|---|---|
committer | Quentin Schulz <quentin.schulz@theobroma-systems.com> | 2023-08-04 13:33:31 +0200 |
commit | 29615f5c166aba6c4785e8101a01dbc7ec7baa00 (patch) | |
tree | cd4ce71ab351f936fbbdab5ca2b6f4dc39fc91ae | |
parent | 864bfe42067d87376f705adc35c512be8b84bade (diff) |
add GitLab CI for linter
This adds a pipeline for using linters. Only flake8 is used for now.
alpine/flake8 doesn't start a shell but rather execute flake8 directly.
However, GitLab CI seems to start all containers by trying to start a
shell:
```
-c if [ -x /usr/local/bin/bash ]; then
exec /usr/local/bin/bash
elif [ -x /usr/bin/bash ]; then
exec /usr/bin/bash
elif [ -x /bin/bash ]; then
exec /bin/bash
elif [ -x /usr/local/bin/sh ]; then
exec /usr/local/bin/sh
elif [ -x /usr/bin/sh ]; then
exec /usr/bin/sh
elif [ -x /bin/sh ]; then
exec /bin/sh
elif [ -x /busybox/sh ]; then
exec /busybox/sh
else
echo shell not found
exit 1
fi
```
Since flake8 is the entrypoint, it gets passed this long string which it
cannot do anything with (as opposed to the - I guess - expected `sh`).
Instead, let's replace the entrypoint of the docker image so that the
runner directly passes the script to the container.
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
-rw-r--r-- | .gitlab-ci.yml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..47fd843 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,11 @@ +stages: + - linting + +flake8: + tags: + - docker + stage: linting + image: + name: docker.io/alpine/flake8:6.0.0 + entrypoint: [""] + script: flake8 . |