Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/operators-installer-sripts-runner-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: operators-installer-sripts-runner-pr
on:
pull_request:
paths:
- operators-installer-sripts-runner/**
- .github/workflows/operators-installer-sripts-runner-pr.yaml

# Declare default permissions as read only.
permissions: read-all

jobs:
build:
env:
context: operators-installer-sripts-runner
image_name: operators-installer-sripts-runner
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

- name: Check and verify version.json
id: check_version
uses: redhat-cop/github-actions/get-image-version@cc45c69b6655161f278271cd0c68ddcc1444a3f8 # v4.6
with:
IMAGE_CONTEXT_DIR: ${{ env.context }}

- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static

- name: Build image
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2
with:
context: ${{ env.context }}
dockerfiles: |
./${{ env.context }}/Dockerfile
image: ${{ env.image_name }}
platforms: linux/amd64
oci: true
tags: ${{ steps.check_version.outputs.IMAGE_TAGS }}

- name: Test image
run: |
echo "Test if python modual intalled: semver"
podman run ${image_name}:${{ steps.check_version.outputs.VERSION }} python -c "import semver"

echo "Test if python modual intalled: openshift_client"
podman run ${image_name}:${{ steps.check_version.outputs.VERSION }} python -c "import openshift_client"
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: operators-installer-sripts-runner-publish
on:
schedule:
- cron: '0 1 * * *' # everyday at 1am
push:
paths:
- operators-installer-sripts-runner/version.json
- .github/workflows/operators-installer-sripts-runner-publish.yaml

# Declare default permissions as read only.
permissions: read-all

jobs:
build:
env:
context: operators-installer-sripts-runner
image_name: operators-installer-sripts-runner
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

- name: Get image tags
id: image_tags
uses: redhat-cop/github-actions/get-image-version@cc45c69b6655161f278271cd0c68ddcc1444a3f8 # v4.6
with:
IMAGE_CONTEXT_DIR: ${{ env.context }}

- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static

- name: Build image
id: build_image
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2
with:
context: ${{ env.context }}
dockerfiles: |
./${{ env.context }}/Dockerfile
image: ${{ env.image_name }}
platforms: linux/amd64
tags: "${{ steps.image_tags.outputs.IMAGE_TAGS }}"

- name: Push to ghcr.io
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2
if: ${{ !contains(github.ref, 'renovate') }}
with:
image: ${{ steps.build_image.outputs.image }}
registry: ghcr.io/${{ github.repository }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
tags: ${{ steps.build_image.outputs.tags }}

- name: Push to Quay
env:
REGISTRY_URI: ${{ secrets.REGISTRY_URI }}
if: ${{ env.REGISTRY_URI != '' && !contains(github.ref, 'renovate') }}
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2
with:
image: ${{ steps.build_image.outputs.image }}
registry: ${{ secrets.REGISTRY_URI }}/${{ secrets.REGISTRY_REPOSITORY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
tags: ${{ steps.build_image.outputs.tags }}
4 changes: 4 additions & 0 deletions operators-installer-sripts-runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM quay.io/openshift/origin-cli:4.20

RUN python3 -m ensurepip --upgrade
RUN python3 -m pip install openshift-client semver==2.13.0
22 changes: 22 additions & 0 deletions operators-installer-sripts-runner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# operators-installer-sripts-runner

A utility image that can be used with the [containers-installer helm chart](https://github.com/redhat-cop/helm-charts/tree/main/charts/operators-installer)

```yaml
```

## Purpose

Use with the [containers-installer helm chart](https://github.com/redhat-cop/helm-charts/tree/main/charts/operators-installer) to save time by not having to install python packages at runetime everytime an approver or validator job runs.

sample-vales.yaml
```yaml
installPlanApproverAndVerifyJobsImage: https://quay.io/repository/redhat-cop/operators-installer-sripts-runner
installRequiredPythonLibraries: false

...
```

## Published

[https://quay.io/repository/redhat-cop/operators-installer-sripts-runner](https://quay.io/repository/redhat-cop/operators-installer-sripts-runner) via [GitHub Workflows](../../.github/workflows/operators-installer-sripts-runner-publish.yaml).
3 changes: 3 additions & 0 deletions operators-installer-sripts-runner/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"version": "v1.0.0"
}
Loading