-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8a8c8af
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"apps": [ | ||
{ | ||
"name": "appx", | ||
"dir": "/home/user/apps/appx", | ||
"script": "deploy.sh", | ||
"timeout": "5m" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package main |