Skip to content

Commit 36be38a

Browse files
chore: Update oci-ta tasks, add Renovate config (#1575)
1 parent d2d4069 commit 36be38a

8 files changed

+157
-177
lines changed

.github/renovate.json5

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
// This configures Konflux Renovate bot, the thing that keeps our pipelines use up-to-date tasks.
3+
4+
// After making changes to this file, you can validate it by running something like this in the root of the repo:
5+
// $ docker run --rm -it --entrypoint=/usr/local/bin/renovate-config-validator -v "$(pwd)":/mnt -w /mnt renovate/renovate --strict
6+
// There are more validation options, see https://docs.renovatebot.com/config-validation/
7+
8+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
9+
"extends": [
10+
// This inherits the base Konflux config.
11+
// Clickable link https://github.com/konflux-ci/mintmaker/blob/main/config/renovate/renovate.json
12+
// The following was used as example (we may want to check it if the base config gets suddenly moved):
13+
// https://github.com/enterprise-contract/ec-cli/blob/407847910ad420850385eea1db78e2a2e49c7e25/renovate.json#L1C1-L7C2
14+
"github>konflux-ci/mintmaker//config/renovate/renovate.json"
15+
],
16+
"timezone": "Etc/UTC",
17+
"schedule": [
18+
// Allowed syntax: https://docs.renovatebot.com/configuration-options/#schedule
19+
// The time was selected (with the help of https://time.fyi/timezones) so that Renovate isn't active during business
20+
// hours from Germany to US West Coast. This way, after we merge a PR, a new one does not pop up immediately after
21+
// that.
22+
"after 3am and before 7am"
23+
],
24+
// Tell Renovate not to update PRs when outside of schedule.
25+
"updateNotScheduled": false,
26+
"dockerfile": {
27+
"includePaths": [
28+
// Instruct Renovate not try to update Dockerfiles other than konflux.Dockerfile (or konflux.anything.Dockerfile)
29+
// to have less PR noise.
30+
"**/*konflux*.Dockerfile",
31+
],
32+
},
33+
"enabledManagers": [
34+
// Restrict Renovate focus on Konflux things since we rely on GitHub's dependabot for everything else.
35+
"tekton",
36+
"dockerfile",
37+
],
38+
}

.tekton/determine-image-tag-oci-ta.yaml

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

.tekton/determine-image-tag-task.yaml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,38 @@ metadata:
77
spec:
88
description: Determines the tag for the output image using the StackRox convention from 'make tag' output.
99
params:
10-
- name: tag-suffix
10+
- name: TAG_SUFFIX
1111
description: Suffix to append to generated image tag.
1212
type: string
13+
- name: SOURCE_ARTIFACT
14+
description: The Trusted Artifact URI pointing to the artifact with
15+
the application source code. This should be the result of the git-clone task,
16+
results from other tasks might fail as dirty.
17+
type: string
1318
results:
14-
- name: image-tag
19+
- name: IMAGE_TAG
1520
description: Image Tag determined by custom logic.
21+
volumes:
22+
- name: workdir
23+
emptyDir: { }
24+
stepTemplate:
25+
volumeMounts:
26+
- mountPath: /var/workdir
27+
name: workdir
1628
steps:
29+
- name: use-trusted-artifact
30+
image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:601e0999ae062e5ee666538d651af7893a75e415b7952c85caa8a4452501029a
31+
args:
32+
- use
33+
- $(params.SOURCE_ARTIFACT)=/var/workdir/source
1734
- name: determine-image-tag
1835
image: registry.access.redhat.com/ubi8:latest
36+
workingDir: /var/workdir/source
1937
script: |
2038
#!/usr/bin/env bash
2139
set -euo pipefail
2240
dnf -y upgrade --nobest
2341
dnf -y install git make
24-
cd "$(workspaces.source.path)/source"
42+
2543
scripts/konflux/fail-build-if-git-is-dirty.sh
26-
echo -n "$(make --quiet --no-print-directory tag)$(params.tag-suffix)" | tee "$(results.image-tag.path)"
27-
workspaces:
28-
- name: source
29-
description: The workspace where source code is included.
44+
echo -n "$(make --quiet --no-print-directory tag)$(params.TAG_SUFFIX)" | tee "$(results.IMAGE_TAG.path)"

.tekton/fetch-scanner-data-oci-ta-task.yaml

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

.tekton/fetch-scanner-data-task.yaml

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,57 @@ spec:
1515
- name: target-dir
1616
description: Target directory relative to workspace where to save downloaded blobs.
1717
type: string
18-
default: "source"
18+
default: "."
19+
- name: SOURCE_ARTIFACT
20+
description: The Trusted Artifact URI pointing to the artifact with
21+
the application source code. This should be the result of the git-clone task,
22+
results from other tasks might fail as dirty.
23+
type: string
24+
- name: ociStorage
25+
description: The OCI repository where the Trusted Artifacts are stored.
26+
type: string
27+
- name: ociArtifactExpiresAfter
28+
description: Expiration date for the trusted artifacts created in the
29+
OCI repository.
30+
type: string
1931
results:
32+
- name: SOURCE_ARTIFACT
33+
description: The Trusted Artifact URI pointing to the artifact with the application source code
34+
and additional smuggled activation key.
35+
type: string
36+
volumes:
37+
- name: workdir
38+
emptyDir: { }
39+
stepTemplate:
40+
volumeMounts:
41+
- mountPath: /var/workdir
42+
name: workdir
2043
steps:
44+
- name: use-trusted-artifact
45+
image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:601e0999ae062e5ee666538d651af7893a75e415b7952c85caa8a4452501029a
46+
args:
47+
- use
48+
- $(params.SOURCE_ARTIFACT)=/var/workdir/source
2149
- name: fetch-scanner-data
2250
image: registry.access.redhat.com/ubi8/ubi-minimal:latest
2351
# The only functioning way to pass array parameter that I found is through args array.
2452
# Array params have weird limitations, see https://github.com/tektoncd/pipeline/blob/main/docs/tasks.md#substituting-array-parameters
2553
# Attempts to pass this in other places result in webhook errors and pipeline not starting.
2654
args: [ "$(params.blobs-to-fetch[*])" ]
55+
workingDir: /var/workdir/source
2756
script: |
2857
#!/usr/bin/env bash
2958
set -euo pipefail
30-
exec "$(workspaces.source.path)/source/scripts/konflux/fetch-scanner-data.sh" \
31-
"$(workspaces.source.path)/$(params.target-dir)" \
32-
"$@"
59+
scripts/konflux/fetch-scanner-data.sh "$(params.target-dir)" "$@"
3360
# It should not take long to download blobs otherwise there's something odd going on.
3461
timeout: 10m
35-
workspaces:
36-
- name: source
37-
description: Workspace with the source code.
62+
- name: create-trusted-artifact
63+
image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:601e0999ae062e5ee666538d651af7893a75e415b7952c85caa8a4452501029a
64+
args:
65+
- create
66+
- --store
67+
- $(params.ociStorage)
68+
- $(results.SOURCE_ARTIFACT.path)=/var/workdir/source
69+
env:
70+
- name: IMAGE_EXPIRES_AFTER
71+
value: $(params.ociArtifactExpiresAfter)

.tekton/scanner-build.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,9 @@ spec:
7777
requests:
7878
cpu: 1
7979

80+
# Multiarch builds sometimes make the pipeline timeout after 1h.
81+
timeouts:
82+
pipeline: 1h30m0s
83+
8084
pipelineRef:
8185
name: scanner-component-pipeline

0 commit comments

Comments
 (0)