From 31082887a62bb7de29d274b1416e868c56ec046a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Cass=C3=A9?= Date: Thu, 28 Apr 2016 22:34:22 +0200 Subject: [PATCH] Fix some code after review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Vincent Cassé --- scripts/release_binary.sh | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/scripts/release_binary.sh b/scripts/release_binary.sh index e96e8f1..d03f673 100755 --- a/scripts/release_binary.sh +++ b/scripts/release_binary.sh @@ -1,17 +1,38 @@ #!/bin/bash +# +# This script is used to build and deploy the binary from the current version on github +# Usage ./scripts/release_binary.sh +# + +set -e VERSION="$1" USER="$2" TOKEN="$3" +if [ -z "$VERSION" ]; +then + echo "Missing version" >&2 + exit 1 +fi + +if [ -z "$USER" ]; +then + echo "Missing github user" >&2 + exit 1 +fi + +if [ -z "$TOKEN" ]; +then + echo "Missing github token" >&2 + exit 1 +fi + cd /tmp -mkdir php-ovh-bin +mkdir -p php-ovh-bin cd php-ovh-bin -php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php -php -r "if (hash('SHA384', file_get_contents('composer-setup.php')) === '7228c001f88bee97506740ef0888240bd8a760b046ee16db8f4095c0d8d525f2367663f22a46b48d072c816e7fe19959') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" -php composer-setup.php -php -r "unlink('composer-setup.php');" +curl -sS https://getcomposer.org/installer | php echo '{ "name": "Example Application",