Skip to content

Commit 7bf81db

Browse files
authored
Drop image guild on GitHub Actions (#279)
Konflux builds the image now. JIRA: RHELWF-12620
1 parent 41ae901 commit 7bf81db

5 files changed

Lines changed: 9 additions & 109 deletions

File tree

.github/workflows/resultsdb.yaml

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -86,64 +86,3 @@ jobs:
8686
# * DL3041 - Specify version with dnf install -y <package>-<version>
8787
ignore: DL3041
8888
failure-threshold: warning
89-
90-
image-build:
91-
name: Container Image Build
92-
needs: hadolint
93-
runs-on: ubuntu-latest
94-
env:
95-
IMAGE_NAME: resultsdb
96-
REGISTRY: quay.io/factory2
97-
GH_REGISTRY: ghcr.io/${{ github.actor }}
98-
99-
steps:
100-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
101-
102-
- name: Set up Python ${{ matrix.python-version }}
103-
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
104-
with:
105-
python-version: ${{ matrix.python-version }}
106-
107-
- name: Install dependencies
108-
run: |
109-
python -m pip install --upgrade pip
110-
pip install poetry podman-compose
111-
112-
- name: Update the Application Version
113-
run: poetry version "$(./get-version.sh)"
114-
115-
- name: Get image tag from git branch
116-
id: get-image-tag
117-
run: |
118-
export TAG=$(sed 's/[^0-9a-zA-Z_.-]/__/g' <<< "$GITHUB_REF_NAME") &&
119-
echo "::set-output name=tag::$TAG"
120-
121-
- name: Build Image
122-
id: build-image
123-
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2
124-
with:
125-
image: ${{ env.IMAGE_NAME }}
126-
tags: >-
127-
${{ steps.get-image-tag.outputs.tag }}
128-
${{ github.ref == 'refs/heads/develop' && 'latest' || '' }}
129-
${{ github.sha }}
130-
containerfiles: Dockerfile
131-
build-args: |
132-
GITHUB_SHA=${{ github.sha }}
133-
EXPIRES_AFTER=${{ github.ref == 'refs/heads/develop' && 'never' || '30d' }}
134-
135-
- name: Log in to the image registry
136-
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
137-
uses: redhat-actions/podman-login@4934294ad0449894bcd1e9f191899d7292469603 # v1
138-
with:
139-
registry: ${{ secrets.REGISTRY_USER && env.REGISTRY || env.GH_REGISTRY }}
140-
username: ${{ secrets.REGISTRY_USER || github.actor }}
141-
password: ${{ secrets.REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}
142-
143-
- name: Push Image
144-
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
145-
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2
146-
with:
147-
image: ${{ steps.build-image.outputs.image }}
148-
tags: ${{ steps.build-image.outputs.tags }}
149-
registry: ${{ secrets.REGISTRY_USER && env.REGISTRY || env.GH_REGISTRY }}

.tekton/resultsdb-pull-request.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ spec:
208208
- name: BUILD_ARGS
209209
value:
210210
- $(params.build-args[*])
211+
- SHORT_COMMIT=$(tasks.clone-repository.results.short-commit)
212+
- COMMIT_TIMESTAMP=$(tasks.clone-repository.results.commit-timestamp)
211213
- name: BUILD_ARGS_FILE
212214
value: $(params.build-args-file)
213215
- name: PRIVILEGED_NESTED

.tekton/resultsdb-push.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ spec:
205205
- name: BUILD_ARGS
206206
value:
207207
- $(params.build-args[*])
208+
- SHORT_COMMIT=$(tasks.clone-repository.results.short-commit)
209+
- COMMIT_TIMESTAMP=$(tasks.clone-repository.results.commit-timestamp)
208210
- name: BUILD_ARGS_FILE
209211
value: $(params.build-args-file)
210212
- name: PRIVILEGED_NESTED

Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM quay.io/fedora/python-313:20251001@sha256:d3f9c348c0e709957c9b7617e65814c57f6162d3e930712a2ea7b5860ba40530 AS builder
22

3+
ARG SHORT_COMMIT
4+
ARG COMMIT_TIMESTAMP
5+
36
# builder should use root to install/create all files
47
USER root
58

@@ -52,6 +55,7 @@ COPY \
5255
RUN set -ex \
5356
&& export PATH=/root/.local/bin:"$PATH" \
5457
&& . /venv/bin/activate \
58+
&& poetry version "2.2.0.dev$COMMIT_TIMESTAMP+git.$SHORT_COMMIT" \
5559
&& poetry build --format=wheel \
5660
&& version=$(poetry version --short) \
5761
&& pip install --no-cache-dir dist/resultsdb-"$version"-py3*.whl \
@@ -78,19 +82,14 @@ USER 1001
7882

7983
# --- Final image
8084
FROM scratch
81-
ARG GITHUB_SHA
82-
ARG EXPIRES_AFTER
8385
LABEL \
8486
name="ResultsDB application" \
8587
vendor="ResultsDB developers" \
8688
license="GPLv2+" \
8789
description="ResultsDB is a results store engine for, but not limited to, Fedora QA tools." \
8890
usage="https://pagure.io/taskotron/resultsdb/blob/develop/f/openshift/README.md" \
8991
url="https://github.com/release-engineering/resultsdb" \
90-
vcs-type="git" \
91-
vcs-ref=$GITHUB_SHA \
92-
io.k8s.display-name="ResultsDB" \
93-
quay.expires-after=$EXPIRES_AFTER
92+
io.k8s.display-name="ResultsDB"
9493

9594
ENV \
9695
PYTHONFAULTHANDLER=1 \

get-version.sh

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)