diff --git a/.env.dist b/.env.dist index 075d6e9..e42ce9c 100644 --- a/.env.dist +++ b/.env.dist @@ -1,24 +1,23 @@ -APP_TITLE = "Mercury API Docs" -APP_DESCRIPTION = "This is the Swagger documentation of the Mercury API" -APP_VERSION = 1.0 -API_VERSION = "v1" +APP_TITLE="Mercury API Docs" +APP_DESCRIPTION="This is the Swagger documentation of the Mercury API" +APP_VERSION=1.0 +API_VERSION="v1" APP_ENV=local ## Admin Configuration -ADMIN_USERNAME = "admin" -ADMIN_EMAIL = "admin" -ADMIN_PASSWORD = "admin" +ADMIN_USERNAME="admin" +ADMIN_EMAIL="admin" +ADMIN_PASSWORD="admin" ## Postgres Configuration -POSTGRES_HOST_AUTH_METHOD = changeit -POSTGRES_PASSWORD = mercury -POSTGRES_HOST = mercury_db -POSTGRES_PORT = 5432 -POSTGRES_USER = mercury -POSTGRES_DB = mercury -POSTGRES_HOST_AUTH_METHOD = trust +POSTGRES_HOST=mercury_db +POSTGRES_PASSWORD=mercury +POSTGRES_PORT=5432 +POSTGRES_USER=mercury +POSTGRES_DB=mercury +POSTGRES_HOST_AUTH_METHOD=trust ## Redis Configuration -REDIS_HOST = mercury_cache -REDIS_PORT = 6379 +REDIS_HOST=mercury_cache +REDIS_PORT=6379 ## JWT Configuration -JWT_SECRET_KEY = "mysecretkey" -JWT_ALGORITHM = "HS256" -ACCESS_TOKEN_EXPIRE_MINUTES = 30 +JWT_SECRET_KEY="mysecretkey" +JWT_ALGORITHM="HS256" +ACCESS_TOKEN_EXPIRE_MINUTES=30 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f23e19b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..896d9df --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: + - main + - develop + pull_request: + branches: + - main + - develop + +jobs: + integration_test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create environment file + run: | + echo "POSTGRES_HOST=${{ secrets.POSTGRES_HOST }}" > .env + echo "POSTGRES_PORT=${{ secrets.POSTGRES_PORT }}" >> .env + echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> .env + echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> .env + echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env + + - name: Run integration tests + run: | + setsid ./ci/integration-test.sh + + unit_test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create environment file + run: | + echo "POSTGRES_HOST=${{ secrets.POSTGRES_HOST }}" > .env + echo "POSTGRES_PORT=${{ secrets.POSTGRES_PORT }}" >> .env + echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> .env + echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> .env + echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env + + - name: Run unit tests + run: | + setsid ./ci/unit-test.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..ee4e0e5 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,24 @@ +stages: + - test + +unit_test: + stage: test + script: + - setsid ./ci/unit-test.sh + only: + refs: + - /^(main|develop.*)$/ + - merge_requests + tags: + - imagesbuilder + +integration_test: + stage: test + script: + - setsid ./ci/integration-test.sh + only: + refs: + - /^(main|develop.*)$/ + - merge_requests + tags: + - imagesbuilder \ No newline at end of file diff --git a/ci/integration-test.sh b/ci/integration-test.sh new file mode 100755 index 0000000..f38e7d9 --- /dev/null +++ b/ci/integration-test.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +docker-compose up --build --abort-on-container-exit mercury_integration_tests \ No newline at end of file diff --git a/ci/unit-test.sh b/ci/unit-test.sh new file mode 100755 index 0000000..e67999c --- /dev/null +++ b/ci/unit-test.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +docker-compose up --build --abort-on-container-exit mercury_unit_tests diff --git a/src/assets/mercury-logo.png b/src/assets/mercury-logo.png index 85cdc40..9e89532 100644 Binary files a/src/assets/mercury-logo.png and b/src/assets/mercury-logo.png differ