From 51651ac67efc9ba91e0859f4512b8d224e953ba2 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 17 Nov 2020 14:21:57 +0000 Subject: ci: Fix backslash escaping in run-docker.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spotted by shellcheck (warning SC1117): `\e` is not an actual escape sequence, so it’s interpreted as `\\e`. Best make that explicit. Signed-off-by: Philip Withnall --- .gitlab-ci/run-docker.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci/run-docker.sh b/.gitlab-ci/run-docker.sh index 6299c5595..56b2b0a7d 100755 --- a/.gitlab-ci/run-docker.sh +++ b/.gitlab-ci/run-docker.sh @@ -46,7 +46,7 @@ while (($# > 0)); do --base|-b) read_arg base "$@" || shift;; --base-version) read_arg base_version "$@" || shift;; --no-login) no_login=1;; - *) echo -e "\e[1;31mERROR\e[0m: Unknown option '$1'"; exit 1;; + *) echo -e "\\e[1;31mERROR\\e[0m: Unknown option '$1'"; exit 1;; esac shift done @@ -75,7 +75,7 @@ if [ $list == 1 ]; then filename=$( basename -- "$f" ) basename="${filename%.*}" - echo -e " \e[1;39m$basename\e[0m" + echo -e " \\e[1;39m$basename\\e[0m" done exit 0 fi @@ -87,7 +87,7 @@ if [ -z "${base}" ]; then fi if [ ! -f "$base.Dockerfile" ]; then - echo -e "\e[1;31mERROR\e[0m: Dockerfile for '$base' not found" + echo -e "\\e[1;31mERROR\\e[0m: Dockerfile for '$base' not found" exit 1 fi @@ -100,7 +100,7 @@ fi TAG="registry.gitlab.gnome.org/gnome/glib/${base}:${base_version}" if [ $build == 1 ]; then - echo -e "\e[1;32mBUILDING\e[0m: ${base} as ${TAG}" + echo -e "\\e[1;32mBUILDING\\e[0m: ${base} as ${TAG}" $SUDO_CMD docker build \ --build-arg HOST_USER_ID="$UID" \ --build-arg COVERITY_SCAN_PROJECT_NAME="${COVERITY_SCAN_PROJECT_NAME}" \ @@ -111,7 +111,7 @@ if [ $build == 1 ]; then fi if [ $push == 1 ]; then - echo -e "\e[1;32mPUSHING\e[0m: ${base} as ${TAG}" + echo -e "\\e[1;32mPUSHING\\e[0m: ${base} as ${TAG}" if [ $no_login == 0 ]; then $SUDO_CMD docker login registry.gitlab.gnome.org @@ -122,7 +122,7 @@ if [ $push == 1 ]; then fi if [ $run == 1 ]; then - echo -e "\e[1;32mRUNNING\e[0m: ${base} as ${TAG}" + echo -e "\\e[1;32mRUNNING\\e[0m: ${base} as ${TAG}" $SUDO_CMD docker run \ --rm \ --volume "$(pwd)/..:/home/user/app" \ -- cgit v1.2.1 From c7d2206df335f04ffec877ce8017cdf77371436e Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 17 Nov 2020 14:22:41 +0000 Subject: update-pcre: Use a subshell to avoid `cd ..` Shellcheck warning SC2103. Signed-off-by: Philip Withnall --- glib/update-pcre/update.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/glib/update-pcre/update.sh b/glib/update-pcre/update.sh index 0e558dd5c..69d7f8aa7 100644 --- a/glib/update-pcre/update.sh +++ b/glib/update-pcre/update.sh @@ -43,7 +43,8 @@ cd pcre # the file and then distribute it with GRegex. echo "Generating pcre_chartables.c" cp -R "${PCRE}" tmp-build -cd tmp-build +( +cd tmp-build || exit 1 ./configure --enable-utf8 --enable-unicode-properties --disable-cpp > /dev/null make pcre_chartables.c > /dev/null cat > ../pcre_chartables.c << \EOF @@ -52,7 +53,7 @@ cat > ../pcre_chartables.c << \EOF */ EOF cat pcre_chartables.c >> ../pcre_chartables.c -cd .. +) rm -R tmp-build # Compiled C files. -- cgit v1.2.1 From 72e4781ffcdcce48ba3c22508cdb4317ea1273ae Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 17 Nov 2020 14:52:25 +0000 Subject: ci: Temporarily fold SH and Py checks into style-check job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It doesn’t seem to be possible to use `only:changes` from a branch pipeline extending `.only-default` and have it correctly trigger when `*.sh` or `*.py` files are modified. We possibly need to convert all our pipelines to be merge-request-only, but that’s an avenue I’ve been down before and I couldn’t get it to work. Using [`workflow:rules`](https://docs.gitlab.com/ee/ci/yaml/README.html#workflowrules) might fix that, but I don’t have time to rework the entire CI to use that now. So in the meantime, move the SH and Py checks into the existing style-check job so we’re not always spinning up two additional container instances on every merge request. See !1743. Signed-off-by: Philip Withnall --- .gitlab-ci.yml | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 80dbfef83..e79a66767 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,36 +40,16 @@ variables: only: - schedules -sh-check: +style-check-diff: extends: .only-default image: $DEBIAN_IMAGE stage: style-check allow_failure: true script: + - .gitlab-ci/run-style-check-diff.sh - .gitlab-ci/run-shellcheck.sh - only: - changes: - - "**/*.sh" - -py-check: - extends: .only-default - image: $DEBIAN_IMAGE - stage: style-check - allow_failure: true - script: - .gitlab-ci/run-black.sh - .gitlab-ci/run-flake8.sh - only: - changes: - - "**/*.py" - -style-check-diff: - extends: .only-default - image: $DEBIAN_IMAGE - stage: style-check - allow_failure: true - script: - - .gitlab-ci/run-style-check-diff.sh check-todos: extends: .only-default -- cgit v1.2.1