From 4b3c0c1bdbdc46c412cfcf35314de703939fb446 Mon Sep 17 00:00:00 2001 From: Nicolas Carlier Date: Tue, 2 Jan 2018 16:57:27 +0000 Subject: [PATCH] chore(): add installation script --- README.md | 24 ++++++++++-------------- install.sh | 8 ++++++++ 2 files changed, 18 insertions(+), 14 deletions(-) create mode 100644 install.sh diff --git a/README.md b/README.md index f2860c4..d71f268 100644 --- a/README.md +++ b/README.md @@ -7,25 +7,21 @@ A very simple webhook server to launch shell scripts. ## Installation -### Using the binary +Run the following command: -Linux binaries for release [1.0.0](https://github.com/ncarlier/webhookd/releases) - -* [amd64](https://github.com/ncarlier/webhookd/releases/download/v1.0.0/webhookd-linux-amd64-v1.0.0.tar.gz) - -Download the version you need, untar, and install to your PATH. - -``` -$ wget https://github.com/ncarlier/webhookd/releases/download/v1.0.0/webhookd-linux-amd64-v1.0.0.tar.gz -$ tar xvzf webhookd-linux-amd64-v1.0.0.tar.gz -$ ./webhookd +```bash +$ go get -v github.com/ncarlier/webhookd/webhookd ``` -### Using Docker - -Start the container mounting your scripts directory: +**Or** download the binary regarding your architecture: +```bash +$ sudo curl -s https://raw.githubusercontent.com/ncarlier/webhookd/master/install.sh | sh ``` + +**Or** use Docker: + +```bash $ docker run -d --name=webhookd \ --env-file .env \ -v ${PWD}/scripts:/var/opt/webhookd/scripts \ diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..d21ac89 --- /dev/null +++ b/install.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +release_url="https://api.github.com/repos/ncarlier/webhookd/releases/latest" +download_url=`curl -s $release_url | grep browser_download_url | head -n 1 | cut -d '"' -f 4` + +sudo curl -o /usr/local/bin/webhookd -L $download_url +sudo chmod +x /usr/local/bin/webhookd +