-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed not yet existing operator path (#1016)
* fixed not yet existing operator path * use pr action instead of shell * fixed docs for vmagent * fixed tag name for config-reloader * remove certified operator repo as not supported atm * fixed typo --------- Co-authored-by: Nikolay <[email protected]>
- Loading branch information
1 parent
0c311bb
commit b6ed072
Showing
8 changed files
with
322 additions
and
339 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 |
---|---|---|
|
@@ -17,15 +17,15 @@ jobs: | |
repository: VictoriaMetrics/operator | ||
ref: master | ||
token: ${{ secrets.VM_BOT_GH_TOKEN }} | ||
path: "__vm-operator-repo" | ||
path: __vm-operator-repo | ||
|
||
- name: Check out VM code | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: VictoriaMetrics/helm-charts | ||
ref: master | ||
token: ${{ secrets.VM_BOT_GH_TOKEN }} | ||
path: "__vm-charts-repo" | ||
path: __vm-charts-repo | ||
|
||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
|
@@ -34,24 +34,25 @@ jobs: | |
passphrase: ${{ secrets.VM_BOT_PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
workdir: "__vm-charts-repo" | ||
workdir: __vm-charts-repo | ||
|
||
- name: Update crd yaml in chart repo | ||
run: | | ||
cp config/crd/overlay/crd.yaml ../__vm-charts-repo/charts/victoria-metrics-operator/crd.yaml | ||
cp config/crd/overlay/crd.yaml ../__vm-charts-repo/charts/victoria-metrics-k8s-stack/charts/crds/crds/crd.yaml | ||
working-directory: "__vm-operator-repo" | ||
cp ../__vm-operator-repo/config/crd/overlay/crd.yaml charts/victoria-metrics-operator/crd.yaml | ||
cp ../__vm-operator-repo/config/crd/overlay/crd.yaml charts/victoria-metrics-k8s-stack/charts/crds/crds/crd.yaml | ||
echo "BUILDTIME=$(date +%s)" >> $GITHUB_OUTPUT | ||
echo "SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT | ||
working-directory: __vm-charts-repo | ||
|
||
- name: Commit and push changes | ||
run: | | ||
export VM_GIT_BRANCH_NAME="operator-crds-update-$(date +%s)" | ||
export VM_GIT_COMMIT_SHA="$(git rev-parse --short $GITHUB_SHA)" | ||
git checkout -b "${VM_GIT_BRANCH_NAME}" | ||
git add charts/victoria-metrics-operator/crd.yaml | ||
git add charts/victoria-metrics-k8s-stack/charts/crds/crds/crd.yaml | ||
git commit -S -m "Automatic sync crd resources from ${GITHUB_REPOSITORY}@${VM_GIT_COMMIT_SHA}" | ||
git push origin ${VM_GIT_BRANCH_NAME} | ||
gh pr create -f | ||
working-directory: "__vm-charts-repo" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.VM_BOT_GH_TOKEN }} | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
add-paths: charts | ||
commit-message: Automatic update operator crds from ${{ github.repository }}@${{ steps.update.outputs.SHORT_SHA }} | ||
signoff: true | ||
author: Github Actions <[email protected]> | ||
path: __vm-charts-repo | ||
branch: operator-crd-update-${{ steps.update.outputs.BUILDTIME }} | ||
token: ${{ secrets.VM_BOT_GH_TOKEN }} | ||
delete-branch: true | ||
title: Automatic update operator crds from ${{ github.repository }}@${{ steps.update.outputs.SHORT_SHA }} |
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 |
---|---|---|
|
@@ -18,15 +18,15 @@ jobs: | |
repository: VictoriaMetrics/operator | ||
ref: master | ||
token: ${{ secrets.VM_BOT_GH_TOKEN }} | ||
path: "__vm-operator-repo" | ||
path: __vm-operator-repo | ||
|
||
- name: Check out VM code | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: VictoriaMetrics/VictoriaMetrics | ||
ref: master | ||
token: ${{ secrets.VM_BOT_GH_TOKEN }} | ||
path: "__vm-docs-repo" | ||
path: __vm-docs-repo | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
|
@@ -41,41 +41,27 @@ jobs: | |
passphrase: ${{ secrets.VM_BOT_PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
workdir: "__vm-docs-repo" | ||
|
||
- name: Generate vars and api doc | ||
run: | | ||
make docs | ||
working-directory: "__vm-operator-repo" | ||
workdir: __vm-docs-repo | ||
|
||
- name: Update operator docs in VM repo | ||
id: update | ||
run: | | ||
# Markdown files | ||
for md in $(find docs -name '*.md'); do | ||
newmd=$(echo $md | sed -e 's/^docs\//&operator\//g') | ||
mkdir -p ../__vm-docs-repo/$(dirname $newmd) | ||
cat $md > ../__vm-docs-repo/$newmd | ||
done | ||
# Pictures | ||
for png in $(find docs -name '*.png'); do | ||
newpng=$(echo $png | sed -e 's/^docs\//&operator\//g') | ||
mkdir -p ../__vm-docs-repo/$(dirname $newpng) | ||
\cp -f $png ../__vm-docs-repo/$newpng | ||
done | ||
# Autogenerated files | ||
cat ./docs/vars.md > ../__vm-docs-repo/docs/operator/vars.md | ||
cat ./docs/api.md > ../__vm-docs-repo/docs/operator/api.md | ||
working-directory: "__vm-operator-repo" | ||
make docs | ||
# Sync markdown files and pictures | ||
rsync -zarv --include="*/" --include="*.png" --include="*.md" --exclude="*" docs/ ../__vm-docs-repo/docs/operator/ | ||
echo "BUILDTIME=$(date +%s)" >> $GITHUB_OUTPUT | ||
echo "SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT | ||
working-directory: __vm-operator-repo | ||
|
||
- name: Commit and push changes | ||
run: | | ||
export VM_GIT_BRANCH_NAME="operator-docs-update-$(date +%s)" | ||
export VM_GIT_COMMIT_SHA="$(git rev-parse --short $GITHUB_SHA)" | ||
git checkout -b "${VM_GIT_BRANCH_NAME}" | ||
git add docs/operator | ||
git commit -S -m "Automatic update operator docs from ${GITHUB_REPOSITORY}@${VM_GIT_COMMIT_SHA}" | ||
git push origin ${VM_GIT_BRANCH_NAME} | ||
gh pr create -f | ||
working-directory: "__vm-docs-repo" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.VM_BOT_GH_TOKEN }} | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
add-paths: docs/operator | ||
commit-message: Automatic update operator docs from ${{ github.repository }}@${{ steps.update.outputs.SHORT_SHA }} | ||
signoff: true | ||
author: Github Actions <[email protected]> | ||
path: __vm-docs-repo | ||
branch: operator-docs-update-${{ steps.update.outputs.BUILDTIME }} | ||
token: ${{ secrets.VM_BOT_GH_TOKEN }} | ||
delete-branch: true | ||
title: Automatic update operator docs from ${{ github.repository }}@${{ steps.update.outputs.SHORT_SHA }} |
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 |
---|---|---|
|
@@ -19,8 +19,6 @@ jobs: | |
upstream: k8s-operatorhub/community-operators | ||
- fork: VictoriaMetrics/openshift-community-operators-prod | ||
upstream: redhat-openshift-ecosystem/community-operators-prod | ||
- fork: VictoriaMetrics/openshift-certified-operators | ||
upstream: redhat-openshift-ecosystem/certified-operators | ||
steps: | ||
- name: Check out OperatorHub operators repo fork | ||
uses: actions/checkout@v4 | ||
|
@@ -52,21 +50,22 @@ jobs: | |
run: | | ||
VERSION=$(ls bundle | head -1) | ||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | ||
mkdir -p __k8s-operatorhub-repo/operators/victoriametrics-operator | ||
mv bundle/* __k8s-operatorhub-repo/operators/victoriametrics-operator/ | ||
# temporary disable. Uncomment after changes to operatorhub ci procedure. | ||
# - name: Create Pull Request | ||
# uses: peter-evans/create-pull-request@v6 | ||
# with: | ||
# add-paths: operators/victoriametrics-operator | ||
# signoff: true | ||
# author: Github Actions <[email protected]> | ||
# path: __k8s-operatorhub-repo | ||
# push-to-fork: ${{ matrix.repo.fork }} | ||
# branch: vm-operator-release-${{ steps.update.outputs.VERSION }} | ||
# token: ${{ secrets.VM_BOT_GH_TOKEN }} | ||
# delete-branch: true | ||
# title: "victoriametrics-operator: update operator ${{ steps.update.outputs.VERSION }}" | ||
# body: | | ||
# Added OLM package for [VictoriaMetrics operator ${{ steps.update.outputs.VERSION }}"](https://github.com/VictoriaMetrics/operator/releases/tag/v${{ steps.update.outputs.VERSION }}) | ||
# > Auto-generated by `Github Actions Bot` | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
add-paths: operators/victoriametrics-operator | ||
commit-message: victoriametrics-operator: ${{ steps.update.outputs.VERSION }} | ||
signoff: true | ||
author: Github Actions <[email protected]> | ||
path: __k8s-operatorhub-repo | ||
push-to-fork: ${{ matrix.repo.fork }} | ||
branch: vm-operator-release-${{ steps.update.outputs.VERSION }} | ||
token: ${{ secrets.VM_BOT_GH_TOKEN }} | ||
delete-branch: true | ||
title: victoriametrics-operator: (${{ steps.update.outputs.VERSION }}) | ||
body: | | ||
Added OLM package for [VictoriaMetrics operator ${{ steps.update.outputs.VERSION }}"](https://github.com/VictoriaMetrics/operator/releases/tag/v${{ steps.update.outputs.VERSION }}) | ||
> Auto-generated by `Github Actions Bot` |
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
repository: VictoriaMetrics/ops | ||
ref: main | ||
token: ${{ secrets.VM_BOT_GH_TOKEN }} | ||
path: "__vm-ops-repo" | ||
path: __vm-ops-repo | ||
|
||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
|
@@ -27,30 +27,31 @@ jobs: | |
passphrase: ${{ secrets.VM_BOT_PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
workdir: "__vm-ops-repo" | ||
workdir: __vm-ops-repo | ||
|
||
- name: Update operator version on sandbox | ||
id: update | ||
run: | | ||
export VM_GIT_COMMIT_SHA="$(git rev-parse --short $GITHUB_SHA)" | ||
export VM_SANDBOX_OPERATOR_PATH="gcp-test/sandbox/manifests/applications/vm-operator.yaml" | ||
yq -i 'with(.spec.source.helm.values; . = (. | from_yaml | .image.tag = strenv(VM_GIT_COMMIT_SHA) | to_yaml))' $VM_SANDBOX_OPERATOR_PATH | ||
git add $VM_SANDBOX_OPERATOR_PATH | ||
git commit -S -m "Automatic update operator version on sandbox from ${GITHUB_REPOSITORY}@${VM_GIT_COMMIT_SHA}" | ||
export SHORT_SHA=$(git rev-parse --short $GITHUB_SHA) | ||
export OPERATOR_PATH=gcp-test/sandbox/manifests/applications/vm-operator.yaml | ||
yq -i '.spec.source.helm.valuesObject.image.tag = strenv(SHORT_SHA)' $OPERATOR_PATH | ||
echo "IMAGE_TAG=$VM_GIT_COMMIT_SHA" >> $GITHUB_OUTPUT | ||
working-directory: "__vm-ops-repo" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.VM_BOT_GH_TOKEN }} | ||
echo "SHORT_SHA=$SHORT_SHA" >> $GITHUB_OUTPUT | ||
echo "OPERATOR_PATH=$OPERATOR_PATH" >> $GITHUB_OUTPUT | ||
working-directory: __vm-ops-repo | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
add-paths: ${{ steps.update.outputs.OPERATOR_PATH }} | ||
commit-message: Automatic update operator version on sandbox from ${{ github.repository }}@${{ steps.update.outputs.SHORT_SHA }} | ||
signoff: true | ||
author: Github Actions <[email protected]> | ||
path: __vm-ops-repo | ||
branch: sandbox-operator-release-automation | ||
token: ${{ secrets.VM_BOT_GH_TOKEN }} | ||
delete-branch: true | ||
title: "sandbox: update operator ${{ steps.update.outputs.IMAGE_TAG }}" | ||
title: sandbox: update operator ${{ steps.update.outputs.IMAGE_TAG }} | ||
body: | | ||
Deploy [${{ steps.update.outputs.IMAGE_TAG }}"](https://github.com/VictoriaMetrics/operator/commit/${{ steps.update.outputs.IMAGE_TAG }}) to sandbox | ||
> Auto-generated by `Github Actions Bot` |
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
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
Oops, something went wrong.