Skip to content

Commit 1be44d1

Browse files
ruhan1rnc
authored andcommitted
Upload build log to Bifrost
1 parent 866d266 commit 1be44d1

File tree

2 files changed

+52
-4
lines changed

2 files changed

+52
-4
lines changed

deploy/pipeline/mw-pipeline-v0.1.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ spec:
7272
- name: NOTIFICATION_CONTEXT
7373
type: string
7474
default: ""
75+
- name: BIFROST_URL
76+
type: string
77+
default: ""
7578
workspaces:
7679
- name: source
7780
description: Workspace containing the source code
@@ -195,7 +198,7 @@ spec:
195198
- name: url
196199
value: https://raw.githubusercontent.com/redhat-appstudio/jvm-build-service/refs/heads/main/deploy/tasks/buildah-oci-ta.yaml
197200

198-
- name: maven-deployment
201+
- name: push-results
199202
runAfter:
200203
- buildah-oci-ta
201204
params:
@@ -209,11 +212,15 @@ spec:
209212
value: $(params.MVN_REPO_DEPLOY_URL)
210213
- name: ACCESS_TOKEN
211214
value: $(params.ACCESS_TOKEN)
215+
- name: BUILD_ID
216+
value: $(params.BUILD_ID)
217+
- name: BIFROST_URL
218+
value: $(params.BIFROST_URL)
212219
taskRef:
213220
resolver: http
214221
params:
215222
- name: url
216-
value: https://raw.githubusercontent.com/redhat-appstudio/jvm-build-service/refs/heads/main/deploy/tasks/maven-deployment.yaml
223+
value: https://raw.githubusercontent.com/redhat-appstudio/jvm-build-service/refs/heads/main/deploy/tasks/push-results.yaml
217224

218225
finally:
219226
- name: notification

deploy/tasks/maven-deployment.yaml renamed to deploy/tasks/push-results.yaml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ metadata:
1111
build.appstudio.redhat.com/build_type: docker
1212
spec:
1313
description: |-
14-
Takes a OCI archive and deploys the result
14+
Takes a OCI archive and deploys the result and uploads log to Bifrost
1515
params:
1616
- name: IMAGE_URL
1717
description: Reference to the OCI archive
@@ -39,6 +39,11 @@ spec:
3939
description: Access token for OAuth.
4040
type: string
4141
default: ""
42+
- name: BUILD_ID
43+
type: string
44+
- name: BIFROST_URL
45+
description: bifrost url to upload log
46+
type: string
4247
- name: PNC_KONFLUX_TOOLING_IMAGE
4348
description: Name of the tooling image.
4449
type: string
@@ -80,7 +85,7 @@ spec:
8085
value: $(params.IMAGE_DIGEST)
8186
- name: IMAGE_URL
8287
value: $(params.IMAGE_URL)
83-
- name: deploy
88+
- name: uplaod-artifacts
8489
image: $(params.PNC_KONFLUX_TOOLING_IMAGE)
8590
securityContext:
8691
runAsUser: 0
@@ -114,3 +119,39 @@ spec:
114119
update-ca-trust
115120
fi
116121
/opt/jboss/container/java/run/run-java.sh $@
122+
- name: upload-log
123+
image: $(params.PNC_KONFLUX_TOOLING_IMAGE)
124+
securityContext:
125+
runAsUser: 0
126+
computeResources:
127+
limits:
128+
cpu: 300m
129+
memory: 512Mi
130+
requests:
131+
cpu: 10m
132+
memory: 512Mi
133+
volumeMounts:
134+
- mountPath: /mnt/trusted-ca
135+
name: trusted-ca
136+
readOnly: true
137+
env:
138+
- name: ACCESS_TOKEN
139+
value: $(params.ACCESS_TOKEN)
140+
args:
141+
- upload-log
142+
- --file=/var/workdir/log/build.log
143+
- --bifrost-url=$(params.BIFROST_URL)
144+
- --process-context=$(params.BUILD_ID)
145+
- --process-context-variant=""
146+
- --tmp=false
147+
- --request-context=""
148+
script: |
149+
#!/bin/bash
150+
set -e
151+
ca_bundle=/mnt/trusted-ca/ca-bundle.crt
152+
if [ -f "$ca_bundle" ]; then
153+
echo "INFO: Using mounted CA bundle: $ca_bundle"
154+
cp -vf $ca_bundle /etc/pki/ca-trust/source/anchors
155+
update-ca-trust
156+
fi
157+
/opt/jboss/container/java/run/run-java.sh $@

0 commit comments

Comments
 (0)