From 50767dd1936699a576289242d02a6bd5edbf77c3 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Mon, 3 Apr 2023 03:41:06 -0700 Subject: [PATCH] =?UTF-8?q?Ensure=20that=20firefox=20linting=20of=20beta?= =?UTF-8?q?=20builds=20only=20happens=20on=20beta=20build=E2=80=A6=20(#184?= =?UTF-8?q?03)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Ensure that firefox linting of beta builds only happens on beta build commits * Fix script --- .circleci/config.yml | 11 +++-------- .circleci/scripts/mozilla-lint-beta.sh | 27 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 .circleci/scripts/mozilla-lint-beta.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index f17e666e8..f4f84e8d1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1157,14 +1157,9 @@ jobs: - attach_workspace: at: . - run: - name: Move beta build to dist - command: mv ./dist-beta ./dist - - run: - name: Move beta zips to builds - command: mv ./builds-beta ./builds - - run: - name: test:mozilla-lint - command: NODE_OPTIONS=--max_old_space_size=3072 yarn mozilla-lint + name: Lint beta for firefox + command: | + .circleci/scripts/mozilla-lint-beta.sh test-mozilla-lint-desktop: executor: node-browsers diff --git a/.circleci/scripts/mozilla-lint-beta.sh b/.circleci/scripts/mozilla-lint-beta.sh new file mode 100644 index 000000000..1096526b7 --- /dev/null +++ b/.circleci/scripts/mozilla-lint-beta.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -e +set -u +set -o pipefail + +current_commit_msg=$(git show -s --format='%s' HEAD) + +if [[ $current_commit_msg =~ Version[[:space:]](v[[:digit:]]+.[[:digit:]]+.[[:digit:]]+[-]beta.[[:digit:]]) ]] +then + # filter the commit message like Version v10.24.1-beta.1 + printf '%s\n' "Linting beta builds for firefox" + # Move beta build to dist + mv ./dist-beta ./dist + # Move beta zips to builds + mv ./builds-beta ./builds + # test:mozilla-lint + export NODE_OPTIONS='--max_old_space_size=3072' + yarn mozilla-lint +else + printf '%s\n' 'Commit message does not match commit message for beta pattern; skipping linting for firefox' + mkdir dist + mkdir builds + exit 0 +fi + +exit 0