From 26c489479326c1c799d4759c4dcbcfe379d4e5b1 Mon Sep 17 00:00:00 2001 From: Natalie Lunbeck Date: Tue, 20 Feb 2024 11:57:59 -0500 Subject: [PATCH] chore: Merge `master` into `with-doom` (#14) * Update shipyard orb version on circleci config The new version adds support for applications. * feat: add `fetch-shipyard-env` gh workflow Added new Github Action workflow to retrieve Shipyard's vars and print them * use version 3.8, before --> init swap (#10) * feat: Use new integrate-shipyard action (#11) * chore: Update Makefile to Compose v2 (#13) --------- Co-authored-by: Rogerio Shieh Barbosa <40327446+rogerioshieh@users.noreply.github.com> Co-authored-by: Peter Valdez Co-authored-by: Akshay K Co-authored-by: Oscar Romero --- .circleci/config.yml | 2 +- .github/workflows/print-env-data.yml | 20 ++++++++++++++++++++ Makefile | 22 +++++++++++----------- docker-compose.yaml | 4 ++-- 4 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/print-env-data.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index f13dfc9..02fc5ca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ version: '2.1' orbs: - shipyard: shipyard/shipyard@3.0.0 + shipyard: shipyard/shipyard@3.1.0 jobs: print-env-data: machine: diff --git a/.github/workflows/print-env-data.yml b/.github/workflows/print-env-data.yml new file mode 100644 index 0000000..177854e --- /dev/null +++ b/.github/workflows/print-env-data.yml @@ -0,0 +1,20 @@ +on: [push] + +jobs: + print-env-data: + runs-on: ubuntu-latest + name: Fetch Shipyard Vars + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Integrate Shipyard + uses: shipyard/shipyard-action@1.0.0 + with: + api-token: ${{ secrets.SHIPYARD_API_TOKEN }} + timeout-minutes: "10" + - name: Print Env Data + run: | + export CYPRESS_BASE_URL=${SHIPYARD_ENVIRONMENT_URL} + export CYPRESS_BYPASS_TOKEN=${SHIPYARD_BYPASS_TOKEN} + env | grep -e SHIPYARD -e CYPRESS + shell: bash diff --git a/Makefile b/Makefile index 6b954a9..23ff3fe 100644 --- a/Makefile +++ b/Makefile @@ -3,42 +3,42 @@ VOLUME=$(shell basename $(PWD)) develop: clean build migrations.upgrade run clean: - docker-compose rm -vf + docker compose rm -vf build: - docker-compose build + docker compose build run: - docker-compose up + docker compose up shell: - docker-compose run worker \ + docker compose run worker \ sh python-shell: - docker-compose run worker \ + docker compose run worker \ poetry run flask shell postgres.data.delete: clean docker volume rm $(VOLUME)_postgres postgres.start: - docker-compose up -d postgres - docker-compose exec postgres \ + docker compose up -d postgres + docker compose exec postgres \ sh -c 'while ! nc -z postgres 5432; do sleep 0.1; done' migrations.blank: postgres.start - docker-compose run worker \ + docker compose run worker \ poetry run flask db revision migrations.create: postgres.start - docker-compose run worker \ + docker compose run worker \ poetry run flask db migrate migrations.upgrade: postgres.start - docker-compose run worker \ + docker compose run worker \ poetry run flask db upgrade migrations.heads: postgres.start - docker-compose run worker \ + docker compose run worker \ poetry run flask db heads diff --git a/docker-compose.yaml b/docker-compose.yaml index e934f81..2f8829e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,4 +1,4 @@ -version: '3' +version: '3.8' services: @@ -28,7 +28,7 @@ services: worker: labels: - shipyard.before: 'poetry run flask db upgrade' + shipyard.init: 'poetry run flask db upgrade' build: '.' environment: DATABASE_URL: 'postgres://obscure-user:obscure-password@postgres/app'