From d5820f15a1318bf666e437f369ea6bc9ae023e78 Mon Sep 17 00:00:00 2001 From: Dan Coates Date: Mon, 25 Mar 2024 15:34:29 +1100 Subject: [PATCH] switch from generating openapi client to pulling it in from branch --- .github/workflows/client-freeze-test.yaml | 32 +++++++++++++++++++++++ .github/workflows/deploy.yaml | 15 +++++++++++ regenerate_api.py | 7 ----- 3 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/client-freeze-test.yaml diff --git a/.github/workflows/client-freeze-test.yaml b/.github/workflows/client-freeze-test.yaml new file mode 100644 index 000000000..c31ca072a --- /dev/null +++ b/.github/workflows/client-freeze-test.yaml @@ -0,0 +1,32 @@ +name: Client freeze test +on: push + +jobs: + client-freeze-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/checkout@master + with: + name: populationgenomics/metamist + ref: refs/b142392 + path: metamist-legacy-client + + - name: "Copy python api files" + run: | + cp -R metamist-legacy-client/api/ metamist/api/ + cp -R metamist-legacy-client/metamist/api/ metamist/api/ + cp -R metamist-legacy-client/metamist/apis/ metamist/apis/ + cp -R metamist-legacy-client/metamist/model/ metamist/model/ + cp -R metamist-legacy-client/metamist/models/ metamist/models/ + cp metamist-legacy-client/metamist/*.py metamist/ + + - name: "List" + run: | + ls -la metamist + ls -la metamist/api + ls -la metamist/apis + ls -la metamist/models + ls -la metamist/model diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 688b0ce1b..091b63749 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -81,6 +81,21 @@ jobs: -f deploy/api/Dockerfile \ . + - uses: actions/checkout@master + with: + name: populationgenomics/metamist + ref: refs/b142392 + path: metamist-legacy-client + + - name: "Copy python api files" + run: | + cp -R metamist-legacy-client/api/ metamist/api/ + cp -R metamist-legacy-client/metamist/api/ metamist/api/ + cp -R metamist-legacy-client/metamist/apis/ metamist/apis/ + cp -R metamist-legacy-client/metamist/model/ metamist/model/ + cp -R metamist-legacy-client/metamist/models/ metamist/models/ + cp metamist-legacy-client/metamist/*.py metamist/ + - name: "build deployable API" run: | export OPENAPI_COMMAND="java -jar openapi-generator-cli.jar" diff --git a/regenerate_api.py b/regenerate_api.py index 296135bb1..bfdacbae4 100755 --- a/regenerate_api.py +++ b/regenerate_api.py @@ -344,13 +344,6 @@ def main(): try: assert_server_is_accessible() - # Generate the installable Python API - generate_api_and_copy( - 'python', - copy_python_files_from, - ['--template-dir', 'openapi-templates'], - ) - # Generate the Typescript API for React application generate_api_and_copy( 'typescript-axios',