Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ resources:
- base
- dummy-deployment
- konflux-operator
- tekton-kueue
- authentication

commonAnnotations:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- warehouse.yaml
- promotiontasks
- stage-ring-0-tekton-kueue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- tekton-kueue-promote-ring-0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
apiVersion: kargo.akuity.io/v1alpha1
kind: PromotionTask
metadata:
name: tekton-kueue-promote-ring-0
spec:
vars:
- name: srcPath
steps:
- uses: http
as: fetch-index
if: ${{ ctx.targetFreight.origin.name == "tekton-kueue" }}
config:
method: GET
url: https://quay.io/v2/openshift-pipeline/pipelines-scheduler-rhel10/manifests/${{ imageFrom("quay.io/openshift-pipeline/pipelines-scheduler-rhel10").Digest }}
headers:
- name: Accept
value: application/vnd.oci.image.index.v1+json
successExpression: response.status == 200
outputs:
- name: amd64Digest
fromExpression: filter(response.body.manifests, {.platform.architecture == 'amd64' && .platform.os == 'linux'})[0].digest
timeout: 30s
- uses: http
as: fetch-manifest
if: ${{ ctx.targetFreight.origin.name == "tekton-kueue" }}
config:
method: GET
url: https://quay.io/v2/openshift-pipeline/pipelines-scheduler-rhel10/manifests/${{ outputs['fetch-index'].amd64Digest }}
headers:
- name: Accept
value: application/vnd.oci.image.manifest.v1+json
successExpression: response.status == 200
outputs:
- name: revision
fromExpression: response.body.annotations["org.opencontainers.image.revision"]
timeout: 30s
- uses: yaml-update
as: update-tekton-kueue
if: ${{ ctx.targetFreight.origin.name == "tekton-kueue" }}
config:
path: ${{ vars.srcPath }}/components/kueue/rings/ring-0/tekton-kueue/kustomization.yaml
updates:
- key: images.0.digest
value: ${{ imageFrom("quay.io/openshift-pipeline/pipelines-scheduler-rhel10").Digest }}
- key: resources.0
value: https://github.com/openshift-pipelines/tekton-kueue/upstream/config/default?ref=${{ outputs['fetch-manifest'].revision }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: ring-0-tekton-kueue
annotations:
kargo.akuity.io/color: green
spec:
requestedFreight:
- origin:
kind: Warehouse
name: tekton-kueue
sources:
direct: true
promotionTemplate:
spec:
vars:
- name: repoURL
value: https://github.com/redhat-appstudio/infra-deployments.git
- name: component
value: ${{ ctx.targetFreight.origin.name }}
steps:
- uses: git-clone
as: clone
config:
repoURL: ${{ vars.repoURL }}
checkout:
- branch: main
path: ./src
- task:
name: tekton-kueue-promote-ring-0
as: tekton-kueue-promote
vars:
- name: srcPath
value: ./src
- uses: git-commit
as: commit
config:
path: ./src
message: |
chore(${{ ctx.stage }}): promote ${{ vars.component }}
- uses: git-push
as: push
config:
path: ./src
targetBranch: ${{ ctx.project }}/${{ vars.component }}/ring-0
force: true
- uses: git-open-pr
as: open-pr
continueOnError: true
config:
repoURL: ${{ vars.repoURL }}
sourceBranch: ${{ ctx.project }}/${{ vars.component }}/ring-0
targetBranch: main
title: "chore(${{ ctx.stage }}): promote ${{ vars.component }}"
description: |
### ${{ ctx.stage }}

| | |
|---|---|
| **Component** | `${{ vars.component }}` |
| **Project** | `${{ ctx.project }}` |
| **Promotion** | `${{ ctx.promotion }}` |
| **Freight** | `${{ ctx.targetFreight.alias }}` |

---

${{ (outputs[vars.component + '-promote.pr-meta']?.details) ?? ('Promotes `' + vars.component + '` to **' + ctx.stage + '**.') }}

---

Auto-merged after CI passes. No manual approval required for Ring 0.

> Branch is force-pushed each promotion cycle. Do not commit directly.
labels:
- ring-0
- automated-promotion
- component/${{ vars.component }}
- task:
name: wait-for-ci
as: wait-for-ci
vars:
- name: commitSHA
value: ${{ outputs['push'].commit }}
- uses: http
Comment thread
qodo-for-redhat-appstudio[bot] marked this conversation as resolved.
as: find-pr
retry:
timeout: 5m0s
errorThreshold: 10
config:
method: GET
url: https://api.github.com/repos/redhat-appstudio/infra-deployments/pulls?head=redhat-appstudio:${{ ctx.project }}/${{ vars.component }}/ring-0&state=open
headers:
- name: Authorization
value: Bearer ${{ secret('kargo-infra-deployments-secrets').github_pat }}
- name: Accept
value: application/vnd.github+json
outputs:
- name: prNumber
fromExpression: response.body[0].number
successExpression: response.status == 200 && len(response.body) > 0
timeout: 30s
- uses: git-merge-pr
as: merge-pr
retry:
timeout: 2h0m0s
errorThreshold: 240
config:
repoURL: ${{ vars.repoURL }}
prNumber: ${{ outputs['find-pr'].prNumber }}
mergeMethod: squash
wait: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: tekton-kueue
spec:
freightCreationPolicy: Automatic
interval: 2h0m0s
subscriptions:
- image:
repoURL: quay.io/openshift-pipeline/pipelines-scheduler-rhel10
imageSelectionStrategy: NewestBuild
discoveryLimit: 5
allowTags: nightly
Comment thread
qodo-for-redhat-appstudio[bot] marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
apiVersion: kargo.akuity.io/v1alpha1
kind: PromotionTask
metadata:
name: promote-component-with-copy
spec:
vars:
- name: repoURL
value: https://github.com/redhat-appstudio/infra-deployments
- name: branch
value: main
- name: srcKustomization
- name: destKustomization
- name: commitMessage

steps:
# Clone the Git repository that contains the Kustomize configuration
# to the ./src directory, and the environment configuration to ./out.
- uses: git-clone
as: git-clone
config:
repoURL: ${{ vars.repoURL }}
checkout:
- commit: ${{ commitFrom(vars.repoURL, warehouse(ctx.targetFreight.origin.name)).ID }}
path: ./src
as: src
- branch: ${{ vars.branch }}
path: ./main
as: main

- uses: delete
config:
path: ./main/${{ vars.destKustomization }}

- uses: copy
as: update-component
config:
inPath: ./src/${{ vars.srcKustomization }}
outPath: ./main/${{ vars.destKustomization }}

# Commit the changes to the Git repository.
- uses: git-commit
as: commit
config:
path: ./main
message: ${{ vars.commitMessage }}

# Push the changes to the Git repository.
- uses: git-push
as: push
config:
path: ./main
generateTargetBranch: true

- uses: git-open-pr
as: open-pr
config:
repoURL: ${{ vars.repoURL }}
createTargetBranch: true
sourceBranch: ${{ task.outputs.push.branch }}
targetBranch: main

- uses: git-wait-for-pr
as: wait-for-pr
config:
repoURL: ${{ vars.repoURL }}
prNumber: ${{ task.outputs['open-pr'].pr.id }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: staging-promote
annotations:
kargo.akuity.io/color: yellow
spec:
requestedFreight:
- origin:
kind: Warehouse
name: development-tekton-kueue
sources:
direct: true
promotionTemplate:
spec:
steps:
# promote tekton-kueue to staging
- task:
name: promote-component-with-copy
vars:
- name: srcKustomization
value: components/kueue/development/tekton-kueue
- name: destKustomization
value: components/kueue/staging/base/tekton-kueue
- name: commitMessage
value: "Promote tekton-kueue to staging"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: development-tekton-kueue
spec:
subscriptions:
- git:
repoURL: https://github.com/redhat-appstudio/infra-deployments
branch: main
includePaths:
- components/kueue/development/tekton-kueue
Loading