Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Docker Test

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
validate-compose-files:
name: Validate Docker Compose Files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup environment file
run: |
cp env.example .env

- name: Validate base docker-compose file
run: docker compose config

- name: Validate docker-compose with NGINX
run: |
docker compose -f docker-compose.yml -f docker-compose.nginx.yml config

- name: Validate docker-compose without NGINX
run: docker compose -f docker-compose.yml -f docker-compose.without-nginx.yml config

test-docker-deployment:
name: Test Docker Deployment
runs-on: ubuntu-latest
needs: validate-compose-files
steps:
- uses: actions/checkout@v3

- name: Create required directories
run: |
mkdir -p ./volumes/app/mattermost/{config,data,logs,plugins,client/plugins,bleve-indexes}
sudo chown -R 2000:2000 ./volumes/app/mattermost

- name: Setup environment file
run: |
cp env.example .env
sed -i 's/DOMAIN=mm.example.com/DOMAIN=localhost/g' .env

- name: Start Mattermost without NGINX

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have an up command with nginx?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1/5 of the automated testing this PR adds is already a great step forward. I'm hesitant to add another layer of complexity by also testing the nginx setup.

run: |
# Configure docker-compose to use without-nginx setup
docker compose -f docker-compose.yml -f docker-compose.without-nginx.yml up -d

- name: Verify containers are running
run: |
# Allow time for containers to start
sleep 30
docker ps
docker compose ps

- name: Check container logs
run: |
# Check logs for any issues
docker compose logs mattermost --tail 20
docker compose logs postgres --tail 20

- name: Verify Mattermost API is accessible
run: |
# Check that API is responding
curl -f --retry 10 --retry-delay 5 --retry-connrefused http://localhost:8065/api/v4/system/ping || exit 1

- name: Stop containers
run: |
# Clean up containers
docker compose down
if: always()
6 changes: 3 additions & 3 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: ShellCheck

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
shellcheck:
Expand All @@ -15,4 +15,4 @@ jobs:
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
scandir: './scripts'
scandir: "./scripts"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +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)
[![Docker Test](https://github.com/mattermost/docker/actions/workflows/docker-test.yml/badge.svg)](https://github.com/mattermost/docker/actions/workflows/docker-test.yml)

The official Docker deployment solution for Mattermost.

Expand Down