-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
90 changed files
with
32,153 additions
and
10,598 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: CD process | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
jobs: | ||
|
||
deploy: | ||
name: Deploy | ||
environment: PROD | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Executing remote ssh commands using ssh key | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_KEY }} | ||
passphrase: ${{ secrets.SSH_PASSPHRASE }} | ||
port: 22 | ||
script: | | ||
cd /opt/MpoxRadar/ | ||
sudo git checkout dev | ||
sudo git pull | ||
- name: Restart the application after deployment | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_KEY }} | ||
passphrase: ${{ secrets.SSH_PASSPHRASE }} | ||
port: 22 | ||
script: | | ||
sudo mpoxradar.reload\&restart.everything.sh |
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,56 @@ | ||
# .github/workflows/tests.yml | ||
name: CI-CD process | ||
on: push | ||
jobs: | ||
continuous-integration: | ||
runs-on: ubuntu-latest | ||
env: | ||
DB_DATABASE: mpx | ||
DB_USERNAME: root | ||
DB_PASSWORD: password | ||
DB_HOST: 127.0.0.1 | ||
DB_PORT: 3306 | ||
REDIS_PORT: 6379 | ||
BROADCAST_DRIVER: log | ||
CACHE_DRIVER: redis | ||
QUEUE_CONNECTION: redis | ||
SESSION_DRIVER: redis | ||
MYSQL_ALLOW_EMPTY_PASSWORD: false | ||
MYSQL_ROOT_PASSWORD: password | ||
MYSQL_DATABASE: mpx | ||
services: | ||
mariadb: | ||
image: mariadb:10.11 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.10 | ||
architecture: x64 | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: 3.10 | ||
mamba-version: "*" | ||
activate-environment: covsonar | ||
channels: conda-forge,bioconda,defaults | ||
channel-priority: true | ||
|
||
# mariadb | ||
- uses: shogo82148/actions-setup-mysql@v1 | ||
with: | ||
distribution: 'mariadb' | ||
mysql-version: '10.11' | ||
user: "user-test" | ||
password: "123456" | ||
|
||
# redis-server | ||
- uses: shogo82148/actions-setup-mysql@v1 | ||
with: | ||
distribution: 'mariadb' | ||
mysql-version: '10.11' | ||
user: "user-test" | ||
password: "123456" | ||
|
||
- run: pip install poetry | ||
- run: poetry install |
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,65 @@ | ||
# .github/workflows/tests.yml | ||
name: Test-format-flake8 | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
jobs: | ||
testing: | ||
runs-on: ubuntu-latest | ||
services: | ||
redis: | ||
image: redis | ||
ports: | ||
- 6379:6379 | ||
mariadb: | ||
image: mariadb:10.11 | ||
env: | ||
MYSQL_ROOT_PASSWORD: password | ||
MYSQL_DATABASE: mpx_test_04 | ||
MYSQL_USER: test_user | ||
MYSQL_PASSWORD: test_password | ||
ports: | ||
- 3306:3306 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.10' | ||
- name: Install dependencies | ||
run: | | ||
sudo apt install libmariadb3 libmariadb-dev | ||
pip install poetry | ||
- name: Poetry install env. | ||
run: poetry install | ||
- name: Load database | ||
run: | | ||
mysql --protocol=tcp -h localhost --user=root --password=password -e "CREATE DATABASE IF NOT EXISTS mpx_test_04;" | ||
mysql --protocol=tcp -h localhost --user=root --password=password -e "GRANT ALL PRIVILEGES ON mpx_test_04.* TO 'test_user'@'%' IDENTIFIED BY 'test_password';" | ||
mysql --protocol=tcp -h localhost --user=root --password=password mpx_test_04 < tests/sql_dumps/mpx_test_04.sql | ||
mysql --protocol=tcp -h localhost --user=root --password=password -e "use mpx_test_04; SHOW TABLES;" | ||
- name: Run pytest | ||
env: | ||
DB_URL: "https://test_user:[email protected]:3306/mpx_test_04" | ||
REDIS_URL: "redis://127.0.0.1:6379" | ||
REDIS_DB_BROKER: 1 | ||
REDIS_DB_BACKEND: 1 | ||
DEBUG: True | ||
LOG_LEVEL: "DEBUG" | ||
run: poetry run pytest -rfeP -x tests/ | ||
format-checker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.10' | ||
- name: Install dependencies | ||
run: pip install flake8 poetry | ||
- name: Run flake8 - Code style check | ||
run: poetry run flake8 . --config=.flake8 -v |
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 |
---|---|---|
|
@@ -127,3 +127,7 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
.DS_Store | ||
.idea | ||
dump.rdb |
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.