This repository has been archived by the owner on Aug 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Basis of Deployment Pipeline Workflow; Update to Python 3.9 (#345)
* Fix container startup This change ensures that everything is ready to run `make test` * Delete obsolete Travis config * Delete obsolete pytest config * Upgrade to Python 3.9 * Fix open file warnings in DonationMailGenerator * Add GitHub Actions extension to dev container * Separate dev and prod requirements * Add lint target to run autopep8 * Add initial deployment pipeline workflow * Add lint-check, lint-fix * Add workflow dispatch trigger to deployment workflow * Fix rabbitmq container options * Collapse rabbitmq volumes * Use absolute path for volumes * Install RabbitMQ certs out of workspace * Fix configuration volume pathname * Use sudo to copy RabbitMQ files * Set RabbitMQ container name * Set environment variables for steps * Enable debug * Define CSRF_TRUSTED_ORIGINS * Define missing variables * Add optional DB_PASSWORD for local * Set DB_PASSWORD * Use random SECRET_KEY * Refactor install, env, codespace targets * Enable pip caching * Add autopep8 to requirements-dev * Use consistent line length for autopep8, ruff * Fix autopep8 issues * Add ruff to requirements-dev * Differentiate between formatting and linting * Fix ruff issues * Expose RabbitMQ TLS port * Set CLOUDAMQP_URL * Expose RabbitMQ TCP and TLS * Revert "Set CLOUDAMQP_URL" This reverts commit 55b17c0. * Synchronize PostgreSQL settings * Drop unnecessary variables * Setup RabbitMQ without container * Include RabbitMQ config file * Don't detach server * Copy certs to config directory * Use Actions-specific RabbitMQ conf * Revert "Use Actions-specific RabbitMQ conf" This reverts commit 51049de. * Use local config file * Stop automatically started RabbitMQ instance * Revert "Don't detach server" This reverts commit eeb3ec4. * Use rabbitmq-github-actions * Use configuration file for pep8 * Restore unique autopep8 settings * Set autopep8 aggressive = 3 * Revert "Set autopep8 aggressive = 3" This reverts commit 62f9cf4. * Revert to line length 79 * Fix setup syntax error * Extract email bodies to static files * Disable debug * Read email bodies as text, not binary
- Loading branch information
1 parent
ea14fbd
commit eaa6e53
Showing
40 changed files
with
490 additions
and
162 deletions.
There are no files selected for viewing
This file contains 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 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 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,72 @@ | ||
name: Deployment | ||
|
||
on: | ||
- push | ||
- workflow_dispatch | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
commit: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
ADMIN: NAME,[email protected] | ||
ALLOWED_HOSTS: localhost,0.0.0.0,127.0.0.1 | ||
CELERY_RESULT_BACKEND: "rpc://" | ||
CSRF_TRUSTED_ORIGINS: "" | ||
DB_NAME: reboot | ||
DB_USER: root | ||
DB_PASSWORD: ${{ github.run_id }}-${{ github.run_attempt }} | ||
DEBUG: False | ||
DJANGO_DATABASE: local | ||
EMAIL_HOST: smtp.gmail.com | ||
EMAIL_HOST_USER: "" | ||
EMAIL_HOST_PASSWORD: "" | ||
SECRET_KEY: ${{ github.run_id }}-${{ github.run_attempt }} | ||
SECURE_SSL_REDIRECT: False | ||
|
||
services: | ||
postgres: | ||
image: postgres:13 | ||
env: | ||
POSTGRES_USER: ${{ env.DB_USER }} | ||
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }} | ||
POSTGRES_DB: ${{ env.DB_NAME}} | ||
ports: | ||
- 5432:5432 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
|
||
steps: | ||
- name: Checkout the Git repository | ||
uses: actions/checkout@v3 | ||
- name: Set up RabbitMQ 3.12 | ||
uses: namoshek/rabbitmq-github-action@v1 | ||
with: | ||
version: "3.12" | ||
ports: "5671:5671 5672:5672" | ||
certificates: ${{ github.workspace }}/dev/ssl/cert | ||
config: ${{ github.workspace }}/rabbitmq-actions.conf | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.9" | ||
cache: "pip" | ||
cache-dependency-path: | | ||
./requirements-dev.txt | ||
./requirements.txt | ||
- name: Install dependencies | ||
run: | | ||
make install | ||
- name: Format with autopep8 | ||
run: | | ||
make format-check | ||
- name: Lint with ruff | ||
run: | | ||
make lint-check | ||
- name: Test with unittest | ||
run: | | ||
make celery & | ||
make test | ||
make coverage |
This file contains 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 |
---|---|---|
|
@@ -117,3 +117,6 @@ venv.bak/ | |
|
||
# DB stuff | ||
db.sqlite3 | ||
|
||
# Dev Container | ||
nohup.out |
This file was deleted.
Oops, something went wrong.
This file contains 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 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 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 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 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 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 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 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
Oops, something went wrong.