diff --git a/README.md b/README.md new file mode 100644 index 0000000..45edab1 --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# go-deploy + +Go Deploy helps deploy apps on your Linux servers! + +## Running Go-Deploy +``` +export GODEPLOY_KEY={api_key that will be used for bearer auth} + +go build -o go-deploy . + +./go-deploy +``` + +Run Go-Deploy on the server you'd like to deploy apps on. + + +## Usage +Assuming you have an application at `/home/user/apps/appx` that has a deploy script `deploy.sh`, you can use the [./config.json.sample](./config.json.sample) as the config.json for go deploy. + +Update `apps` to add different options as desired. + +### Requesting a deployment +``` +POST https://go-deploy.test/deploy/appx -X "Authorization: Bearer GODEPLOY_KEY" +``` +This will attempt to run the script for the app named "appx", and respond with http 200 (success) if deployment succeeds, or http 400 (with failure error) on failure. + + +## Best Practise +Consider making godeploy only accessible to your CI/CD pipelines. + +For example, using tailscale and ufw to only allow desired access: +- https://tailscale.com/kb/1077/secure-server-ubuntu-18-04/ +- https://github.com/tailscale/github-action + + diff --git a/config.json b/config.json new file mode 100644 index 0000000..7328800 --- /dev/null +++ b/config.json @@ -0,0 +1,10 @@ +{ + "apps": [ + { + "name": "appx", + "dir": "/home/user/apps/appx", + "script": "deploy.sh", + "timeout": "5m" + } + ] +} diff --git a/main.go b/main.go new file mode 100644 index 0000000..06ab7d0 --- /dev/null +++ b/main.go @@ -0,0 +1 @@ +package main