-
Notifications
You must be signed in to change notification settings - Fork 265
Add Docker deployment test workflow #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c4f612a
Migrate from CircleCI to GitHub Actions
hanzei 7ee5da4
Fix ShellCheck issues in upgrade-postgres.sh
hanzei 0f6a992
Add Docker deployment test workflow
hanzei d3bfab3
Remove app logs check from Docker test workflow
hanzei 48660b3
Fix Docker test workflow
hanzei bb89679
Simplify Docker test workflow to only test without NGINX
hanzei aa811e1
Add API accessibility check to Docker test workflow
hanzei 7e0cc85
Add Docker Compose validation job to workflow
hanzei fdf3288
Add Docker Test workflow badge to README
hanzei 157e8f0
Update readme
hanzei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| 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() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have an
upcommand with nginx?There was a problem hiding this comment.
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.