From 19adf2016adc553eb67a7dc8d9d4ac577359b8cf Mon Sep 17 00:00:00 2001 From: ttuovinen Date: Fri, 19 Jan 2024 09:45:55 +0200 Subject: [PATCH] Configure testing pipeline (and remove admin ui build) - Temporarily disable docker builds and pushes - Disable Codecov (at least for now) --- .github/workflows/test-build.yml | 13 +++-- api/admin/config.py | 2 +- docker/Dockerfile | 10 +--- docker/Dockerfile.admin | 83 -------------------------------- 4 files changed, 11 insertions(+), 97 deletions(-) delete mode 100755 docker/Dockerfile.admin diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 701c46cbf..8f7f220eb 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.10", "3.11"] module: [Api, Core] # We want to run on external PRs, but not on our own internal PRs as they'll be run @@ -56,6 +56,7 @@ jobs: MODULE: ${{ matrix.module }} - name: Upload coverage to Codecov + if: false # Disable temporarily uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -84,7 +85,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.10" - name: Install Apt Packages run: | @@ -104,6 +105,7 @@ jobs: run: tox -e "migration-docker" - name: Upload coverage to Codecov + if: false # Disable temporarily uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -119,7 +121,8 @@ jobs: # Only build docker containers on a push event. Otherwise, we won't have # permissions to push the built containers into registry. - if: github.event_name == 'push' + # if: github.event_name == 'push' + if: false # Disable temporarily outputs: baseimage-changed: ${{ steps.changes.outputs.baseimage }} @@ -231,6 +234,7 @@ jobs: BASE_IMAGE=${{ steps.baseimage.outputs.tag }} docker-image-test: + if: false # Disable temporarily name: Docker test circ-${{ matrix.image }} (${{ matrix.platform }}) runs-on: ubuntu-latest needs: [docker-image-build] @@ -301,6 +305,7 @@ jobs: run: docker stop test_container docker-image-push: + if: false # Disable temporarily name: Push circ-${{ matrix.image }} runs-on: ubuntu-latest needs: [test, test-migrations, docker-image-build, docker-image-test] @@ -331,7 +336,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: "3.10" - name: Install Poetry uses: ./.github/actions/poetry diff --git a/api/admin/config.py b/api/admin/config.py index b20b987a2..4d4f60337 100644 --- a/api/admin/config.py +++ b/api/admin/config.py @@ -17,7 +17,7 @@ class OperationalMode(str, Enum): class Configuration(LoggerMixin): APP_NAME = "E-kirjasto Collection Manager" PACKAGE_NAME = "@natlibfi/ekirjasto-circulation-admin" - PACKAGE_VERSION = "1.11.0" + PACKAGE_VERSION = "0.0.1" STATIC_ASSETS = { "admin_js": "circulation-admin.js", diff --git a/docker/Dockerfile b/docker/Dockerfile index 4a47975a3..f83c39bd2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -66,20 +66,13 @@ ENV TZ=Europe/Helsinki # Setup nginx COPY docker/services/nginx /etc/nginx/ -COPY docker/admin_dist.tar.gz /mnt/admin_dist.tar.gz # Setup uwsgi COPY docker/services/uwsgi /etc/ RUN mkdir -p /var/log/uwsgi && \ chown -RHh simplified:simplified /var/log/uwsgi && \ mkdir /var/run/uwsgi && \ - chown simplified:simplified /var/run/uwsgi && \ - cd /var/www/circulation/api/admin && \ - tar xf /mnt/admin_dist.tar.gz && \ - chown -R simplified:simplified dist && \ - rm /mnt/admin_dist.tar.gz - -COPY --chown=simplified:simplified docker/config.py_admin /var/www/circulation/api/admin/config.py + chown simplified:simplified /var/run/uwsgi # Setup runit COPY docker/runit /etc/service/ @@ -89,4 +82,3 @@ WORKDIR /home/simplified/circulation EXPOSE 80 CMD ["/sbin/my_init"] - diff --git a/docker/Dockerfile.admin b/docker/Dockerfile.admin deleted file mode 100755 index a1359b9cc..000000000 --- a/docker/Dockerfile.admin +++ /dev/null @@ -1,83 +0,0 @@ -FROM ubuntu:22.04 as admin - -LABEL maintainer="Joe Random " - -ARG BUILDENV=devz - -#RUN if [ "${BUILDENV}" != "lfapi" -a "${BUILDENV}" != "lsstest" -a "${BUILDENV}" != "lfapi2" -a "${BUILDENV}" != "ltstest" -a "${BUILDENV}" != "prod" ]; \ -# then exit 1 ; \ -# fi - -RUN sed -i 's/http:\/\/archive\.ubuntu\.com\/ubuntu/http:\/\/mirrors.nic.funet.fi\/ubuntu\//' \ - /etc/apt/sources.list - -ENV DEBIAN_FRONTEND noninteractive -ENV TERM linux - -#ENV TINI_VERSION v0.19.0 -#ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini - -RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \ - apt-utils \ - apt-transport-https \ - ca-certificates \ - curl \ - debconf-utils \ - gnupg \ - gzip \ - net-tools \ - software-properties-common \ - tar \ - telnet \ - tzdata \ - wget && \ - mkdir -p /etc/apt/keyrings && \ - curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ - echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | \ - tee /etc/apt/sources.list.d/nodesource.list && \ - echo Europe/Helsinki >/etc/timezone && \ - ln -sf /usr/share/zoneinfo/Europe/Helsinki /etc/localtime && \ - dpkg-reconfigure -f noninteractive tzdata && \ - apt-get update && apt-get install -y --allow-unauthenticated --no-install-recommends \ - less \ - nodejs && \ - npm update -g npm && \ - rm -f /etc/cron.daily/* && \ - rm -rf /var/lib/apt/lists/* && \ - groupadd -g 1000 node && \ - useradd -u 1000 -r -g node -d /home/node -s /bin/bash -c "Node image user" node && \ - apt-get remove -y \ - apt-transport-https \ - apt-utils \ - debconf-utils \ - gnupg \ - software-properties-common \ - wget && \ - apt-get autoremove -y - -COPY palace_circulation_admin_ui /opt/circulation/admin - -RUN cd /opt/circulation/admin && \ - npm install && \ - npm run test-finland && \ - retval=$? && \ - if [ $retval -ne 0 ]; then \ - echo "Admin UI test failed" && \ - exit $retval ; \ - fi && \ - mkdir -p /mnt/tarball && \ - tar czvf /mnt/tarball/admin_dist.tar.gz dist - -# Specify the port number the container should expose -#EXPOSE 8080 - -# Set up working dir -#WORKDIR /opt/circulation/admin - -# Entrypoint is run prior to CMD -#ENTRYPOINT ["/tini", "--"] - -# Actual command to start, can be overridden to start e.g. ASR API -#CMD ["npm", "run", "dev-server", "--", "--env=backend=webapp:6500"] - -