Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
93 changes: 93 additions & 0 deletions .ci/bump-opbeans-ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
## Workflow to periodically check if there is an available newer APM agent version, e.g.
## "1.2.3". If so, then update to it.
name: Bump elastic-apm to latest version

title: Bump elastic-apm to latest version

scms:
elastic-apm-agent-ruby:
kind: github
spec:
user: '{{ requiredEnv "GIT_USER" }}'
email: '{{ requiredEnv "GIT_EMAIL" }}'
owner: elastic
repository: apm-agent-ruby
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GIT_USER" }}'
branch: main
githubConfig:
kind: github
spec:
user: '{{ requiredEnv "GIT_USER" }}'
email: '{{ requiredEnv "GIT_EMAIL" }}'
owner: elastic
repository: opbeans-ruby
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GIT_USER" }}'
branch: main

actions:
opbeans-ruby:
kind: github/pullrequest
scmid: githubConfig
spec:
automerge: false
labels:
- dependencies

sources:
elastic-apm-agent-ruby:
scmid: elastic-apm-agent-ruby
kind: gittag
spec:
versionfilter:
kind: semver
transformers:
- trimprefix: "v"

targets:
dockerfile-label-schema:
name: Set org.label-schema.version in Dockerfile
sourceid: elastic-apm-agent-ruby
scmid: githubConfig
kind: file
spec:
file: Dockerfile
matchpattern: >-
org\.label-schema\.version="(\d+.\d+.\d+)"
replacepattern: >-
org.label-schema.version="{{ source `elastic-apm-agent-ruby` }}"
dockerfile-opencontainers:
name: Set org.opencontainers.image.version in Dockerfile
sourceid: elastic-apm-agent-ruby
scmid: githubConfig
kind: file
spec:
file: Dockerfile
matchpattern: >-
org\.opencontainers\.image\.version="(\d+.\d+.\d+)"
replacepattern: >-
org.opencontainers.image.version="{{ source `elastic-apm-agent-ruby` }}"
gemfile:
name: Install new elastic-apm pip dependency version
sourceid: elastic-apm-agent-ruby
scmid: githubConfig
kind: file
spec:
file: Gemfile
matchpattern: >-
gem 'elastic-apm', '\d+\.\d+\.\d+'
replacepattern: >-
gem 'elastic-apm', '{{ source `elastic-apm-agent-ruby` }}'
gem:
dependson:
- gemfile
name: Bump elastic-apm
sourceid: elastic-apm-agent-ruby
scmid: githubConfig
kind: shell
spec:
command: bundle update elastic-apm
environments:
- name: PATH
42 changes: 0 additions & 42 deletions .ci/bump-version.sh

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/bump-opbeans-ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
## 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-ruby

on:
schedule:
- cron: '0 20 * * 6'

permissions:
contents: read

jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.3'
- uses: elastic/apm-pipeline-library/.github/actions/updatecli@current
with:
vaultUrl: ${{ secrets.VAULT_ADDR }}
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
pipeline: ./.ci/bump-opbeans-ruby.yml
29 changes: 29 additions & 0 deletions .github/workflows/create-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# Takes the version of elastic-apm in the Gemfile and creates a tag
# if the tag does not exist yet.
name: create-tag

on:
push:
branches:
- main
paths:
- Gemfile

permissions:
contents: write

jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # also fetch tags
- run: |
ELASTIC_APM_VERSION="v$(cat Gemfile | grep elastic-apm | awk 'BEGIN { FS=", " } { print $2 }' | tr -d \')"
# if the tag does not exist
if [[ ! $(git tag -l "${ELASTIC_APM_VERSION}") ]]; then
git tag ${ELASTIC_APM_VERSION}
git push origin "refs/tags/${ELASTIC_APM_VERSION}"
fi