rename to gitdeploy

This commit is contained in:
AJ ONeal 2020-10-09 09:22:06 +00:00
parent 83e91a1fd8
commit 96c416176f
15 changed files with 43 additions and 41 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
/gitdeploy
*_vfsdata.go *_vfsdata.go
/gitdeploy /gitdeploy
/git-deploy /git-deploy

View File

@ -1,13 +1,13 @@
# [git-deploy](https://git.ryanburnette.com/ryanburnette/git-deploy) # [gitdeploy](https://git.rootprojects.org/root/gitdeploy)
**git-deploy** is an app for handling continuous deployment of static websites. **gitdeploy** is an app for handling continuous deployment of static websites.
## Usage ## Usage
```bash ```bash
echo 'GITHUB_SECRET=xxxxxxx' >> .env echo 'GITHUB_SECRET=xxxxxxx' >> .env
./git-deploy init ./gitdeploy init
./git-deploy run --listen :3000 --serve-path ./overrides --exec ./path/to/script.sh ./gitdeploy run --listen :3000 --serve-path ./overrides --exec ./path/to/script.sh
``` ```
To manage `git credentials` To manage `git credentials`
@ -86,29 +86,29 @@ Sometimes Bitbucket does not give you the option to specify the (`X-Hub-Signatur
so you'll have to append an `access_token` instead. Example: so you'll have to append an `access_token` instead. Example:
```txt ```txt
Title: git-deploy Title: gitdeploy
URL: https://YOUR_DOMAIN/api/webhooks/bitbucket?access_token=YOUR_SECRET URL: https://YOUR_DOMAIN/api/webhooks/bitbucket?access_token=YOUR_SECRET
Triggers: Repository push Triggers: Repository push
``` ```
## TODO ## TODO
**git-deploy** is intended for use with static websites that are generated after **gitdeploy** is intended for use with static websites that are generated after
changes are pushed to a Git repository. This works with sites that are being changes are pushed to a Git repository. This works with sites that are being
edited in code and tracked in Git. Sites that have their content managed with a edited in code and tracked in Git. Sites that have their content managed with a
headless CMS that pushes to Git are also very well-suited. headless CMS that pushes to Git are also very well-suited.
**git-deploy** supports verified webhooks from Github, Bitbucket, and Gitea. **gitdeploy** supports verified webhooks from Github, Bitbucket, and Gitea.
**git-deploy** is written in Go. This means that it's a standalone binary **gitdeploy** is written in Go. This means that it's a standalone binary
available on all major operating systems and architectures. It provides an API available on all major operating systems and architectures. It provides an API
with endpoints that handle webhooks, allow for initiation of builds, and getting with endpoints that handle webhooks, allow for initiation of builds, and getting
the status of builds and build jobs. the status of builds and build jobs.
**git-deploy** comes with a simple interface. The interface be disabled if you **gitdeploy** comes with a simple interface. The interface be disabled if you
don't want to use it. don't want to use it.
**git-deploy** also comes with basic authentication via integration with **gitdeploy** also comes with basic authentication via integration with
[Pocket ID](https://pocketid.app). Authentication can also be disabled if you [Pocket ID](https://pocketid.app). Authentication can also be disabled if you
don't want to use it. The built-in interface requires the built-in don't want to use it. The built-in interface requires the built-in
authentication. authentication.
@ -148,7 +148,7 @@ crypto
## License ## License
Copyright 2020 The git-deploy Authors Copyright 2020 The gitdeploy Authors
This Source Code Form is subject to the terms of the Mozilla Public \ This Source Code Form is subject to the terms of the Mozilla Public \
License, v. 2.0. If a copy of the MPL was not distributed with this \ License, v. 2.0. If a copy of the MPL was not distributed with this \

View File

@ -1,4 +1,4 @@
// +build !dev // +build !dev
//go:generate go run -mod vendor github.com/shurcooL/vfsgen/cmd/vfsgendev -source="git.ryanburnette.com/ryanburnette/git-deploy/assets".Assets //go:generate go run -mod vendor github.com/shurcooL/vfsgen/cmd/vfsgendev -source="git.rootprojects.org/root/gitdeploy/assets".Assets
package assets package assets

View File

@ -3,5 +3,5 @@
package main package main
import ( import (
_ "git.ryanburnette.com/ryanburnette/git-deploy/internal/webhooks/bitbucket" _ "git.rootprojects.org/root/gitdeploy/internal/webhooks/bitbucket"
) )

View File

@ -3,5 +3,5 @@
package main package main
import ( import (
_ "git.ryanburnette.com/ryanburnette/git-deploy/internal/webhooks/gitea" _ "git.rootprojects.org/root/gitdeploy/internal/webhooks/gitea"
) )

View File

@ -3,5 +3,5 @@
package main package main
import ( import (
_ "git.ryanburnette.com/ryanburnette/git-deploy/internal/webhooks/github" _ "git.rootprojects.org/root/gitdeploy/internal/webhooks/github"
) )

2
go.mod
View File

@ -1,4 +1,4 @@
module git.ryanburnette.com/ryanburnette/git-deploy module git.rootprojects.org/root/gitdeploy
go 1.15 go 1.15

View File

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>git-deploy Dashboard</title> <title>gitdeploy Dashboard</title>
<link rel="stylesheet" href="style.css" /> <link rel="stylesheet" href="style.css" />
<link <link
href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;1,400&display=swap" href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;1,400&display=swap"
@ -23,10 +23,10 @@
<div class="column x-l"> <div class="column x-l">
<p> <p>
<a <a
href="https://git.ryanburnette.com/ryanburnette/git-deploy" href="https://git.rootprojects.org/root/gitdeploy"
target="_blank" target="_blank"
> >
git-deploy gitdeploy
</a> </a>
v0.1.0 v0.1.0
</p> </p>

View File

@ -5,7 +5,7 @@
</div> </div>
<div class="content"> <div class="content">
<p> <p>
<b>git-deploy</b> is a tool for managing continuous deployment of <b>gitdeploy</b> is a tool for managing continuous deployment of
statically generated websites. statically generated websites.
</p> </p>
</div> </div>

View File

@ -2,7 +2,7 @@
<div class="container is-fluid"> <div class="container is-fluid">
<div class="navbar-brand"> <div class="navbar-brand">
<span class="navbar-item brand-text has-text-weight-bold"> <span class="navbar-item brand-text has-text-weight-bold">
git-deploy gitdeploy
</span> </span>
</div> </div>
<div id="navMenu" class="navbar-menu"> <div id="navMenu" class="navbar-menu">

View File

@ -6,7 +6,7 @@
<div class="box"> <div class="box">
<div class="title"> <div class="title">
<h1 class="is-size-4 has-text-centered has-text-weight-bold"> <h1 class="is-size-4 has-text-centered has-text-weight-bold">
git-deploy gitdeploy
</h1> </h1>
</div> </div>
<div class="content has-text-centered signin-info"> <div class="content has-text-centered signin-info">

View File

@ -10,8 +10,8 @@ import (
"os" "os"
"strings" "strings"
"git.ryanburnette.com/ryanburnette/git-deploy/internal/options" "git.rootprojects.org/root/gitdeploy/internal/options"
"git.ryanburnette.com/ryanburnette/git-deploy/internal/webhooks" "git.rootprojects.org/root/gitdeploy/internal/webhooks"
"github.com/go-chi/chi" "github.com/go-chi/chi"
"github.com/google/go-github/v32/github" "github.com/google/go-github/v32/github"

View File

@ -12,8 +12,8 @@ import (
"os" "os"
"strings" "strings"
"git.ryanburnette.com/ryanburnette/git-deploy/internal/options" "git.rootprojects.org/root/gitdeploy/internal/options"
"git.ryanburnette.com/ryanburnette/git-deploy/internal/webhooks" "git.rootprojects.org/root/gitdeploy/internal/webhooks"
"github.com/go-chi/chi" "github.com/go-chi/chi"
) )

View File

@ -8,8 +8,8 @@ import (
"os" "os"
"strings" "strings"
"git.ryanburnette.com/ryanburnette/git-deploy/internal/options" "git.rootprojects.org/root/gitdeploy/internal/options"
"git.ryanburnette.com/ryanburnette/git-deploy/internal/webhooks" "git.rootprojects.org/root/gitdeploy/internal/webhooks"
"github.com/go-chi/chi" "github.com/go-chi/chi"
// TODO nix this dependency in favor of a lightweight X-Hub-Signature // TODO nix this dependency in favor of a lightweight X-Hub-Signature

26
main.go
View File

@ -13,9 +13,9 @@ import (
"strings" "strings"
"time" "time"
"git.ryanburnette.com/ryanburnette/git-deploy/assets" "git.rootprojects.org/root/gitdeploy/assets"
"git.ryanburnette.com/ryanburnette/git-deploy/internal/options" "git.rootprojects.org/root/gitdeploy/internal/options"
"git.ryanburnette.com/ryanburnette/git-deploy/internal/webhooks" "git.rootprojects.org/root/gitdeploy/internal/webhooks"
"github.com/go-chi/chi" "github.com/go-chi/chi"
"github.com/go-chi/chi/middleware" "github.com/go-chi/chi/middleware"
@ -339,12 +339,12 @@ func runHook(hook webhooks.Ref) {
if _, exists := jobs[jobID]; exists { if _, exists := jobs[jobID]; exists {
// TODO put job in backlog // TODO put job in backlog
log.Printf("git-deploy job already started for %s#%s\n", hook.HTTPSURL, hook.RefName) log.Printf("gitdeploy job already started for %s#%s\n", hook.HTTPSURL, hook.RefName)
return return
} }
if err := cmd.Start(); nil != err { if err := cmd.Start(); nil != err {
log.Printf("git-deploy exec error: %s\n", err) log.Printf("gitdeploy exec error: %s\n", err)
return return
} }
@ -356,12 +356,12 @@ func runHook(hook webhooks.Ref) {
} }
go func() { go func() {
log.Printf("git-deploy job for %s#%s started\n", hook.HTTPSURL, hook.RefName) log.Printf("gitdeploy job for %s#%s started\n", hook.HTTPSURL, hook.RefName)
if err := cmd.Wait(); nil != err { if err := cmd.Wait(); nil != err {
log.Printf("git-deploy job for %s#%s exited with error: %v", hook.HTTPSURL, hook.RefName, err) log.Printf("gitdeploy job for %s#%s exited with error: %v", hook.HTTPSURL, hook.RefName, err)
return return
} }
log.Printf("git-deploy job for %s#%s finished\n", hook.HTTPSURL, hook.RefName) log.Printf("gitdeploy job for %s#%s finished\n", hook.HTTPSURL, hook.RefName)
// TODO check for backlog // TODO check for backlog
}() }()
} }
@ -420,17 +420,17 @@ func runPromote(hook webhooks.Ref, promoteTo string) {
if _, exists := jobs[jobID1]; exists { if _, exists := jobs[jobID1]; exists {
// TODO put promote in backlog // TODO put promote in backlog
log.Printf("git-deploy job already started for %s#%s\n", hook.HTTPSURL, hook.RefName) log.Printf("gitdeploy job already started for %s#%s\n", hook.HTTPSURL, hook.RefName)
return return
} }
if _, exists := jobs[jobID2]; exists { if _, exists := jobs[jobID2]; exists {
// TODO put promote in backlog // TODO put promote in backlog
log.Printf("git-deploy job already started for %s#%s\n", hook.HTTPSURL, promoteTo) log.Printf("gitdeploy job already started for %s#%s\n", hook.HTTPSURL, promoteTo)
return return
} }
if err := cmd.Start(); nil != err { if err := cmd.Start(); nil != err {
log.Printf("git-deploy exec error: %s\n", err) log.Printf("gitdeploy exec error: %s\n", err)
return return
} }
@ -448,11 +448,11 @@ func runPromote(hook webhooks.Ref, promoteTo string) {
} }
go func() { go func() {
log.Printf("git-deploy promote for %s#%s started\n", hook.HTTPSURL, hook.RefName) log.Printf("gitdeploy promote for %s#%s started\n", hook.HTTPSURL, hook.RefName)
_ = cmd.Wait() _ = cmd.Wait()
killers <- jobID1 killers <- jobID1
killers <- jobID2 killers <- jobID2
log.Printf("git-deploy promote for %s#%s finished\n", hook.HTTPSURL, hook.RefName) log.Printf("gitdeploy promote for %s#%s finished\n", hook.HTTPSURL, hook.RefName)
// TODO check for backlog // TODO check for backlog
}() }()
} }