Skip to content

Commit

Permalink
feat: support updatecli compose and pin versions (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Dec 5, 2024
1 parent 9a20164 commit d205bff
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ scms:
kind: github
spec:
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
owner: elastic
repository: opbeans-node
owner: "{{ .scm.owner }}"
repository: "{{ .scm.repository }}"
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
branch: main
branch: "{{ .scm.branch }}"
commitusingapi: true

actions:
Expand All @@ -27,7 +27,6 @@ actions:
- dependencies
- javascript


sources:
elastic-apm-node:
name: Get latest elastic-apm-node version from npm registry
Expand Down
10 changes: 10 additions & 0 deletions .ci/updatecli/values.d/scm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
scm:
enabled: true
owner: elastic
repository: opbeans-node
branch: main
commitusingapi: true
# 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:
- "updatecli-compose.yaml"
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
---
## Workflow to periodically check if there is an available newer APM agent version, e.g.
## "1.2.3". If so, then update to it and tag this repo with that version, e.g.
## "v1.2.3".
name: Bump opbeans node
name: updatecli

on:
workflow_dispatch:
Expand All @@ -11,6 +8,7 @@ on:

permissions:
contents: read
packages: read

jobs:
bump:
Expand All @@ -34,9 +32,23 @@ jobs:
"pull_requests": "write"
}
- uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: elastic/oblt-actions/updatecli/run@v1
with:
command: --experimental compose diff
version-file: .tool-versions
env:
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}

- uses: elastic/oblt-actions/updatecli/run@v1
with:
command: "--experimental apply --config .ci/bump-opbeans-node.yml"
command: --experimental compose apply
version-file: .tool-versions
env:
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}

Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
updatecli v0.88.0
17 changes: 17 additions & 0 deletions updatecli-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Config file for `updatecli compose ...`.
# https://www.updatecli.io/docs/core/compose/
policies:
- name: Local Updatecli Policies
config:
- .ci/updatecli/updatecli.d/
values:
- .ci/updatecli/values.d/scm.yml
- name: Update Updatecli policies
policy: ghcr.io/updatecli/policies/autodiscovery/updatecli:0.8.0@sha256:99e9e61b501575c2c176c39f2275998d198b590a3f6b1fe829f7315f8d457e7f
values:
- .ci/updatecli/values.d/scm.yml
- .ci/updatecli/values.d/update-compose.yml
- name: Update Updatecli version
policy: ghcr.io/elastic/oblt-updatecli-policies/updatecli/version:0.2.0@sha256:013a37ddcdb627c46e7cba6fb9d1d7bc144584fa9063843ae7ee0f6ef26b4bea
values:
- .ci/updatecli/values.d/scm.yml

0 comments on commit d205bff

Please sign in to comment.