From c4f612a762412caa7bc73606f9032a2bd224a9a0 Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Thu, 10 Apr 2025 12:09:10 +0200 Subject: [PATCH 1/3] Migrate from CircleCI to GitHub Actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove CircleCI configuration - Add GitHub Actions workflow for shellcheck 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .circleci/config.yml | 8 -------- .github/workflows/shellcheck.yml | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 8 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/shellcheck.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 6c51b3c..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: 2.1 -orbs: - shellcheck: circleci/shellcheck@2.2.4 -workflows: - check-scripts: - jobs: - - shellcheck/check: - dir: ./scripts diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 0000000..0331383 --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,18 @@ +name: ShellCheck + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + shellcheck: + name: Shellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@master + with: + scandir: './scripts' \ No newline at end of file From 7ee5da48c81f11389158f53921b8a1071f1bd758 Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Thu, 10 Apr 2025 12:20:25 +0200 Subject: [PATCH 2/3] Fix ShellCheck issues in upgrade-postgres.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix variable quoting issues to prevent globbing and word splitting - Fix variable reference typo (POSTGRES_POSTGRES_NEW_VERSION → POSTGRES_NEW_VERSION) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- scripts/upgrade-postgres.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade-postgres.sh b/scripts/upgrade-postgres.sh index b1ba55b..2f5846c 100755 --- a/scripts/upgrade-postgres.sh +++ b/scripts/upgrade-postgres.sh @@ -103,7 +103,7 @@ fi if [[ $POSTGRES_UPGRADE_LINE == "" ]]; then echo "no exported POSTGRES_UPGRADE_LINE environment variable found" - echo "setting POSTGRES_UPGRADE_LINE to default $POSTGRES_OLD_VERSION-to-$POSTGRES_POSTGRES_NEW_VERSION" + echo "setting POSTGRES_UPGRADE_LINE to default $POSTGRES_OLD_VERSION-to-$POSTGRES_NEW_VERSION" echo "the POSTGRES_UPGRADE_LINE needs to match a folder found here - https://github.com/tianon/docker-postgres-upgrade" echo "it should read 'old-to-new'" POSTGRES_UPGRADE_LINE=$POSTGRES_OLD_VERSION-to-$POSTGRES_NEW_VERSION # i.e. '9.4-to-13' @@ -164,7 +164,7 @@ cp -ra "$PATH_TO_MATTERMOST_DOCKER"/volumes/db/ "$PATH_TO_MATTERMOST_DOCKER"/bac mkdir "$PATH_TO_MATTERMOST_DOCKER"/volumes/db/"$POSTGRES_OLD_VERSION" mv "$PATH_TO_MATTERMOST_DOCKER"/volumes/db/var/lib/postgresql/data/ "$PATH_TO_MATTERMOST_DOCKER"/volumes/db/"$POSTGRES_OLD_VERSION" rm -rf "$PATH_TO_MATTERMOST_DOCKER"/volumes/db/var -mkdir -p "$PATH_TO_MATTERMOST_DOCKER"/volumes/db/$POSTGRES_NEW_VERSION/data +mkdir -p "$PATH_TO_MATTERMOST_DOCKER"/volumes/db/"$POSTGRES_NEW_VERSION"/data sed -i "s/$POSTGRES_OLD_DOCKER_FROM/$POSTGRES_NEW_DOCKER_FROM/" "$PATH_TO_MATTERMOST_DOCKER"/db/Dockerfile @@ -185,7 +185,7 @@ docker run --rm \ tianon/postgres-upgrade:"$POSTGRES_UPGRADE_LINE" \ --link -cp -p "$PATH_TO_MATTERMOST_DOCKER"/volumes/db/"$POSTGRES_OLD_VERSION"/data/pg_hba.conf "$PATH_TO_MATTERMOST_DOCKER"/volumes/db/$POSTGRES_NEW_VERSION/data/ +cp -p "$PATH_TO_MATTERMOST_DOCKER"/volumes/db/"$POSTGRES_OLD_VERSION"/data/pg_hba.conf "$PATH_TO_MATTERMOST_DOCKER"/volumes/db/"$POSTGRES_NEW_VERSION"/data/ # rebuild the containers docker-compose build From ec3f858cbf3a09628c2380e3ee47552fc84dbb80 Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Fri, 16 May 2025 13:17:05 +0200 Subject: [PATCH 3/3] Add badge --- .github/workflows/shellcheck.yml | 2 +- README.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 0331383..44745cc 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -15,4 +15,4 @@ jobs: - name: Run ShellCheck uses: ludeeus/action-shellcheck@master with: - scandir: './scripts' \ No newline at end of file + scandir: './scripts' diff --git a/README.md b/README.md index d6bbfba..b82b32f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # Mattermost Docker +[![ShellCheck](https://github.com/mattermost/docker/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/mattermost/docker/actions/workflows/shellcheck.yml) + The official Docker deployment solution for Mattermost. ## Install & Usage