Skip to content

Commit

Permalink
[bot] update konflux configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
openshift-pipelines-bot authored and vdemeester committed Nov 20, 2024
1 parent 5c35e9d commit a116cff
Show file tree
Hide file tree
Showing 21 changed files with 412 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/auto-merge.next.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: auto-merge-next

on:
workflow_dispatch: {}
schedule:
- cron: "*/30 * * * *" # At every 30 minutes

jobs:
auto-approve:
runs-on: ubuntu-latest
if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere
permissions:
pull-requests: write
steps:
- name: Checkout the current repo
uses: actions/checkout@v4
- name: auto-merge-update-references
run: |
gh auth status
git config user.name openshift-pipelines-bot
git config user.email [email protected]
# Approve and merge pull-request with no reviews
for p in $(gh pr list --search "author:app/red-hat-konflux head:konflux/references/next" --json "number" | jq ".[].number"); do
gh pr merge --rebase --delete-branch --auto $p
done
env:
GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }}
- name: auto-merge-upstream-next
run: |
gh auth status
git config user.name openshift-pipelines-bot
git config user.email [email protected]
# Approve and merge pull-request with no reviews
for p in $(gh pr list --search "head:actions/update/sources-next" --json "number" | jq ".[].number"); do
gh pr merge --rebase --delete-branch --auto $p
done
env:
GH_TOKEN: ${{ secrets.OPENSHIFT_PIPELINES_ROBOT }}

5 changes: 3 additions & 2 deletions .github/workflows/update-sources.main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ jobs:
if [ "$(gh pr list --base main --head actions/update/sources-main --json url --jq 'length')" = "0" ]; then
echo "creating PR..."
gh pr create -B main -H actions/update/sources-main --fill
gh pr create -B main -H actions/update/sources-main --label=automated --label=upstream --fill
else
echo "a PR already exists, skipping..."
echo "a PR already exists, editing..."
gh pr edit --title "[bot] Update from tektoncd/pipeline to ${NEW_COMMIT}" --body "$(cat /tmp/diff.txt | sed 's/^/ /')"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73 changes: 73 additions & 0 deletions .github/workflows/update-sources.next.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
name: update-sources-next

on:
workflow_dispatch: {}
schedule:
- cron: "30 */12 * * *" # At minute 30 past every 12th hour.

jobs:

update-sources:
runs-on: ubuntu-latest
if: github.repository_owner == 'openshift-pipelines' # do not run this elsewhere
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout the current repo
uses: actions/checkout@v4
with:
ref: next

- name: Clone tektoncd/pipeline
run: |
rm -fR upstream
git clone https://github.com/tektoncd/pipeline upstream
pushd upstream
git checkout -B release-v0.65.x origin/release-v0.65.x
popd
- name: Commit new changes
run: |
git config user.name openshift-pipelines-bot
git config user.email [email protected]
git checkout -b actions/update/sources-next
pushd upstream
OLD_COMMIT=$(cat ../head)
NEW_COMMIT=$(git rev-parse HEAD)
echo Previous commit: ${OLD_COMMIT}
git show --stat ${OLD_COMMIT}
echo New commit: ${NEW_COMMIT}
git show --stat ${NEW_COMMIT}
git diff --stat ${NEW_COMMIT}..${OLD_COMMIT} > /tmp/diff.txt
git rev-parse HEAD > ../head
popd
rm -rf upstream/.git
git add upstream head .konflux
if [[ -z $(git status --porcelain --untracked-files=no) ]]; then
echo "No change, exiting"
exit 0
fi
git commit -F- <<EOF
[bot] Update from tektoncd/pipeline to ${NEW_COMMIT}
$ git diff --stat ${NEW_COMMIT}..${OLD_COMMIT}
$(cat /tmp/diff.txt | sed 's/^/ /')
https://github.com/tektoncd/pipeline/compare/${NEW_COMMIT}..${OLD_COMMIT}
EOF
git push -f origin actions/update/sources-next
if [ "$(gh pr list --base next --head actions/update/sources-next --json url --jq 'length')" = "0" ]; then
echo "creating PR..."
gh pr create -B next -H actions/update/sources-next --label=automated --label=upstream --fill
else
echo "a PR already exists, editing..."
gh pr edit --title "[bot] Update from tektoncd/pipeline to ${NEW_COMMIT}" --body "$(cat /tmp/diff.txt | sed 's/^/ /')"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .konflux/next/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: Application
metadata:
name: tektoncd-pipeline-next
spec:
displayName: tektoncd-pipeline next
18 changes: 18 additions & 0 deletions .konflux/next/component-controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: Component
metadata:
annotations:
build.appstudio.openshift.io/pipeline: '{"name":"docker-build-multi-platform-oci-ta","bundle":"latest"}'
name: tektoncd-pipeline-next-controller
spec:
componentName: controller
application: tektoncd-pipeline-next
build-nudges-ref:
- operator-next-bundle
source:
git:
url: https://github.com/openshift-pipelines/tektoncd-pipeline
dockerfileUrl: .konflux/dockerfiles/controller.Dockerfile
revision: next
18 changes: 18 additions & 0 deletions .konflux/next/component-entrypoint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: Component
metadata:
annotations:
build.appstudio.openshift.io/pipeline: '{"name":"docker-build-multi-platform-oci-ta","bundle":"latest"}'
name: tektoncd-pipeline-next-entrypoint
spec:
componentName: entrypoint
application: tektoncd-pipeline-next
build-nudges-ref:
- operator-next-bundle
source:
git:
url: https://github.com/openshift-pipelines/tektoncd-pipeline
dockerfileUrl: .konflux/dockerfiles/entrypoint.Dockerfile
revision: next
18 changes: 18 additions & 0 deletions .konflux/next/component-events.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: Component
metadata:
annotations:
build.appstudio.openshift.io/pipeline: '{"name":"docker-build-multi-platform-oci-ta","bundle":"latest"}'
name: tektoncd-pipeline-next-events
spec:
componentName: events
application: tektoncd-pipeline-next
build-nudges-ref:
- operator-next-bundle
source:
git:
url: https://github.com/openshift-pipelines/tektoncd-pipeline
dockerfileUrl: .konflux/dockerfiles/events.Dockerfile
revision: next
18 changes: 18 additions & 0 deletions .konflux/next/component-nop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: Component
metadata:
annotations:
build.appstudio.openshift.io/pipeline: '{"name":"docker-build-multi-platform-oci-ta","bundle":"latest"}'
name: tektoncd-pipeline-next-nop
spec:
componentName: nop
application: tektoncd-pipeline-next
build-nudges-ref:
- operator-next-bundle
source:
git:
url: https://github.com/openshift-pipelines/tektoncd-pipeline
dockerfileUrl: .konflux/dockerfiles/nop.Dockerfile
revision: next
18 changes: 18 additions & 0 deletions .konflux/next/component-resolvers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: Component
metadata:
annotations:
build.appstudio.openshift.io/pipeline: '{"name":"docker-build-multi-platform-oci-ta","bundle":"latest"}'
name: tektoncd-pipeline-next-resolvers
spec:
componentName: resolvers
application: tektoncd-pipeline-next
build-nudges-ref:
- operator-next-bundle
source:
git:
url: https://github.com/openshift-pipelines/tektoncd-pipeline
dockerfileUrl: .konflux/dockerfiles/resolvers.Dockerfile
revision: next
18 changes: 18 additions & 0 deletions .konflux/next/component-sidecarlogresults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: Component
metadata:
annotations:
build.appstudio.openshift.io/pipeline: '{"name":"docker-build-multi-platform-oci-ta","bundle":"latest"}'
name: tektoncd-pipeline-next-sidecarlogresults
spec:
componentName: sidecarlogresults
application: tektoncd-pipeline-next
build-nudges-ref:
- operator-next-bundle
source:
git:
url: https://github.com/openshift-pipelines/tektoncd-pipeline
dockerfileUrl: .konflux/dockerfiles/sidecarlogresults.Dockerfile
revision: next
18 changes: 18 additions & 0 deletions .konflux/next/component-webhook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: Component
metadata:
annotations:
build.appstudio.openshift.io/pipeline: '{"name":"docker-build-multi-platform-oci-ta","bundle":"latest"}'
name: tektoncd-pipeline-next-webhook
spec:
componentName: webhook
application: tektoncd-pipeline-next
build-nudges-ref:
- operator-next-bundle
source:
git:
url: https://github.com/openshift-pipelines/tektoncd-pipeline
dockerfileUrl: .konflux/dockerfiles/webhook.Dockerfile
revision: next
18 changes: 18 additions & 0 deletions .konflux/next/component-workingdirinit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: Component
metadata:
annotations:
build.appstudio.openshift.io/pipeline: '{"name":"docker-build-multi-platform-oci-ta","bundle":"latest"}'
name: tektoncd-pipeline-next-workingdirinit
spec:
componentName: workingdirinit
application: tektoncd-pipeline-next
build-nudges-ref:
- operator-next-bundle
source:
git:
url: https://github.com/openshift-pipelines/tektoncd-pipeline
dockerfileUrl: .konflux/dockerfiles/workingdirinit.Dockerfile
revision: next
15 changes: 15 additions & 0 deletions .konflux/next/image-controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: ImageRepository
metadata:
name: tektoncd-pipeline-next-controller
annotations:
image-controller.appstudio.redhat.com/update-component-image: "true"
labels:
appstudio.redhat.com/component: tektoncd-pipeline-next-controller
appstudio.redhat.com/application: tektoncd-pipeline-next
spec:
image:
name: tektoncd-pipeline-next/controller
visibility: public
15 changes: 15 additions & 0 deletions .konflux/next/image-entrypoint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: ImageRepository
metadata:
name: tektoncd-pipeline-next-entrypoint
annotations:
image-controller.appstudio.redhat.com/update-component-image: "true"
labels:
appstudio.redhat.com/component: tektoncd-pipeline-next-entrypoint
appstudio.redhat.com/application: tektoncd-pipeline-next
spec:
image:
name: tektoncd-pipeline-next/entrypoint
visibility: public
15 changes: 15 additions & 0 deletions .konflux/next/image-events.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: ImageRepository
metadata:
name: tektoncd-pipeline-next-events
annotations:
image-controller.appstudio.redhat.com/update-component-image: "true"
labels:
appstudio.redhat.com/component: tektoncd-pipeline-next-events
appstudio.redhat.com/application: tektoncd-pipeline-next
spec:
image:
name: tektoncd-pipeline-next/events
visibility: public
15 changes: 15 additions & 0 deletions .konflux/next/image-nop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: ImageRepository
metadata:
name: tektoncd-pipeline-next-nop
annotations:
image-controller.appstudio.redhat.com/update-component-image: "true"
labels:
appstudio.redhat.com/component: tektoncd-pipeline-next-nop
appstudio.redhat.com/application: tektoncd-pipeline-next
spec:
image:
name: tektoncd-pipeline-next/nop
visibility: public
15 changes: 15 additions & 0 deletions .konflux/next/image-resolvers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: ImageRepository
metadata:
name: tektoncd-pipeline-next-resolvers
annotations:
image-controller.appstudio.redhat.com/update-component-image: "true"
labels:
appstudio.redhat.com/component: tektoncd-pipeline-next-resolvers
appstudio.redhat.com/application: tektoncd-pipeline-next
spec:
image:
name: tektoncd-pipeline-next/resolvers
visibility: public
15 changes: 15 additions & 0 deletions .konflux/next/image-sidecarlogresults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: ImageRepository
metadata:
name: tektoncd-pipeline-next-sidecarlogresults
annotations:
image-controller.appstudio.redhat.com/update-component-image: "true"
labels:
appstudio.redhat.com/component: tektoncd-pipeline-next-sidecarlogresults
appstudio.redhat.com/application: tektoncd-pipeline-next
spec:
image:
name: tektoncd-pipeline-next/sidecarlogresults
visibility: public
15 changes: 15 additions & 0 deletions .konflux/next/image-webhook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generated by openshift-pipelines/hack. DO NOT EDIT.
---
apiVersion: appstudio.redhat.com/v1alpha1
kind: ImageRepository
metadata:
name: tektoncd-pipeline-next-webhook
annotations:
image-controller.appstudio.redhat.com/update-component-image: "true"
labels:
appstudio.redhat.com/component: tektoncd-pipeline-next-webhook
appstudio.redhat.com/application: tektoncd-pipeline-next
spec:
image:
name: tektoncd-pipeline-next/webhook
visibility: public
Loading

0 comments on commit a116cff

Please sign in to comment.