Skip to content

Commit 187d175

Browse files
authored
Merge pull request #186 from reakaleek/feature/add-updatecli-condition
Add updatecli condition
2 parents d77541a + c1d7e59 commit 187d175

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

.ci/bump-opbeans-ruby.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ sources:
4646
transformers:
4747
- trimprefix: "v"
4848

49+
conditions:
50+
checkIfVersionDiffers:
51+
name: Check if installed version differs
52+
kind: shell
53+
sourceid: elastic-apm-agent-ruby
54+
spec:
55+
command: .ci/scripts/test-version.sh
56+
4957
targets:
5058
dockerfile-label-schema:
5159
name: Set org.label-schema.version in Dockerfile

.ci/scripts/test-version.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
# This script checks the difference of the input and the version of elastic-apm in Gemfile.lock
4+
# If the input and the version in the Gemfile.lock file are equal the script returns a non zero exit code.
5+
# If the input and the version in the Gemfile.lock file differ the script return a 0 exit code.
6+
#
7+
# This is used for an updatecli condition to determine if the pipeline should continue or not.
8+
9+
set -euo pipefail
10+
11+
version=$(grep elastic-apm Gemfile.lock | head -1 | awk -F'[()]' '{ print $2 }')
12+
13+
test "$version" != "$1"

0 commit comments

Comments
 (0)