diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml new file mode 100644 index 0000000..c7769fe --- /dev/null +++ b/.github/workflows/build-and-push.yml @@ -0,0 +1,24 @@ +name: Build and push container images to Quay.io registry +on: + push: + branches: + - master + schedule: + - cron: '0 1 * * 3' + +jobs: + build-and-push: + if: github.repository_owner == 'sclorg' + runs-on: ubuntu-latest + steps: + - name: Build and push daily-tests image to quay.io registry + uses: sclorg/build-and-push-action@v4 + with: + registry: "quay.io" + registry_namespace: "sclorg" + registry_username: ${{ secrets[QUAY_IMAGE_SCLORG_BUILDER_USERNAME] }} + registry_token: ${{ secrets[QUAY_IMAGE_SCLORG_BUILDER_TOKEN] }} + dockerfile: Dockerfile.daily-tests + tag: "daily-tests:0.1.0" + image_name: "upstream-daily-tests" + quay_application_token: ${{ secrets.QUAY_IMAGE_SCLORG_UPDATE_DESC }} diff --git a/Dockerfile.daily-tests b/Dockerfile.daily-tests new file mode 100644 index 0000000..17dd6db --- /dev/null +++ b/Dockerfile.daily-tests @@ -0,0 +1,39 @@ +FROM quay.io/fedora/fedora:42 + +ENV WORK_DIR="/var/tmp" \ + VERSION="42" \ + RELEASE="0.1.0" \ + DOWNSTREAM_TMT_DIR="sclorg-tmt-plans" \ + CI_REPO="https://github.com/sclorg/ci-scripts" \ + CI_REPO_NAME="ci-scripts" \ + UPSTREAM_TMT_REPO="https://github.com/sclorg/sclorg-testing-farm" \ + UPSTREAM_TMT_DIR="sclorg-testing-farm" \ + HOME="/home/nightly" \ + SUMMARY="Daily tests for SCL org projects" \ + DESCRIPTION="This image is used to run daily tests for SCL org projects in CI." \ + NAME="nightly" + +ENV LANG=en_US.UTF-8 + +LABEL summary="${SUMMARY}" \ + description="${DESCRIPTION}" \ + io.k8s.description="${DESCRIPTION}" \ + io.k8s.display-name="SCL org Daily Tests" \ + io.k8s.vendor="SCL org" \ + architecture="x86_64" + +COPY requirements.sh "${WORK_DIR}/requirements.sh" +RUN bash "${WORK_DIR}/requirements.sh" + +RUN dnf install -y python3.13-pip git && \ + dnf clean all + +RUN git clone "${CI_REPO}" "${CI_REPO_NAME}" && \ + git clone "${UPSTREAM_TMT_REPO}" "${WORK_DIR}/${UPSTREAM_TMT_DIR}" + +COPY . /ci-scripts +WORKDIR "${HOME}" + +USER 500 + +CMD ["/ci-scripts/run_nightly_tests.sh"] diff --git a/Makefile b/Makefile index 61c0de0..c4c98b9 100644 --- a/Makefile +++ b/Makefile @@ -7,5 +7,4 @@ shellcheck: ./run-shellcheck.sh `git ls-files *.sh` build_images: - podman build -t quay.io/sclorg/daily-tests:latest -f Dockerfile.daily-tests . - podman build -t quay.io/sclorg/daily-reports:latest -f Dockerfile.daily-reports . + podman build -t quay.io/sclorg/upstream-daily-tests:latest -f Dockerfile.daily-tests . diff --git a/requirements.sh b/requirements.sh new file mode 100755 index 0000000..184a4ad --- /dev/null +++ b/requirements.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -ex + +useradd -u 500 -r -g 0 -m -s /bin/bash -c "Default Application User" "${NAME}" +chown -R 500:0 "${HOME}" +chmod -R a+rwx "${HOME}"