diff --git a/.github/workflows/bump-elastic-stack-snapshot.yml b/.github/workflows/bump-elastic-stack-snapshot.yml index 645d0526334..e38c5c7e7c4 100644 --- a/.github/workflows/bump-elastic-stack-snapshot.yml +++ b/.github/workflows/bump-elastic-stack-snapshot.yml @@ -35,7 +35,7 @@ jobs: uses: updatecli/updatecli-action@a0c478c868a71d3e239a65714de69450aa1ee2c6 # v0.76.1 - name: Run Updatecli in Apply mode - run: updatecli --experimental apply --config .github/workflows/updatecli.d/bump-elastic-stack-snapshot.yml --values .github/workflows/updatecli.d/scm.yml + run: updatecli --experimental apply --config .github/workflows/updatecli.d/bump-elastic-stack-snapshot.yml --values .github/workflows/updatecli.d/values.d/scm.yml env: BRANCH: ${{ matrix.branch }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/bump-golang.yml b/.github/workflows/bump-golang.yml index 90b67206197..5eba5b83044 100644 --- a/.github/workflows/bump-golang.yml +++ b/.github/workflows/bump-golang.yml @@ -26,7 +26,7 @@ jobs: uses: updatecli/updatecli-action@a0c478c868a71d3e239a65714de69450aa1ee2c6 # v0.76.1 - name: Run Updatecli in Apply mode - run: updatecli --experimental apply --config .github/workflows/updatecli.d/${{ matrix.file }} --values .github/workflows/updatecli.d/scm.yml + run: updatecli --experimental apply --config .github/workflows/updatecli.d/${{ matrix.file }} --values .github/workflows/updatecli.d/values.d/scm.yml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/updatecli-compose.yml b/.github/workflows/updatecli-compose.yml new file mode 100644 index 00000000000..f8a94e77ff8 --- /dev/null +++ b/.github/workflows/updatecli-compose.yml @@ -0,0 +1,60 @@ +--- +name: updatecli-compose + +on: + workflow_dispatch: + schedule: + - cron: '0 6 * * *' + +permissions: + contents: read + +jobs: + compose: + runs-on: ubuntu-latest + permissions: + contents: write + packages: read + pull-requests: write + steps: + - uses: actions/checkout@v4 + + - uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: elastic/oblt-actions/updatecli/run@v1 + with: + command: --experimental compose diff + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: elastic/oblt-actions/updatecli/run@v1 + with: + command: --experimental compose apply + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - if: ${{ failure() }} + uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0 + with: + channel-id: '#ingest-notifications' + payload: | + { + "text": "${{ env.SLACK_MESSAGE }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "${{ env.SLACK_MESSAGE }}" + } + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + SLACK_MESSAGE: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@update-me-with-the-slack-team-to-be-poked` please look what's going on " + \ No newline at end of file diff --git a/.github/workflows/updatecli.d/scm.yml b/.github/workflows/updatecli.d/scm.yml deleted file mode 100644 index fd532f00f61..00000000000 --- a/.github/workflows/updatecli.d/scm.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -scm: - owner: elastic - repository: beats diff --git a/.github/workflows/updatecli.d/values.d/ironbank.yml b/.github/workflows/updatecli.d/values.d/ironbank.yml new file mode 100644 index 00000000000..9ad7ce17e95 --- /dev/null +++ b/.github/workflows/updatecli.d/values.d/ironbank.yml @@ -0,0 +1,7 @@ +config: + - path: dev-tools/packaging/templates/ironbank/auditbeat + - path: dev-tools/packaging/templates/ironbank/filebeat + - path: dev-tools/packaging/templates/ironbank/heartbeat + - path: dev-tools/packaging/templates/ironbank/metricbeat + - path: dev-tools/packaging/templates/ironbank/packetbeat + - beats_packages: dev-tools/packaging/packages.yml diff --git a/.github/workflows/updatecli.d/values.d/scm.yml b/.github/workflows/updatecli.d/values.d/scm.yml new file mode 100644 index 00000000000..69a2f2dfb14 --- /dev/null +++ b/.github/workflows/updatecli.d/values.d/scm.yml @@ -0,0 +1,11 @@ +scm: + enabled: true + owner: elastic + repository: beats + branch: main + commitusingapi: true + # begin updatecli-compose policy values + user: 'github-actions[bot]' + email: '41898282+github-actions[bot]@users.noreply.github.com' + # end updatecli-compose policy values + diff --git a/.github/workflows/updatecli.d/values.d/updatecli-compose.yml b/.github/workflows/updatecli.d/values.d/updatecli-compose.yml new file mode 100644 index 00000000000..02df609f2a3 --- /dev/null +++ b/.github/workflows/updatecli.d/values.d/updatecli-compose.yml @@ -0,0 +1,3 @@ +spec: + files: + - "updatecli-compose.yaml" \ No newline at end of file diff --git a/updatecli-compose.yaml b/updatecli-compose.yaml new file mode 100644 index 00000000000..9aa8ad02032 --- /dev/null +++ b/updatecli-compose.yaml @@ -0,0 +1,14 @@ +# Config file for `updatecli compose ...`. +# https://www.updatecli.io/docs/core/compose/ +policies: + - name: Handle ironbank bumps + policy: ghcr.io/elastic/oblt-updatecli-policies/ironbank/templates:0.3.0@sha256:b0c841d8fb294e6b58359462afbc83070dca375ac5dd0c5216c8926872a98bb1 + values: + - .github/workflows/updatecli.d/values.d/scm.yml + - .github/workflows/updatecli.d/values.d/ironbank.yml + + - name: Update Updatecli policies + policy: ghcr.io/updatecli/policies/autodiscovery/updatecli:0.4.0@sha256:254367f5b1454fd6032b88b314450cd3b6d5e8d5b6c953eb242a6464105eb869 + values: + - .github/workflows/updatecli.d/values.d/scm.yml + - .github/workflows/updatecli.d/values.d/updatecli-compose.yml \ No newline at end of file