From a1a46ae38995f1506c3574c7818cfc8fcc887d6c Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Mon, 25 Apr 2022 17:49:25 +0100 Subject: [PATCH] ci(gitlab-ci): use Node `16.x` for `pre-commit` in test conversion job The `test_conversion` job failed during the weekly testing: * https://gitlab.com/myii/template-formula/-/jobs/2371193438 The `stderr` being: ``` /root/.cache/pre-commit/repomigj3p4n/node_env-default/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /root/.cache/pre-commit/repomigj3p4n/node_env-default/bin/node) ``` The following references led to this resolution: * https://github.com/pre-commit/pre-commit/issues/2351 * https://stackoverflow.com/questions/71939099/bitbucket-pipeline-error-installing-pre-commit-ts-lint As mentioned there: > a few days ago node 18.x was released and the prebuilt binaries > require a relatively-recent version of glibc Which obviously isn't available on our current Bionic-based `dind` image, i.e. 'myii/ssf-dind-ruby-bionic:2.7.5-1bbox1'. While debugging this situation locally, noticed that the use of a relative `tmp/...` subdirectory was within the `template-formula` directory itself -- so switched this to using `/tmp/...` instead. --- .gitlab-ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 91ce5bb..a62ca59 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -137,8 +137,12 @@ rubocop: cache: *cache_bundler before_script: - 'export CONVERTED=test-the-use_this_template-button' - - 'git clone . tmp/"${CONVERTED}"-formula' - - 'cd tmp/"${CONVERTED}"-formula' + - 'git clone . /tmp/"${CONVERTED}"-formula' + - 'cd /tmp/"${CONVERTED}"-formula' + # Limit the version of `node` used by `pre-commit`, to avoid the following error: + # .../bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found + - 'echo "default_language_version:" >> .pre-commit-config.yaml' + - 'echo " node: 16.14.2" >> .pre-commit-config.yaml' # Install `pre-commit` hooks - 'bin/install-hooks' # Run the conversion script with debug output