Skip to content

Commit

Permalink
Init repo, define contract
Browse files Browse the repository at this point in the history
  • Loading branch information
peteretelej committed Aug 21, 2023
0 parents commit 8a8c8af
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
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


10 changes: 10 additions & 0 deletions config.json
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"
}
]
}
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package main

0 comments on commit 8a8c8af

Please sign in to comment.