Skip to content

Commit

Permalink
Added update-build script to add downstream labels (#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierCazade authored Sep 6, 2024
1 parent dec7af3 commit b3411aa
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .tekton/flowlogs-pipeline-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,29 @@ spec:
workspace: workspace
- name: basic-auth
workspace: git-auth
- name: update-downstream
taskSpec:
steps:
- image: ubuntu
script: |
#!/usr/bin/env bash
echo "Starting update-downstream task"
cd workspace/source/source
COMMIT={{revision}} ./hack/update-build.sh
runAfter:
- clone-repository
workspaces:
- name: source
workspace: workspace
- name: git-basic-auth
workspace: git-auth
- name: prefetch-dependencies
params:
- name: input
value: $(params.prefetch-input)
runAfter:
- clone-repository
- update-downstream
taskRef:
params:
- name: name
Expand Down
17 changes: 17 additions & 0 deletions .tekton/flowlogs-pipeline-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,29 @@ spec:
workspace: workspace
- name: basic-auth
workspace: git-auth
- name: update-downstream
taskSpec:
steps:
- image: ubuntu
script: |
#!/usr/bin/env bash
echo "Starting update-downstream task"
cd workspace/source/source
COMMIT={{revision}} ./hack/update-build.sh
runAfter:
- clone-repository
workspaces:
- name: source
workspace: workspace
- name: git-basic-auth
workspace: git-auth
- name: prefetch-dependencies
params:
- name: input
value: $(params.prefetch-input)
runAfter:
- clone-repository
- update-downstream
taskRef:
params:
- name: name
Expand Down
18 changes: 18 additions & 0 deletions hack/update-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

echo "Updating container file"

: "${CONTAINER_FILE:=./contrib/docker/Dockerfile}"
: "${COMMIT:=$(git rev-list --abbrev-commit --tags --max-count=1)}"

cat <<EOF >>"${CONTAINER_FILE}"
LABEL com.redhat.component="network-observability-flowlogs-pipeline-container"
LABEL name="network-observability-flowlogs-pipeline"
LABEL io.k8s.display-name="Network Observability Flow-Logs Pipeline"
LABEL io.k8s.description="Network Observability Flow-Logs Pipeline"
LABEL summary="Network Observability Flow-Logs Pipeline"
LABEL maintainer="[email protected]"
LABEL io.openshift.tags="network-observability-flowlogs-pipeline"
LABEL upstream-vcs-ref="${COMMIT}"
LABEL upstream-vcs-type="git"
EOF

0 comments on commit b3411aa

Please sign in to comment.