Skip to content

Commit 21a8be9

Browse files
authored
updatecli: use shared updatecli policies (#191)
1 parent 3b51885 commit 21a8be9

File tree

6 files changed

+55
-64
lines changed

6 files changed

+55
-64
lines changed

.ci/update-specs.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
spec_path: utils/ecs-logging/spec.json
2+
signedcommit: true

.ci/updatecli/values.d/scm.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
scm:
2+
enabled: true
3+
owner: elastic
4+
repository: ecs-logging-nodejs
5+
branch: main
6+
# begin update-compose policy values
7+
user: obltmachine
8+
9+
# end update-compose policy values
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
spec:
2+
files:
3+
- "update-compose.yaml"

.github/workflows/update-specs.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,35 @@ permissions:
1111
contents: read
1212

1313
jobs:
14-
bump:
14+
compose:
1515
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: read
1619
steps:
20+
- uses: actions/checkout@v4
1721

18-
- uses: actions/checkout@v3
22+
- uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- uses: elastic/oblt-actions/updatecli/run@v1
29+
with:
30+
command: --experimental compose diff
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.UPDATECLI_GH_TOKEN }}
33+
34+
- uses: elastic/oblt-actions/updatecli/run@v1
35+
with:
36+
command: --experimental compose apply
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.UPDATECLI_GH_TOKEN }}
1939

20-
- uses: elastic/apm-pipeline-library/.github/actions/updatecli@current
40+
- if: failure()
41+
uses: elastic/oblt-actions/slack/send@v1
2142
with:
22-
vaultUrl: ${{ secrets.VAULT_ADDR }}
23-
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
24-
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
25-
pipeline: ./.ci/update-specs.yml
43+
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
44+
channel-id: "#apm-agent-nodejs"
45+
message: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, @robots-ci please look what's going on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"

update-compose.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Config file for `updatecli compose ...`.
2+
# https://www.updatecli.io/docs/core/compose/
3+
policies:
4+
- name: Handle ecs-logging specs
5+
policy: ghcr.io/elastic/oblt-updatecli-policies/apm/ecs-logging-specs:0.3.0@sha256:6c765407764d391d6d65b04c54ba409977decc24a000d5b8d7839f58bcd07c5b
6+
values:
7+
- .ci/updatecli/values.d/scm.yml
8+
- .ci/updatecli/values.d/ecs-logging-specs.yml
9+
10+
- name: Update Updatecli policies
11+
policy: ghcr.io/updatecli/policies/autodiscovery/updatecli:0.4.0@sha256:254367f5b1454fd6032b88b314450cd3b6d5e8d5b6c953eb242a6464105eb869
12+
values:
13+
- .ci/updatecli/values.d/scm.yml
14+
- .ci/updatecli/values.d/update-compose.yml

0 commit comments

Comments
 (0)