From 32ea94dafa1cc7d7c3c1773c006ec84697bc00db Mon Sep 17 00:00:00 2001 From: Ewout Prangsma Date: Tue, 25 Sep 2018 15:51:46 +0200 Subject: [PATCH 1/3] Allow release on linux --- scripts/patch_readme.sh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/scripts/patch_readme.sh b/scripts/patch_readme.sh index e4cdfd084..e74807f56 100755 --- a/scripts/patch_readme.sh +++ b/scripts/patch_readme.sh @@ -10,10 +10,24 @@ if [ -z $VERSION ]; then exit 1 fi +function replaceInFile { + local EXPR=$1 + local FILE=$2 + case $(uname) in + Darwin) + sed -e ${EXPR} -i "" ${FILE} + ;; + *) + sed -i --expression=${EXPR} ${FILE} + ;; + esac +} + + f=README.md -sed -e "s@^kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/.*/manifests/arango-deployment.yaml\$@kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/${VERSION}/manifests/arango-deployment.yaml@g" -i "" $f -sed -e "s@^kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/.*/manifests/arango-deployment-replication.yaml\$@kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/${VERSION}/manifests/arango-deployment-replication.yaml@g" -i "" $f -sed -e "s@^kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/.*/manifests/arango-storage.yaml\$@kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/${VERSION}/manifests/arango-storage.yaml@g" -i "" $f +replaceInFile "s@^kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/.*/manifests/arango-deployment.yaml\$@kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/${VERSION}/manifests/arango-deployment.yaml@g" ${f} +replaceInFile "s@^kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/.*/manifests/arango-deployment-replication.yaml\$@kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/${VERSION}/manifests/arango-deployment-replication.yaml@g" ${f} +replaceInFile "s@^kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/.*/manifests/arango-storage.yaml\$@kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/${VERSION}/manifests/arango-storage.yaml@g" ${f} -sed -e "s@^helm install https://github.com/arangodb/kube-arangodb/releases/download/.*/kube-arangodb.tgz\$@helm install https://github.com/arangodb/kube-arangodb/releases/download/${VERSION}/kube-arangodb.tgz@g" -i "" $f -sed -e "s@^helm install https://github.com/arangodb/kube-arangodb/releases/download/.*/kube-arangodb-storage.tgz\$@helm install https://github.com/arangodb/kube-arangodb/releases/download/${VERSION}/kube-arangodb-storage.tgz@g" -i "" $f +replaceInFile "s@^helm install https://github.com/arangodb/kube-arangodb/releases/download/.*/kube-arangodb.tgz\$@helm install https://github.com/arangodb/kube-arangodb/releases/download/${VERSION}/kube-arangodb.tgz@g" ${f} +replaceInFile "s@^helm install https://github.com/arangodb/kube-arangodb/releases/download/.*/kube-arangodb-storage.tgz\$@helm install https://github.com/arangodb/kube-arangodb/releases/download/${VERSION}/kube-arangodb-storage.tgz@g" ${f} From 152975598474853f7e76c54c05e0b84fb3fd1711 Mon Sep 17 00:00:00 2001 From: Ewout Prangsma Date: Tue, 25 Sep 2018 15:53:25 +0200 Subject: [PATCH 2/3] Fix quotes --- scripts/patch_readme.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/patch_readme.sh b/scripts/patch_readme.sh index e74807f56..b4c47ace5 100755 --- a/scripts/patch_readme.sh +++ b/scripts/patch_readme.sh @@ -15,7 +15,7 @@ function replaceInFile { local FILE=$2 case $(uname) in Darwin) - sed -e ${EXPR} -i "" ${FILE} + sed -e "${EXPR}" -i "" ${FILE} ;; *) sed -i --expression=${EXPR} ${FILE} From 645ef4962ce6125a782d5042199ebda0c1a9ed30 Mon Sep 17 00:00:00 2001 From: Ewout Prangsma Date: Tue, 25 Sep 2018 15:54:05 +0200 Subject: [PATCH 3/3] Fix quotes --- scripts/patch_readme.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/patch_readme.sh b/scripts/patch_readme.sh index b4c47ace5..97a802323 100755 --- a/scripts/patch_readme.sh +++ b/scripts/patch_readme.sh @@ -18,7 +18,7 @@ function replaceInFile { sed -e "${EXPR}" -i "" ${FILE} ;; *) - sed -i --expression=${EXPR} ${FILE} + sed -i --expression "${EXPR}" ${FILE} ;; esac }