Skip to content

Commit

Permalink
updatecli: use shared updatecli policies (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Jul 10, 2024
1 parent 7dfbd11 commit 584bd10
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 65 deletions.
57 changes: 0 additions & 57 deletions .ci/update-specs.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .ci/updatecli/values.d/ecs-logging-specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
spec_path: ecs-logging-core/src/test/resources/spec/spec.json
signedcommit: true
9 changes: 9 additions & 0 deletions .ci/updatecli/values.d/scm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
scm:
enabled: true
owner: elastic
repository: ecs-logging-java
branch: main
# begin update-compose policy values
user: obltmachine
email: [email protected]
# end update-compose policy values
3 changes: 3 additions & 0 deletions .ci/updatecli/values.d/update-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
spec:
files:
- "update-compose.yaml"
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
---
# Send PRs to the subscribed ECS Agents if the spec files (JSON) are modified
name: update-specs
name: updatecli

on:
workflow_dispatch:
workflow_dispatch: ~
schedule:
- cron: '0 6 * * *'

permissions:
contents: read

jobs:
bump:
compose:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
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.UPDATECLI_GH_TOKEN }}

- uses: elastic/oblt-actions/updatecli/run@v1
with:
command: "--experimental apply --config .ci/update-specs.yml"
command: --experimental compose apply
env:
GITHUB_TOKEN: ${{ secrets.UPDATECLI_GH_TOKEN }}

- if: failure()
uses: elastic/oblt-actions/slack/send@v1.2.0
uses: elastic/oblt-actions/slack/send@v1
with:
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: "#apm-agent-java"
Expand Down
14 changes: 14 additions & 0 deletions update-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Config file for `updatecli compose ...`.
# https://www.updatecli.io/docs/core/compose/
policies:
- name: Handle ecs-logging specs
policy: ghcr.io/elastic/oblt-updatecli-policies/apm/ecs-logging-specs:0.3.0@sha256:6c765407764d391d6d65b04c54ba409977decc24a000d5b8d7839f58bcd07c5b
values:
- .ci/updatecli/values.d/scm.yml
- .ci/updatecli/values.d/ecs-logging-specs.yml

- name: Update Updatecli policies
policy: ghcr.io/updatecli/policies/autodiscovery/updatecli:0.4.0@sha256:254367f5b1454fd6032b88b314450cd3b6d5e8d5b6c953eb242a6464105eb869
values:
- .ci/updatecli/values.d/scm.yml
- .ci/updatecli/values.d/update-compose.yml

0 comments on commit 584bd10

Please sign in to comment.