Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 0 additions & 143 deletions .ci/bump-golang.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ scms:
githubConfig:
kind: github
spec:
user: '{{ requiredEnv "GIT_USER" }}'
email: '{{ requiredEnv "GIT_EMAIL" }}'
owner: elastic
repository: elastic-agent
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
owner: '{{ .scm.owner }}'
repository: '{{ .scm.repository }}'
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GIT_USER" }}'
commitusingapi: true
branch: main

actions:
Expand Down Expand Up @@ -124,12 +124,21 @@ targets:
- Dockerfile
- Dockerfile.skaffold
matchpattern: 'ARG GO_VERSION=\d+.\d+.\d+'
update-gomod:
name: "Update go.mod"
update-gomod-minor-version:
name: "Update go.mod minor version"
sourceid: gomod
scmid: githubConfig
kind: file
spec:
content: 'go {{ source "gomod" }}'
file: go.mod
matchpattern: 'go \d+.\d+'
update-gomod-toolchain-version:
name: "Update go.mod toolchain version"
sourceid: latestGoVersion
scmid: githubConfig
kind: file
spec:
content: 'toolchain go{{ source "latestGoVersion" }}'
file: go.mod
matchpattern: 'toolchain go\d+.\d+.\d+'
5 changes: 5 additions & 0 deletions .ci/updatecli/values.d/ironbank.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config:
- path: dev-tools/packaging/templates/ironbank
dockerfile: Dockerfile.tmpl
manifest: hardening_manifest.yaml.tmpl
packages: dev-tools/packaging/packages.yml
Comment thread
v1v marked this conversation as resolved.
Outdated
14 changes: 14 additions & 0 deletions .ci/updatecli/values.d/scm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
scm:
enabled: true
owner: elastic
repository: elastic-agent
branch: main
# begin updatecli-compose policy values
user: 'github-actions[bot]'
email: '41898282+github-actions[bot]@users.noreply.github.com'
commitusingapi: true
# end updatecli-compose policy values

# This will be moved to the scm section in the future and use
# commitusingapi instead.
signedcommit: true
Comment thread
v1v marked this conversation as resolved.
Outdated
3 changes: 3 additions & 0 deletions .ci/updatecli/values.d/updatecli-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
spec:
files:
- "updatecli-compose.yaml"
4 changes: 1 addition & 3 deletions .github/workflows/bump-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ jobs:
uses: updatecli/updatecli-action@d0950ebbe80f4f80c3392b288d6a218fae872f69 # v0.76.1

- name: Run Updatecli in Apply mode
run: updatecli apply --config .github/updatecli-bump-golang.yml
run: updatecli apply --config .ci/updatecli/updatecli-bump-golang.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_USER: "github-actions[bot]"
GIT_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"

- if: ${{ failure() }}
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/updatecli-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
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 }}`, `@agent-team` please look what's going on <${{ env.JOB_URL }}|here>"
14 changes: 14 additions & 0 deletions updatecli-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 ironbank bumps
policy: ghcr.io/elastic/oblt-updatecli-policies/ironbank/templates:0.1.0@sha256:327ee971e3a974edc943f7f628145a47b202972f48e45c2054fddcd29f96a50a
Comment thread
v1v marked this conversation as resolved.
Outdated
values:
- .ci/updatecli/values.d/scm.yml
- .ci/updatecli/values.d/ironbank.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/updatecli-compose.yml