Skip to content

Commit 48d9fbf

Browse files
Added update-build script to add downstream labels (#575)
1 parent 347afd9 commit 48d9fbf

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

.tekton/network-observability-console-plugin-pull-request.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,29 @@ spec:
183183
workspace: workspace
184184
- name: basic-auth
185185
workspace: git-auth
186+
- name: update-downstream
187+
taskSpec:
188+
steps:
189+
- image: ubuntu
190+
script: |
191+
#!/usr/bin/env bash
192+
echo "Starting update-downstream task"
193+
cd workspace/source/source
194+
COMMIT={{revision}} ./hack/update-build.sh
195+
runAfter:
196+
- clone-repository
197+
workspaces:
198+
- name: source
199+
workspace: workspace
200+
- name: git-basic-auth
201+
workspace: git-auth
186202
- name: prefetch-dependencies
187203
params:
188204
- name: input
189205
value: $(params.prefetch-input)
190206
runAfter:
191207
- clone-repository
208+
- update-downstream
192209
taskRef:
193210
params:
194211
- name: name

.tekton/network-observability-console-plugin-push.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,29 @@ spec:
180180
workspace: workspace
181181
- name: basic-auth
182182
workspace: git-auth
183+
- name: update-downstream
184+
taskSpec:
185+
steps:
186+
- image: ubuntu
187+
script: |
188+
#!/usr/bin/env bash
189+
echo "Starting update-downstream task"
190+
cd workspace/source/source
191+
COMMIT={{revision}} ./hack/update-build.sh
192+
runAfter:
193+
- clone-repository
194+
workspaces:
195+
- name: source
196+
workspace: workspace
197+
- name: git-basic-auth
198+
workspace: git-auth
183199
- name: prefetch-dependencies
184200
params:
185201
- name: input
186202
value: $(params.prefetch-input)
187203
runAfter:
188204
- clone-repository
205+
- update-downstream
189206
taskRef:
190207
params:
191208
- name: name

hack/update-build.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
echo "Updating container file"
4+
5+
: "${CONTAINER_FILE:=./Dockerfile}"
6+
: "${COMMIT:=$(git rev-list --abbrev-commit --tags --max-count=1)}"
7+
8+
cat <<EOF >>"${CONTAINER_FILE}"
9+
LABEL com.redhat.component="network-observability-console-plugin-container"
10+
LABEL name="network-observability-console-plugin"
11+
LABEL io.k8s.display-name="Network Observability Console Plugin"
12+
LABEL io.k8s.description="Network Observability Console Plugin"
13+
LABEL summary="Network Observability Console Plugin"
14+
LABEL maintainer="[email protected]"
15+
LABEL io.openshift.tags="network-observability-console-plugin"
16+
LABEL upstream-vcs-ref="${COMMIT}"
17+
LABEL upstream-vcs-type="git"
18+
EOF

0 commit comments

Comments
 (0)