Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisdenny committed Aug 14, 2024
1 parent 9a4a904 commit a80191d
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build-and-push-client-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Push Image
on: [ push ]
env:
IMAGE_NAME: cifmw-client
IMAGE_TAGS: ${{ github.sha }} latest
IMAGE_REGISTRY: quay.rdoproject.org/ci-framework
REGISTRY_USER: ${{ secrets.QUAY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}

jobs:
build:
name: Build and push image
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.IMAGE_TAGS }}
containerfiles: |
containerfiles/Containerfile.client
- name: Push To quay.rdoproject.org
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}

- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,8 @@ plugin-development-disable: # Revert all changes and delete .env if no longer ne
grep -lEr --include=\*.py --exclude-dir=.venv 'from (?:plugins|tests)' | xargs gsed -i -e 's/from plugins/from ansible_collections\.cifmw\.general\.plugins/g' -e 's/from tests/from ansible_collections\.cifmw\.general\.tests/g'
gsed -i '/PYTHONPATH=/d' .env
[ -s .env ] || rm .env

.PHONY: build-cifmw-client-container
build-cifmw-client-container:
podman rmi localhost/cifmw_client || true
podman build --security-opt label=disable -t localhost/cifmw_client:latest -f containerfiles/Containerfile.client
15 changes: 15 additions & 0 deletions containerfiles/Containerfile.client
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM quay.io/centos/centos:stream9
LABEL summary="CI-Framework client image" maintainer="CI Framework"

USER root
RUN dnf update -y && dnf install -y git python3-pip python3-netaddr make gcc sudo rsync && dnf clean all

RUN adduser cifmw
RUN echo "cifmw ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/cifmw

USER cifmw
COPY . /home/cifmw/ci-framework
WORKDIR /home/cifmw/ci-framework
RUN /usr/bin/make -C /home/cifmw/ci-framework setup_molecule USE_VENV=yes

CMD /usr/bin/make help

0 comments on commit a80191d

Please sign in to comment.