-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: workflows to dependencies [skip ci]
- Loading branch information
1 parent
dcaa970
commit 6d2c441
Showing
8 changed files
with
217 additions
and
13 deletions.
There are no files selected for viewing
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
sources: | ||
elasticsearch: | ||
kind: helmchart | ||
spec: | ||
url: https://charts.bitnami.com/bitnami | ||
name: elasticsearch | ||
versionFilter: | ||
kind: semver | ||
pattern: '*' # replace with CI/CD updatecli | ||
sourceid: elasticsearch | ||
minio: | ||
kind: helmchart | ||
spec: | ||
url: https://charts.bitnami.com/bitnami | ||
name: minio | ||
versionFilter: | ||
kind: semver | ||
pattern: '*' # replace with CI/CD updatecli | ||
sourceid: minio | ||
opensearch: | ||
kind: helmchart | ||
spec: | ||
url: https://opensearch-project.github.io/helm-charts/ | ||
name: opensearch | ||
versionFilter: | ||
kind: semver | ||
pattern: '*' # replace with CI/CD updatecli | ||
sourceid: opensearch | ||
rabbitmq: | ||
kind: helmchart | ||
spec: | ||
url: https://charts.bitnami.com/bitnami | ||
name: rabbitmq | ||
versionFilter: | ||
kind: semver | ||
pattern: '*' # replace with CI/CD updatecli | ||
sourceid: rabbitmq | ||
redis: | ||
kind: helmchart | ||
spec: | ||
url: https://charts.bitnami.com/bitnami | ||
name: redis | ||
versionFilter: | ||
kind: semver | ||
pattern: '*' # replace with CI/CD updatecli | ||
sourceid: redis | ||
conditions: {} | ||
targets: | ||
elasticsearch: | ||
name: bump chart dependencies | ||
kind: yaml | ||
spec: | ||
file: charts/opencti/Chart.yaml | ||
key: $.dependencies[0].version | ||
sourceid: elasticsearch | ||
minio: | ||
name: bump chart dependencies | ||
kind: yaml | ||
spec: | ||
file: charts/opencti/Chart.yaml | ||
key: $.dependencies[1].version | ||
sourceid: minio | ||
opensearch: | ||
name: bump chart dependencies | ||
kind: yaml | ||
spec: | ||
file: charts/opencti/Chart.yaml | ||
key: $.dependencies[2].version | ||
sourceid: opensearch | ||
rabbitmq: | ||
name: bump chart dependencies | ||
kind: yaml | ||
spec: | ||
file: charts/opencti/Chart.yaml | ||
key: $.dependencies[3].version | ||
sourceid: rabbitmq | ||
redis: | ||
name: bump chart dependencies | ||
kind: yaml | ||
spec: | ||
file: charts/opencti/Chart.yaml | ||
key: $.dependencies[4].version | ||
sourceid: redis |
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,60 @@ | ||
name: Check OpenCTI major dependencies releases | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 1 * *' # first day of month | ||
|
||
jobs: | ||
check-and-update-major-dependencies: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Prepare updatecli configuration | ||
id: dependencies | ||
run: | | ||
# get name dependencies | ||
dependencies=($(yq eval -o=json '.dependencies[] | .name' charts/opencti/Chart.yaml | xargs)) | ||
# replace version | ||
for dependency in "${dependencies[@]}"; do | ||
yq eval -i ".sources.${dependency}.spec.versionFilter.pattern = \"*\"" .github/updatecli/helm-dependencies.yaml | ||
done | ||
- name: Install updatecli | ||
uses: updatecli/updatecli-action@v2 | ||
|
||
- name: Update dependencies | ||
run: | | ||
updatecli apply --config .github/updatecli/helm-dependencies.yaml --commit=false 2>&1 | tee > tmp-major-output.log | ||
awk '/TARGETS/{flag=1;next}/ACTIONS/{flag=0}flag' tmp-major-output.log > major-output.log | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- name: Update README.md Helm Chart | ||
uses: losisin/helm-docs-github-action@v1 | ||
with: | ||
chart-search-root: charts/opencti | ||
|
||
- name: Get current date | ||
id: date | ||
run: | | ||
echo "date=$(date -I)" >> $GITHUB_OUTPUT | ||
- name: Create PR with changes | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
add-paths: charts/opencti | ||
token: ${{ secrets.PAT_GITHUB }} | ||
commit-message: "fix: update mayor dependencies version" | ||
signoff: false | ||
branch: fix/upgrade-opencti-major-dependencies-${{ steps.date.outputs.date }} | ||
delete-branch: true | ||
title: '[opencti] upgrade major dependencies (${{ steps.date.outputs.date }})' | ||
body-path: major-output.log | ||
labels: | | ||
auto-pr-bump-version |
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,61 @@ | ||
name: Check OpenCTI minor dependencies releases | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * 1' # every monday | ||
|
||
jobs: | ||
check-and-update-minor-dependencies: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Prepare updatecli configuration | ||
id: dependencies | ||
run: | | ||
# get name dependencies | ||
dependencies=($(yq eval -o=json '.dependencies[] | .name' charts/opencti/Chart.yaml | xargs)) | ||
# replace version | ||
for dependency in "${dependencies[@]}"; do | ||
version="~$(yq eval -r ".dependencies[] | select(.name == \"${dependency}\") | .version" charts/opencti/Chart.yaml | cut -d'.' -f1)" | ||
yq eval -i ".sources.${dependency}.spec.versionFilter.pattern = \"${version}\"" .github/updatecli/helm-dependencies.yaml | ||
done | ||
- name: Install updatecli | ||
uses: updatecli/updatecli-action@v2 | ||
|
||
- name: Update dependencies | ||
run: | | ||
updatecli apply --config .github/updatecli/helm-dependencies.yaml --commit=false 2>&1 | tee > tmp-minor-output.log | ||
awk '/TARGETS/{flag=1;next}/ACTIONS/{flag=0}flag' tmp-minor-output.log > minor-output.log | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- name: Update README.md Helm Chart | ||
uses: losisin/helm-docs-github-action@v1 | ||
with: | ||
chart-search-root: charts/opencti | ||
|
||
- name: Get current date | ||
id: date | ||
run: | | ||
echo "date=$(date -I)" >> $GITHUB_OUTPUT | ||
- name: Create PR with changes | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
add-paths: charts/opencti | ||
token: ${{ secrets.PAT_GITHUB }} | ||
commit-message: "fix: update minor dependencies version" | ||
signoff: false | ||
branch: fix/upgrade-opencti-minor-dependencies-${{ steps.date.outputs.date }} | ||
delete-branch: true | ||
title: '[opencti] upgrade minor dependencies (${{ steps.date.outputs.date }})' | ||
body-path: minor-output.log | ||
labels: | | ||
auto-pr-bump-version |
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
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 |
---|---|---|
|
@@ -60,7 +60,7 @@ jobs: | |
uses: helm/[email protected] | ||
with: | ||
charts_dir: charts | ||
config: cr.yaml | ||
config: .github/cr.yaml | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
CR_SKIP_EXISTING: true | ||
|