-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (56 loc) · 1.9 KB
/
apply-konflux.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
name: Apply konflux configurations
on:
schedule:
- cron: "0 4 * * *" # Daily at 06:00.
workflow_dispatch: # Manual workflow trigger
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-matrix:
runs-on: ubuntu-latest
if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.22.x
- id: set-matrix
run: |
echo "projects=$(go run ./cmd/matrix config/konflux/*)" >> $GITHUB_OUTPUT
outputs:
projects: ${{ steps.set-matrix.outputs.projects }}
apply-project:
needs: build-matrix
if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
project: ${{ fromJSON(needs.build-matrix.outputs.projects) }}
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Clone ${{matrix.project}}
uses: actions/checkout@v4
with:
repository: openshift-pipelines/${{matrix.project}}
path: project
- uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Apply configurations
run: |
kubectl config set-credentials konflux-sa --token "$KONFLUX_TOKEN"
kubectl config set-cluster konflux --server=https://api.stone-prd-rh01.pg1f.p1.openshiftapps.com:6443
kubectl config set-context konflux-sa@konflux --user=konflux-sa --namespace=tekton-ecosystem-tenant --cluster=konflux
kubectl config use-context konflux-sa@konflux
kubectl get pr
go run ./cmd/konflux-apply/ -config config/konflux/${{matrix.project}}.yaml
env:
KONFLUX_TOKEN: ${{ secrets.KONFLUX_SA_TOKEN }}