From 53e0082b98e6c50d3d91ae52e662209ef7ce4099 Mon Sep 17 00:00:00 2001 From: Pedro Brochado Date: Tue, 25 Jun 2024 14:48:13 -0300 Subject: [PATCH] Add update-data workflow --- .github/workflows/ostree-test.yml | 33 ++++++++++++++++++++++ .github/workflows/update-data.yml | 46 +++++++++++++++++++++++++++++++ Dockerfile | 12 ++++++++ 3 files changed, 91 insertions(+) create mode 100644 .github/workflows/ostree-test.yml create mode 100644 .github/workflows/update-data.yml create mode 100644 Dockerfile diff --git a/.github/workflows/ostree-test.yml b/.github/workflows/ostree-test.yml new file mode 100644 index 0000000..b23f80d --- /dev/null +++ b/.github/workflows/ostree-test.yml @@ -0,0 +1,33 @@ +name: "Ostree installation test" + +on: + workflow_dispatch: + +jobs: + update-data: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v4" + with: + ref: docs-data + + - name: "Set up Python" + uses: "actions/setup-python@v5" + with: + python-version: "3.11" + + - name: "Install System dependencies" + run: | + sudo apt install -y libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-4.0 + + - name: "Install Python dependencies" + run: | + pip install git+https://github.com/pedro-psb/pulp-docs@gen-and-store-api-json-in-pulp-docs + # python -m pulp_docs.openapi /tmp -l pulp_ostree + # python -m venv /tmp/myvenv + # /tmp/myvenv/bin/pip install pulpcore git+https://github.com/pulp/pulp_ostree + + # experiments with the deps to get it working + # - name: Setup tmate session + # uses: mxschmitt/action-tmate@v3 + diff --git a/.github/workflows/update-data.yml b/.github/workflows/update-data.yml new file mode 100644 index 0000000..6d3270d --- /dev/null +++ b/.github/workflows/update-data.yml @@ -0,0 +1,46 @@ +name: "Update Data Branch" + +on: + workflow_dispatch: + +jobs: + update-data: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v4" + with: + ref: docs-data + + - name: "Set up Python" + uses: "actions/setup-python@v5" + with: + python-version: "3.11" + + - name: "List requirements" + run: | + cat requirements_system.txt + cat requirements_python.txt + + - name: "Install System dependencies" + run: | + # xargs sudo apt -y install < requirements_system.txt + sudo apt -y install libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-4.0 python3-gi + # sudo apt -y install gobject-introspection # suggestion from stackoverflow + sudo apt -y install libglib2.0-dev + + - name: "Install Python dependencies" + run: | + pip install --upgrade pip + # pip install -r requirements_python.txt + pip install pycairo + pip install git+https://github.com/pulp/pulpcore + pip install git+https://github.com/pulp/pulp_ostree + pulpcore-manager openapi --component ostree --file /tmp/ostree-api.json + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + + # - name: "Generate, commit and push updated openapi specs" + # run: | + # python -m pulp_docs.openapi /tmp -l pulp_ostree + # ./update-data.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2d623ad --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM ubuntu:latest + +RUN apt-get -y update +RUN apt-get -y upgrade +RUN apt-get install -y libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-4.0 + +WORKDIR app + +COPY . . + +CMD ["alias", "python=python3"] +CMD ["./update-data.sh", "/tmp", "-l", "pulp_ostree"]