Skip to content

Commit

Permalink
Merge camunda#5168
Browse files Browse the repository at this point in the history
5168: fix(broker): environmentalise sed -i in benchmarks r=Zelldon a=jwulf

## Description

sed -i needs a different syntax on Mac OS. 

This patch detects the OS and uses the appropriate syntax.

Closes camunda#4508

Co-authored-by: Josh Wulf <[email protected]>
  • Loading branch information
zeebe-bors[bot] and jwulf authored Aug 18, 2020
2 parents 08e5c41 + 4635aef commit bd244ab
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion benchmarks/setup/newBenchmark.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
#!/bin/bash

GO_OS=${GO_OS:-"linux"}

function detect_os {
# Detect the OS name
case "$(uname -s)" in
Darwin)
host_os=darwin
;;
Linux)
host_os=linux
;;
*)
echo "Unsupported host OS. Must be Linux or Mac OS X." >&2
exit 1
;;
esac

GO_OS="${host_os}"
}

detect_os

set -exo pipefail

if [ -z $1 ]
Expand All @@ -19,4 +42,9 @@ kubens $namespace
cp -rv default/ $namespace
cd $namespace

sed -i "s/default/$namespace/g" Makefile starter.yaml timer.yaml simpleStarter.yaml worker.yaml
if [ "${GO_OS}" == "darwin" ]; then
sed -i '' -e "s/default/$namespace/g" Makefile starter.yaml timer.yaml simpleStarter.yaml worker.yaml
else
sed -i -e "s/default/$namespace/g" Makefile starter.yaml timer.yaml simpleStarter.yaml worker.yaml
fi

0 comments on commit bd244ab

Please sign in to comment.