From a2ee0521b85ea697cd9f5ac98f96fcf079e58659 Mon Sep 17 00:00:00 2001 From: 0ssigeno Date: Thu, 7 Dec 2023 10:17:26 +0100 Subject: [PATCH] Use atlas service Signed-off-by: 0ssigeno --- .github/actions/services/action.yml | 16 ++++++++++++++++ .github/workflows/_python.yml | 6 ++++++ .github/workflows/pull_request_automation.yml | 1 + actions/services/action.yml | 16 ++++++++++++++++ workflows/_python.yml | 6 ++++++ workflows/pull_request_automation.yml | 1 + 6 files changed, 46 insertions(+) diff --git a/.github/actions/services/action.yml b/.github/actions/services/action.yml index 63fe8f0..229c712 100644 --- a/.github/actions/services/action.yml +++ b/.github/actions/services/action.yml @@ -19,6 +19,10 @@ inputs: use_mongo: description: Use mongo service required: true + use_atlas: + description: Use atlas service + required: true + postgres_db: description: Postgres service db. Requires use_postgres to be true @@ -74,6 +78,18 @@ runs: shell: bash + - name: Create atlas local instance + if: inputs.use_atlas + run: | + apt-get install podman + curl https://fastdl.mongodb.org/mongocli/mongodb-atlas-cli_1.14.0_linux_x86_64.deb > /tmp/atlas_cli.deb + dpkg -i /tmp/atlas_cli.deb + rm /tmp/atlas_cli.deb + atlas deployments setup mongo --type local --force --skipMongosh --skipSampleData --tier M0 + shell: + bash + + - name: Create postgres docker-compose file if: inputs.use_postgres run: | diff --git a/.github/workflows/_python.yml b/.github/workflows/_python.yml index d24cd1b..07577fd 100644 --- a/.github/workflows/_python.yml +++ b/.github/workflows/_python.yml @@ -131,6 +131,11 @@ on: default: false type: boolean required: false + use_atlas: + description: Use atlas service + default: false + type: boolean + required: false use_celery: description: Create a celery worker default: false @@ -435,6 +440,7 @@ jobs: if: inputs.use_postgres || inputs.use_elastic_search || inputs.use_memcached || inputs.use_redis || inputs.use_rabbitmq || inputs.use_mongo with: use_mongo: ${{ inputs.use_mongo }} + use_atlas: ${{ inputs.use_atlas }} use_redis: ${{ inputs.use_redis }} use_postgres: ${{ inputs.use_postgres }} use_elastic_search: ${{ inputs.use_elastic_search }} diff --git a/.github/workflows/pull_request_automation.yml b/.github/workflows/pull_request_automation.yml index 46ac709..ef19867 100644 --- a/.github/workflows/pull_request_automation.yml +++ b/.github/workflows/pull_request_automation.yml @@ -81,6 +81,7 @@ jobs: use_rabbitmq: true use_mongo: false use_celery: true + use_atlas: true celery_app: python_test.celery celery_queues: default diff --git a/actions/services/action.yml b/actions/services/action.yml index 63fe8f0..229c712 100644 --- a/actions/services/action.yml +++ b/actions/services/action.yml @@ -19,6 +19,10 @@ inputs: use_mongo: description: Use mongo service required: true + use_atlas: + description: Use atlas service + required: true + postgres_db: description: Postgres service db. Requires use_postgres to be true @@ -74,6 +78,18 @@ runs: shell: bash + - name: Create atlas local instance + if: inputs.use_atlas + run: | + apt-get install podman + curl https://fastdl.mongodb.org/mongocli/mongodb-atlas-cli_1.14.0_linux_x86_64.deb > /tmp/atlas_cli.deb + dpkg -i /tmp/atlas_cli.deb + rm /tmp/atlas_cli.deb + atlas deployments setup mongo --type local --force --skipMongosh --skipSampleData --tier M0 + shell: + bash + + - name: Create postgres docker-compose file if: inputs.use_postgres run: | diff --git a/workflows/_python.yml b/workflows/_python.yml index d24cd1b..07577fd 100644 --- a/workflows/_python.yml +++ b/workflows/_python.yml @@ -131,6 +131,11 @@ on: default: false type: boolean required: false + use_atlas: + description: Use atlas service + default: false + type: boolean + required: false use_celery: description: Create a celery worker default: false @@ -435,6 +440,7 @@ jobs: if: inputs.use_postgres || inputs.use_elastic_search || inputs.use_memcached || inputs.use_redis || inputs.use_rabbitmq || inputs.use_mongo with: use_mongo: ${{ inputs.use_mongo }} + use_atlas: ${{ inputs.use_atlas }} use_redis: ${{ inputs.use_redis }} use_postgres: ${{ inputs.use_postgres }} use_elastic_search: ${{ inputs.use_elastic_search }} diff --git a/workflows/pull_request_automation.yml b/workflows/pull_request_automation.yml index 46ac709..ef19867 100644 --- a/workflows/pull_request_automation.yml +++ b/workflows/pull_request_automation.yml @@ -81,6 +81,7 @@ jobs: use_rabbitmq: true use_mongo: false use_celery: true + use_atlas: true celery_app: python_test.celery celery_queues: default