From 3a24facd062afc040296822871276344d13ab048 Mon Sep 17 00:00:00 2001 From: Erin Young Date: Mon, 11 Dec 2023 15:16:25 -0700 Subject: [PATCH] adding pango-collapse --- .github/workflows/update_pango-collapse.yml | 69 +++++++++++++++++++++ pango-collapse/Dockerfile | 37 +++++++++++ 2 files changed, 106 insertions(+) create mode 100644 .github/workflows/update_pango-collapse.yml create mode 100644 pango-collapse/Dockerfile diff --git a/.github/workflows/update_pango-collapse.yml b/.github/workflows/update_pango-collapse.yml new file mode 100644 index 0000000..f107721 --- /dev/null +++ b/.github/workflows/update_pango-collapse.yml @@ -0,0 +1,69 @@ +name: Update pango-collapse + +on: + workflow_dispatch: + schedule: + - cron: '30 5 * * TUE' + +run-name: Updating pango-collapse + +jobs: + update: + runs-on: ubuntu-latest + steps: + - name: Get latest release + uses: rez0n/actions-github-release@main + id: latest_release + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: MDU-PHL/pango-collapse + type: "stable" + + - uses: actions/checkout@v3 + + - name: Remove V + id: strip + run: | + version=$(echo "${{ steps.latest_release.outputs.release }}" | sed 's/V//g' | sed 's/v//g' ) + echo "The version is $version" + echo "version=$version" >> $GITHUB_OUTPUT + + - name: pull repo + uses: actions/checkout@v3 + + - name: Get current date + id: date + run: | + date=$(date '+%Y-%m-%d') + echo "the date is $date" + echo "date=$date" >> $GITHUB_OUTPUT + + - name: check paths + run: ls && ls ./pango-collapse + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Quay + uses: docker/login-action@v2 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Build and push to Quay + uses: docker/build-push-action@v3 + with: + file: ./pango-collapse/Dockerfile + build-args: VER=${{ steps.strip.outputs.version }} + push: true + tags: quay.io/uphl/pango-collapse:${{ steps.strip.outputs.version }}-${{ steps.date.outputs.date }} + + - name: Build and push latest tag to Quay + uses: docker/build-push-action@v3 + with: + file: ./pango-collapse/Dockerfile + build-args: VER=${{ steps.strip.outputs.version }} + push: true + tags: quay.io/uphl/pango-collapse:latest diff --git a/pango-collapse/Dockerfile b/pango-collapse/Dockerfile new file mode 100644 index 0000000..2ffade3 --- /dev/null +++ b/pango-collapse/Dockerfile @@ -0,0 +1,37 @@ +FROM python:3.9.17-slim as app + +# List all software versions are ARGs near the top of the dockerfile +# 'ARG' sets environment variables during the build stage +# ARG variables are ONLY available during image build, they do not persist in the final image +ARG VER="0.7.2" + +# 'LABEL' instructions tag the image with metadata that might be important to the user +LABEL base.image="python:3.9.17-slim" +LABEL dockerfile.version="1" +LABEL software="pango-collapse" +LABEL software.version="${VER}" +LABEL description="collapse lineages up to the first user defined parent lineage" +LABEL website="https://github.com/MDU-PHL/pango-collapse" +LABEL license="https://github.com/MDU-PHL/pango-collapse?tab=GPL-3.0-1-ov-file#readme" +LABEL maintainer="Erin Young" +LABEL maintainer.email="eriny@utah.gov" + +# 'RUN' executes code during the build +# Install dependencies via apt-get or yum if using a centos or fedora base +RUN apt-get update && apt-get install -y --no-install-recommends \ + procps \ + ca-certificates && \ + apt-get autoclean && rm -rf /var/lib/apt/lists/* + +# Install and/or setup more things. Make /data for use as a working dir +# For readability, limit one install per 'RUN' statement. +RUN pip install --no-cache pango-collapse==${VER} && pango-collapse --help + +ENV PATH="$PATH" \ + LC_ALL=C + +# 'CMD' instructions set a default command when the container is run. This is typically 'tool --help.' +CMD pango-collapse --help + +# 'WORKDIR' sets working directory +WORKDIR /data