Add shellcheck job to CI
The first commit adds the linter to the CI. (ci fails as expected).
The second commit fixes the error. (ci succeeds as expected).
Tested with the following script that checks the version of alpine, ocaml, rustc and python in a set of images:
#!/bin/sh
image=${1?Supply image name as first parameter}
for image in $*; do
echo "Image: $image"
alpine_version=$(docker run "$image" cat /etc/os-release | grep PRETTY_NAME)
echo "Alpine version: ${alpine_version}"
ocaml_version=$(docker run "$image" ocaml --version)
echo "OCaml version: ${ocaml_version}"
rust_version=$(docker run "$image" rustc --version)
echo "Rust version: ${rust_version}"
python_version=$(docker run "$image" poetry run python --version)
echo "Python version: ${python_version}"
done
Results:
$ ./scripts/check_versions.sh registry.gitlab.com/nomadic-labs/opam-repository:runtime-build-test-dependencies--acc9adfe41d7bc4597baf04ee012e13d4f677bca registry.gitlab.com/nomadic-labs/opam-repository:runtime-build-dependencies--acc9adfe41d7bc4597baf04ee012e13d4f677bca registry.gitlab.com/nomadic-labs/opam-repository:runtime-prebuild-dependencies--acc9adfe41d7bc4597baf04ee012e13d4f677bca registry.gitlab.com/nomadic-labs/opam-repository:runtime-dependencies--acc9adfe41d7bc4597baf04ee012e13d4f677bca
Image: registry.gitlab.com/nomadic-labs/opam-repository:runtime-build-test-dependencies--acc9adfe41d7bc4597baf04ee012e13d4f677bca
Alpine version: PRETTY_NAME="Alpine Linux v3.14"
OCaml version: The OCaml toplevel, version 4.12.1
Rust version: rustc 1.52.1
Python version: Python 3.9.5
Image: registry.gitlab.com/nomadic-labs/opam-repository:runtime-build-dependencies--acc9adfe41d7bc4597baf04ee012e13d4f677bca
Alpine version: PRETTY_NAME="Alpine Linux v3.14"
OCaml version: The OCaml toplevel, version 4.12.1
Rust version: rustc 1.52.1
[ERROR] Command not found 'poetry'
Python version:
Image: registry.gitlab.com/nomadic-labs/opam-repository:runtime-prebuild-dependencies--acc9adfe41d7bc4597baf04ee012e13d4f677bca
Alpine version: PRETTY_NAME="Alpine Linux v3.14"
OCaml version: The OCaml toplevel, version 4.12.1
Rust version: rustc 1.52.1
[ERROR] Command not found 'poetry'
Python version:
Image: registry.gitlab.com/nomadic-labs/opam-repository:runtime-dependencies--acc9adfe41d7bc4597baf04ee012e13d4f677bca
Alpine version: PRETTY_NAME="Alpine Linux v3.14"
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "ocaml": executable file not found in $PATH: unknown.
ERRO[0000] error waiting for container: context canceled
OCaml version:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "rustc": executable file not found in $PATH: unknown.
ERRO[0000] error waiting for container: context canceled
Rust version:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "poetry": executable file not found in $PATH: unknown.
ERRO[0000] error waiting for container: context canceled
Python version:
Edited by Arvid Jakobsson