Skip to content

Commit bbf1991

Browse files
committed
operators-installer-sripts-runner - init add
image to help speed up use and testing of the redhat-cop/operators-installer helm chart
1 parent 4c95aad commit bbf1991

5 files changed

Lines changed: 143 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: operators-installer-sripts-runner-pr
2+
on:
3+
pull_request:
4+
paths:
5+
- operators-installer-sripts-runner/**
6+
- .github/workflows/operators-installer-sripts-runner-pr.yaml
7+
8+
# Declare default permissions as read only.
9+
permissions: read-all
10+
11+
jobs:
12+
build:
13+
env:
14+
context: operators-installer-sripts-runner
15+
image_name: operators-installer-sripts-runner
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
19+
20+
- name: Check and verify version.json
21+
id: check_version
22+
uses: redhat-cop/github-actions/get-image-version@cc45c69b6655161f278271cd0c68ddcc1444a3f8 # v4.6
23+
with:
24+
IMAGE_CONTEXT_DIR: ${{ env.context }}
25+
26+
- name: Install qemu dependency
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install -y qemu-user-static
30+
31+
- name: Build image
32+
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2
33+
with:
34+
context: ${{ env.context }}
35+
dockerfiles: |
36+
./${{ env.context }}/Dockerfile
37+
image: ${{ env.image_name }}
38+
platforms: linux/amd64
39+
oci: true
40+
tags: ${{ steps.check_version.outputs.IMAGE_TAGS }}
41+
42+
- name: Test image
43+
run: |
44+
echo "Test if python modual intalled: semver"
45+
podman run ${image_name}:${{ steps.check_version.outputs.VERSION }} python -c "import semver"
46+
47+
echo "Test if python modual intalled: openshift_client"
48+
podman run ${image_name}:${{ steps.check_version.outputs.VERSION }} python -c "import openshift_client"
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: operators-installer-sripts-runner-publish
2+
on:
3+
schedule:
4+
- cron: '0 1 * * *' # everyday at 1am
5+
push:
6+
paths:
7+
- operators-installer-sripts-runner/version.json
8+
- .github/workflows/operators-installer-sripts-runner-publish.yaml
9+
10+
# Declare default permissions as read only.
11+
permissions: read-all
12+
13+
jobs:
14+
build:
15+
env:
16+
context: operators-installer-sripts-runner
17+
image_name: operators-installer-sripts-runner
18+
runs-on: ubuntu-latest
19+
permissions:
20+
packages: write
21+
steps:
22+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
23+
24+
- name: Get image tags
25+
id: image_tags
26+
uses: redhat-cop/github-actions/get-image-version@cc45c69b6655161f278271cd0c68ddcc1444a3f8 # v4.6
27+
with:
28+
IMAGE_CONTEXT_DIR: ${{ env.context }}
29+
30+
- name: Install qemu dependency
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y qemu-user-static
34+
35+
- name: Build image
36+
id: build_image
37+
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2
38+
with:
39+
context: ${{ env.context }}
40+
dockerfiles: |
41+
./${{ env.context }}/Dockerfile
42+
image: ${{ env.image_name }}
43+
platforms: linux/amd64
44+
tags: "${{ steps.image_tags.outputs.IMAGE_TAGS }}"
45+
46+
- name: Push to ghcr.io
47+
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2
48+
if: ${{ !contains(github.ref, 'renovate') }}
49+
with:
50+
image: ${{ steps.build_image.outputs.image }}
51+
registry: ghcr.io/${{ github.repository }}
52+
username: ${{ github.repository_owner }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
tags: ${{ steps.build_image.outputs.tags }}
55+
56+
- name: Push to Quay
57+
env:
58+
REGISTRY_URI: ${{ secrets.REGISTRY_URI }}
59+
if: ${{ env.REGISTRY_URI != '' && !contains(github.ref, 'renovate') }}
60+
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2
61+
with:
62+
image: ${{ steps.build_image.outputs.image }}
63+
registry: ${{ secrets.REGISTRY_URI }}/${{ secrets.REGISTRY_REPOSITORY }}
64+
username: ${{ secrets.REGISTRY_USERNAME }}
65+
password: ${{ secrets.REGISTRY_PASSWORD }}
66+
tags: ${{ steps.build_image.outputs.tags }}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM quay.io/openshift/origin-cli:4.20
2+
3+
RUN python3 -m ensurepip --upgrade
4+
RUN python3 -m pip install openshift-client semver==2.13.0
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# operators-installer-sripts-runner
2+
3+
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)
4+
5+
```yaml
6+
```
7+
8+
## Purpose
9+
10+
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.
11+
12+
sample-vales.yaml
13+
```yaml
14+
installPlanApproverAndVerifyJobsImage: https://quay.io/repository/redhat-cop/operators-installer-sripts-runner
15+
installRequiredPythonLibraries: false
16+
17+
...
18+
```
19+
20+
## Published
21+
22+
[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).
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"version": "v1.0.0"
3+
}

0 commit comments

Comments
 (0)