diff --git a/.gitea/workflows/build-release.yml b/.gitea/workflows/build-release.yml index e120d18..4b6c90c 100644 --- a/.gitea/workflows/build-release.yml +++ b/.gitea/workflows/build-release.yml @@ -13,12 +13,12 @@ jobs: working-directory: /home/builds/src/ansible-dev steps: - - name: "Checkout branch: ${{ env.GITHUB_REF_NAME }}" + - name: "Checkout Branch: ${{ env.GITHUB_REF_NAME }}" run: | git fetch origin ${{ env.GITHUB_REF_NAME }}:${{ env.GITHUB_REF_NAME }} git checkout ${{ env.GITHUB_REF_NAME }} - - name: Verify current commit + - name: Verify Current Commit run: git log -1 @@ -45,10 +45,10 @@ jobs: runs-on: self-hosted needs: [Build-Images] steps: - - name: Docker login + - name: Docker Login run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login --username ${{ secrets.REGISTRY_USER }} --password-stdin ${{ vars.REGISTRY }} - - name: Push images to registry + - name: Push Images to Registry run: | pwd docker push ${{ vars.REGISTRY }}/${{ env.GITHUB_REPOSITORY }}/${{ vars.BUILD_NAME_FEDORA }}:${{ env.GITHUB_REF_NAME }} @@ -59,7 +59,7 @@ jobs: runs-on: self-hosted needs: [Build-Images, Push-Images] steps: - - name: Cleanup build images + - name: Cleanup Build Images run: | pwd docker rmi ${{ vars.REGISTRY }}/${{ env.GITHUB_REPOSITORY }}/${{ vars.BUILD_NAME_FEDORA }}:${{ env.GITHUB_REF_NAME }} diff --git a/.gitea/workflows/build-test.yml b/.gitea/workflows/build-test.yml index 2bbb6b4..935e350 100644 --- a/.gitea/workflows/build-test.yml +++ b/.gitea/workflows/build-test.yml @@ -6,29 +6,29 @@ on: - testing jobs: - Cleanup-Old-Artifacts: + Clean-Stale-Artifacts: runs-on: self-hosted defaults: run: working-directory: /home/builds/src steps: - - name: Cleanup old code + - name: Cleanup Stale Artifacts run: rm -rfv * - - name: Cleanup old build cache + - name: Cleanup Build Cache run: docker system prune -af Check-Environment: runs-on: self-hosted - needs: [Cleanup-Old-Artifacts] + needs: [Clean-Stale-Artifacts] defaults: run: working-directory: /home/builds/src steps: - - name: Environment check + - name: Environment Check run: | echo "BUILD_USER: $(whoami)" && echo echo "PWD: $(pwd)" && echo @@ -46,13 +46,13 @@ jobs: working-directory: /home/builds/src steps: - - name: Clone repository + - name: Clone Repository run: | - git clone https://gitea.thezengarden.net/podman/ansible-dev.git + git clone ${{ vars.GITHUB_SERVER_URL }}/${{ vars.GITHUB_REPOSITORY }} cd ansible-dev git checkout ${{ env.GITHUB_REF_NAME }} - - name: Verify current commit + - name: Verify Current Commit run: cd ansible-dev && git log -1 @@ -79,10 +79,10 @@ jobs: runs-on: self-hosted needs: [Build-Images] steps: - - name: Docker login + - name: Docker Login run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login --username ${{ secrets.REGISTRY_USER }} --password-stdin ${{ vars.REGISTRY }} - - name: Push images to registry + - name: Push Images to Registry run: | pwd docker push ${{ vars.REGISTRY }}/${{ env.GITHUB_REPOSITORY }}/${{ vars.BUILD_NAME_FEDORA }}:${{ env.GITHUB_REF_NAME }} @@ -93,7 +93,7 @@ jobs: runs-on: self-hosted needs: [Build-Images, Push-Images] steps: - - name: Cleanup build images + - name: Cleanup Build Images run: | pwd docker rmi ${{ vars.REGISTRY }}/${{ env.GITHUB_REPOSITORY }}/${{ vars.BUILD_NAME_FEDORA }}:${{ env.GITHUB_REF_NAME }} @@ -104,5 +104,5 @@ jobs: runs-on: self-hosted needs: [Push-Images] steps: - - name: Cleanup Docker login + - name: Cleanup Docker Login run: rm -v /home/builds/.docker/config.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..ddaaa16 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +Build Status: ![Build status](https://gitea.thezengarden.net/podman/ansible-dev/actions/workflows/build-test.yml/badge.svg?branch=testing&style=flat) + +This provides the framework for testing in our environment. diff --git a/build/Containerfile.centos b/build/Containerfile.centos index 5002972..9c40c95 100644 --- a/build/Containerfile.centos +++ b/build/Containerfile.centos @@ -8,7 +8,7 @@ RUN mkdir -p /root/.ssh COPY conf/ssh_config /root/.ssh/config COPY conf/hosts /etc/hosts COPY conf/dnf.conf /etc/dnf/dnf.conf -COPY python/requirements.txt /tmp/requirements.txt +COPY python/requirements-centos.txt /tmp/requirements.txt # RUN dnf install -y python3-pip git ansible-core python3-ansible-lint RUN dnf update -y \ @@ -18,4 +18,5 @@ RUN dnf update -y \ COPY ansible/ansible-check.yml /tmp/ansible-check.yml +WORKDIR /root CMD ["/bin/bash"] diff --git a/build/Containerfile.debian b/build/Containerfile.debian index 16e8f6d..febc0a4 100644 --- a/build/Containerfile.debian +++ b/build/Containerfile.debian @@ -18,4 +18,5 @@ RUN apt update \ COPY ansible/ansible-check.yml /tmp/ansible-check.yml +WORKDIR /root CMD ["/bin/bash"] diff --git a/build/Containerfile.fedora b/build/Containerfile.fedora index a09f756..583ce77 100644 --- a/build/Containerfile.fedora +++ b/build/Containerfile.fedora @@ -12,10 +12,11 @@ COPY python/requirements.txt /tmp/requirements.txt # RUN dnf install -y python3-pip git ansible-core python3-ansible-lint RUN dnf update -y \ - && dnf install -y python3-pip python3-devel gcc git systemd nodejs tree procps-ng \ + && dnf install -y python3-pip python3-devel gcc git systemd nodejs tree procps-ng python3-libdnf5 \ && pip install pip --upgrade \ && pip install -r /tmp/requirements.txt COPY ansible/ansible-check.yml /tmp/ansible-check.yml +WORKDIR /root CMD ["/bin/bash"] diff --git a/python/requirements-centos.txt b/python/requirements-centos.txt new file mode 100644 index 0000000..281a01b --- /dev/null +++ b/python/requirements-centos.txt @@ -0,0 +1,2 @@ +ansible-core==2.14.18 +ansible-lint==6.22.2 diff --git a/scripts/build_images.sh b/scripts/build_images.sh new file mode 100755 index 0000000..3d7b229 --- /dev/null +++ b/scripts/build_images.sh @@ -0,0 +1,4 @@ +#!/bin/bash +podman build -f build/Containerfile.centos -t local/ansible-dev-centos:latest . +podman build -f build/Containerfile.centos -t local/ansible-dev-debian:latest . +podman build -f build/Containerfile.fedora -t local/ansible-dev-fedora:latest .