Skip to content

Commit

Permalink
add pnc config
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadiIram committed Sep 23, 2024
1 parent 22b3e8c commit 1a82e0f
Showing 1 changed file with 140 additions and 0 deletions.
140 changes: 140 additions & 0 deletions .tekton/modelmesh-poc-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,60 @@ spec:
value: Dockerfile
- name: path-context
value: .
- name: build-config-git-url
value: 'https://github.com/rhoai-rhtap/RHOAI-Build-Config.git'
- name: build-config-revision
value: 'rhoai-2.14-rhel-8'
- name: build-config-path
value: 'odh-pig-builds/build-config.yaml'
- name: pnc-profile
value: 'prod'
- name: svc-account-name
valueFrom:
secretKeyRef:
name: pnc-oidc-sa
key: rhoai-pnc-oidc-sa
- name: svc-account-secret
valueFrom:
secretKeyRef:
name: pnc-oidc-sa
key: rhoai-pnc-oidc-sa
- name: pnc-cli-config-git-url
value: 'https://gitlab.cee.redhat.com/project-ncl/utils.git'
- name: pnc-cli-config-revision
value: 'master'
pipelineSpec:
params:
- name: build-config-git-url
description: Source Repository URL containing the build configuration
type: string
- name: build-config-revision
default: ""
description: Revision of the Source Repository containing the build configuration
type: string
- name: build-config-path
default: "build-config.yaml"
description: Full path of the build configuration file
type: string

- description: Source Repository URL containing the PNC CLI configuration
name: pnc-cli-config-git-url
type: string
- default: ""
description: Revision of the Source Repository containing the PNC CLI configuration
name: pnc-cli-config-revision
type: string

- description: The profile to be used (declared in the pnc-cli configuration file; possible options are "prod" or "stage")
name: pnc-profile
type: string
- description: The service account name to be used for PNC authentication against corporate SSO
name: svc-account-name
type: string
- description: The service account secret
name: svc-account-secret
type: string

finally:
- name: show-sbom
params:
Expand Down Expand Up @@ -155,6 +208,93 @@ spec:
- name: kind
value: task
resolver: bundles

- name: clone-build-config-repository
params:
- name: url
value: $(params.build-config-git-url)
- name: revision
value: $(params.build-config-revision)
- name: subdirectory
value: build-config
- name: sslVerify
value: false
taskRef:
params:
- name: name
value: git-clone
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-git-clone:0.1@sha256:0bb1be8363557e8e07ec34a3c5daaaaa23c9d533f0bb12f00dc604d00de50814
- name: kind
value: task
resolver: bundles
workspaces:
- name: output
workspace: workspace
- name: basic-auth
workspace: git-auth

- name: clone-pnc-cli-config-repository
params:
- name: url
value: $(params.pnc-cli-config-git-url)
- name: revision
value: $(params.pnc-cli-config-revision)
- name: subdirectory
value: cli-config
- name: sslVerify
value: false
runAfter:
- clone-build-config-repository
taskRef:
params:
- name: name
value: git-clone
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-git-clone:0.1@sha256:0bb1be8363557e8e07ec34a3c5daaaaa23c9d533f0bb12f00dc604d00de50814
- name: kind
value: task
resolver: bundles
workspaces:
- name: output
workspace: workspace
- name: basic-auth
workspace: git-auth

- name: pnc-cli-build
runAfter:
- clone-pnc-cli-config-repository
taskSpec:
steps:
- name: run-pnc-build
image: quay.io/redhat-user-workloads/konflux-jbs-pnc-tenant/pnc/pnc-cli:64de07fb16f9a31799f1e020df9f4fc1015212dc
env:
- name: SSO_SERVICE_ACCOUNT_NAME
value: $(params.svc-account-name)
- name: SSO_SERVICE_ACCOUNT_CLIENT_SECRET
value: $(params.svc-account-secret)
script: |
#!/bin/bash
set -e
set -x
echo "Starting a PNC build..."
echo -n "\n=== Build config ==="
cat /workspace/output/build-config/$(params.build-config-path)
cp /workspace/output/build-config/$(params.build-config-path) /workspace/output
envsubst '${SSO_SERVICE_ACCOUNT_NAME} ${SSO_SERVICE_ACCOUNT_CLIENT_SECRET}' < /workspace/output/cli-config/konflux/configs/pnc_cli/config.yaml > /workspace/output/config.yaml
java -jar /home/jboss/bacon.jar pig run --mode=FORCE --downloadAttempts=3 /workspace/output -p /workspace/output --profile $(params.pnc-profile) --jsonOutput
workspaces:
- name: output
workspace: workspace

workspaces:
- name: workspace
- name: git-auth
optional: true

- name: clone-repository
params:
- name: url
Expand Down

0 comments on commit 1a82e0f

Please sign in to comment.