-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36b14e6
commit 99416d0
Showing
10 changed files
with
244 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/operator | ||
run: | | ||
rm -fR upstream | ||
git clone https://github.com/tektoncd/operator upstream | ||
pushd upstream | ||
git checkout -B main origin/main | ||
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/operator to ${NEW_COMMIT} | ||
$ git diff --stat ${NEW_COMMIT}..${OLD_COMMIT} | ||
$(cat /tmp/diff.txt | sed 's/^/ /') | ||
https://github.com/tektoncd/operator/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/operator to ${NEW_COMMIT}" --body "$(cat /tmp/diff.txt | sed 's/^/ /')" | ||
fi | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: operator-next | ||
spec: | ||
displayName: operator next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: operator-next-operator | ||
spec: | ||
componentName: operator | ||
application: operator-next | ||
build-nudges-ref: | ||
- operator-next-bundle | ||
source: | ||
git: | ||
url: https://github.com/openshift-pipelines/operator | ||
dockerfileUrl: .konflux/dockerfiles/operator.Dockerfile | ||
revision: next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: operator-next-proxy | ||
spec: | ||
componentName: proxy | ||
application: operator-next | ||
build-nudges-ref: | ||
- operator-next-bundle | ||
source: | ||
git: | ||
url: https://github.com/openshift-pipelines/operator | ||
dockerfileUrl: .konflux/dockerfiles/proxy.Dockerfile | ||
revision: next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: operator-next-webhook | ||
spec: | ||
componentName: webhook | ||
application: operator-next | ||
build-nudges-ref: | ||
- operator-next-bundle | ||
source: | ||
git: | ||
url: https://github.com/openshift-pipelines/operator | ||
dockerfileUrl: .konflux/dockerfiles/webhook.Dockerfile | ||
revision: next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: operator-next-operator | ||
annotations: | ||
image-controller.appstudio.redhat.com/update-component-image: "true" | ||
labels: | ||
appstudio.redhat.com/component: operator-next-operator | ||
appstudio.redhat.com/application: operator-next | ||
spec: | ||
image: | ||
name: operator-next/operator | ||
visibility: public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: operator-next-proxy | ||
annotations: | ||
image-controller.appstudio.redhat.com/update-component-image: "true" | ||
labels: | ||
appstudio.redhat.com/component: operator-next-proxy | ||
appstudio.redhat.com/application: operator-next | ||
spec: | ||
image: | ||
name: operator-next/proxy | ||
visibility: public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: operator-next-webhook | ||
annotations: | ||
image-controller.appstudio.redhat.com/update-component-image: "true" | ||
labels: | ||
appstudio.redhat.com/component: operator-next-webhook | ||
appstudio.redhat.com/application: operator-next | ||
spec: | ||
image: | ||
name: operator-next/webhook | ||
visibility: public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by openshift-pipelines/hack. DO NOT EDIT. | ||
--- | ||
apiVersion: appstudio.redhat.com/v1beta2 | ||
kind: IntegrationTestScenario | ||
metadata: | ||
name: operator-next-enterprise-contract | ||
spec: | ||
application: operator-next | ||
contexts: | ||
- description: Application testing | ||
name: application | ||
params: | ||
- name: POLICY_CONFIGURATION | ||
value: tekton-ecosystem-tenant/tekton-ecosystem-tenant-containers | ||
- name: TIMEOUT | ||
value: "15m0s" | ||
resolverRef: | ||
params: | ||
- name: url | ||
value: "https://github.com/konflux-ci/build-definitions" | ||
- name: revision | ||
value: main | ||
- name: pathInRepo | ||
value: pipelines/enterprise-contract.yaml | ||
resolver: git |