updated to auto generate build documentation and embed in binary
This commit is contained in:
parent
aa8e0347d0
commit
7190facb41
11 changed files with 202 additions and 24 deletions
|
@ -59,6 +59,7 @@ func main() {
|
|||
return true
|
||||
})
|
||||
site.Nav = &Nav{}
|
||||
site.Nav.elem = sitemap
|
||||
site.Nav.html, err = sitemap.Html()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -77,6 +78,19 @@ func main() {
|
|||
}
|
||||
defer f.Close()
|
||||
|
||||
// correctly make the active page in the
|
||||
// navigation html snippet
|
||||
site.Nav.elem.Find("li > a").EachWithBreak(func(i int, s *goquery.Selection) bool {
|
||||
href, _ := s.Attr("href")
|
||||
if href == page.Href {
|
||||
s.Parent().AddClass("active")
|
||||
} else {
|
||||
s.Parent().RemoveClass("active")
|
||||
}
|
||||
return true
|
||||
})
|
||||
site.Nav.html, _ = site.Nav.elem.Html()
|
||||
|
||||
data := map[string]interface{}{
|
||||
"Site": site,
|
||||
"Page": page,
|
||||
|
@ -98,6 +112,7 @@ type Site struct {
|
|||
|
||||
type Nav struct {
|
||||
html string
|
||||
elem *goquery.Selection
|
||||
}
|
||||
|
||||
func (n *Nav) HTML() template.HTML {
|
||||
|
|
|
@ -251,6 +251,10 @@ func PostSecure(c *gin.Context) {
|
|||
c.String(http.StatusOK, out)
|
||||
}
|
||||
|
||||
func PostReactivate(c *gin.Context) {
|
||||
|
||||
}
|
||||
|
||||
func PostStar(c *gin.Context) {
|
||||
db := context.Database(c)
|
||||
repo := session.Repo(c)
|
||||
|
|
2
docs/build/build.md
vendored
2
docs/build/build.md
vendored
|
@ -1,6 +1,6 @@
|
|||
# Build
|
||||
|
||||
Drone uses the `build` section of the `.drone.yml` to describe your Docker build environment and specify your build and test instructions. The following is an example build definition:
|
||||
Drone uses the `build` section of the `.drone.yml` to describe your Docker build environment and your build and test instructions. The following is an example build definition:
|
||||
|
||||
```yaml
|
||||
build:
|
||||
|
|
4
docs/build/cache.md
vendored
4
docs/build/cache.md
vendored
|
@ -1,6 +1,6 @@
|
|||
# Caching
|
||||
|
||||
> **Caution:** this feature is still considered experimental
|
||||
> This feature is still considered experimental
|
||||
|
||||
Drone allows you to cache directories within the build workspace. When a build successfully completes, the named directories are gzipped and stored on the host machine. When a new build starts, the named directories are restored from the gzipped files. This can be used to improve the performance of your builds.
|
||||
|
||||
|
@ -27,4 +27,4 @@ There is currently no mechanism to automatically delete or flush the cache. This
|
|||
|
||||
## Distributed Cache
|
||||
|
||||
There is considered outside the scope of Drone. You may, for example, use a distributed filesystem such as `ceph` or `gluster` mounted to `/var/lib/drone/cache/` to share the cache across nodes.
|
||||
This is outside the scope of Drone. You may, for example, use a distributed filesystem such as `ceph` or `gluster` mounted to `/var/lib/drone/cache/` to share the cache across nodes.
|
||||
|
|
17
docs/build/clone.md
vendored
17
docs/build/clone.md
vendored
|
@ -34,20 +34,3 @@ Cloning a private repository requires authentication to the remote system. Drone
|
|||
Drone prefers `git+https` for authentication because it allows you to clone multiple private repositories. This is helpful when you have git submodules or third party dependencies you need to download (via `go get` or `npm install` or others) that are sourced from a private repository.
|
||||
|
||||
Drone only injects the `netrc` and `id_rsa` files into your build environment if your repository is private, or running in private mode. We do this for security reasons to avoid leaking sensitive data.
|
||||
|
||||
## Clone Plugin
|
||||
|
||||
You can override the default `git` plugin by specifying an alternative plugin image. An example use case may be integrating with alternate version control systems, such as mercurial:
|
||||
|
||||
```yaml
|
||||
clone:
|
||||
image: bradrydzewski/hg
|
||||
|
||||
# below are plugin-specific parameters
|
||||
path: override/default/clone/path
|
||||
insecure: false
|
||||
verbose: true
|
||||
```
|
||||
|
||||
Please reference the official `git` plugin and use this as a starting point for custom plugin development:
|
||||
https://github.com/drone-plugins/drone-git
|
||||
|
|
2
docs/build/overview.md
vendored
2
docs/build/overview.md
vendored
|
@ -1,6 +1,6 @@
|
|||
# Overview
|
||||
|
||||
In order to configure your build, you must include a `.drone.yml` file in the root of your repository. This documentation describes the `.drone.yml` configuration file format.
|
||||
In order to configure your build, you must include a `.drone.yml` file in the root of your repository. This section provides a brief overview of the `.drone.yml` configuration file format.
|
||||
|
||||
Example `.drone.yml` for a Go repository:
|
||||
|
||||
|
|
|
@ -408,6 +408,7 @@ func (e *engine) runJobNotify(r *Task, client dockerclient.Client) error {
|
|||
},
|
||||
}
|
||||
|
||||
log.Infof("preparing container %s", name)
|
||||
info, err := docker.Run(client, conf, name)
|
||||
|
||||
// for debugging purposes we print a failed notification executions
|
||||
|
|
|
@ -96,6 +96,29 @@ func GetAllRepos(client *github.Client) ([]github.Repository, error) {
|
|||
return repos, nil
|
||||
}
|
||||
|
||||
// GetSubscriptions is a helper function that returns an aggregated list
|
||||
// of all user and organization repositories.
|
||||
// func GetSubscriptions(client *github.Client) ([]github.Repository, error) {
|
||||
// var repos []github.Repository
|
||||
// var opts = github.ListOptions{}
|
||||
// opts.PerPage = 100
|
||||
// opts.Page = 1
|
||||
|
||||
// // loop through user repository list
|
||||
// for opts.Page > 0 {
|
||||
// list, resp, err := client.Activity.ListWatched(""), &opts)
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
// repos = append(repos, list...)
|
||||
|
||||
// // increment the next page to retrieve
|
||||
// opts.Page = resp.NextPage
|
||||
// }
|
||||
|
||||
// return repos, nil
|
||||
// }
|
||||
|
||||
// GetUserRepos is a helper function that returns a list of
|
||||
// all user repositories. Paginated results are aggregated into
|
||||
// a single list.
|
||||
|
|
|
@ -114,6 +114,8 @@
|
|||
margin-top:40px;
|
||||
padding: 0px 50px;
|
||||
padding-right:40px;
|
||||
|
||||
.docs-api
|
||||
pre
|
||||
margin-right: 15px;
|
||||
font-size: 13px;
|
||||
|
@ -127,7 +129,18 @@
|
|||
box-sizing: border-box;
|
||||
padding: 25px 30px;
|
||||
font-family: "Roboto Mono";
|
||||
|
||||
|
||||
margin-right: 0px;
|
||||
padding-left: 40px;
|
||||
background: #eff1f5;
|
||||
color: #2b303b;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
box-sizing: border-box;
|
||||
padding: 25px 30px;
|
||||
font-family: "Roboto Mono";
|
||||
border-radius: 2px;
|
||||
font-size:13px;
|
||||
|
||||
.operation
|
||||
min-height:100vh;
|
||||
|
@ -209,3 +222,101 @@
|
|||
pre
|
||||
background: #eff1f5
|
||||
color: #2b303b
|
||||
|
||||
|
||||
|
||||
|
||||
.docs-usage
|
||||
.row
|
||||
display:flex;
|
||||
.content-nav
|
||||
max-width:250px;
|
||||
min-width:250px;
|
||||
width:250px;
|
||||
ul
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
list-style-type: none;
|
||||
a
|
||||
color:rgba(43, 48, 59, 0.8);
|
||||
line-height: 30px;
|
||||
display: block;
|
||||
li
|
||||
position:relative;
|
||||
li.active a
|
||||
color:#2b303b;
|
||||
li.active:before
|
||||
content: "";
|
||||
border-left: 4px solid #2b303b;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
bottom: 0px;
|
||||
left: -20px;
|
||||
.content-main
|
||||
max-width: 900px;
|
||||
margin: 0px auto;
|
||||
margin-bottom:40px;
|
||||
font-size:14px;
|
||||
|
||||
p
|
||||
line-height:20px;
|
||||
margin:20px 0px;
|
||||
|
||||
blockquote
|
||||
color: #31708f;
|
||||
background-color: #d9edf7;
|
||||
border-color: #bcdff1;
|
||||
padding: 30px;
|
||||
margin: 15px 0px;
|
||||
border-radius:2px;
|
||||
|
||||
blockquote p:first-child
|
||||
margin-top:0px;
|
||||
|
||||
blockquote p:last-child
|
||||
margin-bottom:0px;
|
||||
|
||||
strong
|
||||
font-weight:bold;
|
||||
|
||||
h1
|
||||
margin:40px 0px 20px 0px;
|
||||
font-size:22px;
|
||||
|
||||
h1:first-child
|
||||
margin-top:0px;
|
||||
|
||||
h2
|
||||
margin:40px 0px 30px 0px;
|
||||
font-size:20px;
|
||||
border-top: 1px solid #EEE;
|
||||
padding-top: 30px;
|
||||
h3
|
||||
margin:40px 0px 20px 0px;
|
||||
font-size:16px;
|
||||
|
||||
ul code, ol code, p code
|
||||
background: #eff1f5;
|
||||
color: #2b303b;
|
||||
padding: 0px 7px;
|
||||
font-family: "Roboto Mono";
|
||||
font-size:13px;
|
||||
white-space:nowrap;
|
||||
pre
|
||||
margin-right: 0px;
|
||||
padding-left: 40px;
|
||||
background: #eff1f5;
|
||||
color: #2b303b;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
box-sizing: border-box;
|
||||
padding: 25px 30px;
|
||||
font-family: "Roboto Mono";
|
||||
border-radius: 2px;
|
||||
font-size:13px;
|
||||
pre > code
|
||||
background: #eff1f5;
|
||||
color: #2b303b;
|
||||
font-family: "Roboto Mono";
|
||||
font-size:13px;
|
||||
|
||||
|
|
|
@ -341,7 +341,7 @@ body.login div.alert { position: fixed; top: 0px; left: 0px; right: 0px; line-he
|
|||
|
||||
.docs { margin-top: 40px; padding: 0px 50px; padding-right: 40px; }
|
||||
|
||||
.docs pre { margin-right: 15px; font-size: 13px; color: #eff1f5; color: #2b303b; border-radius: 2px; background: #2b303b; background: #ECF0F1; white-space: pre-wrap; word-wrap: break-word; box-sizing: border-box; padding: 25px 30px; font-family: "Roboto Mono"; }
|
||||
.docs-api pre { margin-right: 15px; font-size: 13px; color: #eff1f5; color: #2b303b; border-radius: 2px; background: #2b303b; background: #ECF0F1; white-space: pre-wrap; word-wrap: break-word; box-sizing: border-box; padding: 25px 30px; font-family: "Roboto Mono"; margin-right: 0px; padding-left: 40px; background: #eff1f5; color: #2b303b; white-space: pre-wrap; word-wrap: break-word; box-sizing: border-box; padding: 25px 30px; font-family: "Roboto Mono"; border-radius: 2px; font-size: 13px; }
|
||||
|
||||
.operation { min-height: 100vh; padding: 20px 0px; display: flex; }
|
||||
|
||||
|
@ -375,6 +375,46 @@ body.login div.alert { position: fixed; top: 0px; left: 0px; right: 0px; line-he
|
|||
|
||||
.operation aside pre { background: #eff1f5; color: #2b303b; }
|
||||
|
||||
.docs-usage .row { display: flex; }
|
||||
|
||||
.docs-usage .row .content-nav { max-width: 250px; min-width: 250px; width: 250px; }
|
||||
|
||||
.docs-usage .row .content-nav ul { padding: 0px; margin: 0px; list-style-type: none; }
|
||||
|
||||
.docs-usage .row .content-nav ul a { color: rgba(43, 48, 59, 0.8); line-height: 30px; display: block; }
|
||||
|
||||
.docs-usage .row .content-nav ul li { position: relative; }
|
||||
|
||||
.docs-usage .row .content-nav ul li.active a { color: #2b303b; }
|
||||
|
||||
.docs-usage .row .content-nav ul li.active:before { content: ""; border-left: 4px solid #2b303b; position: absolute; top: 0px; bottom: 0px; left: -20px; }
|
||||
|
||||
.docs-usage .row .content-main { max-width: 900px; margin: 0px auto; margin-bottom: 40px; font-size: 14px; }
|
||||
|
||||
.docs-usage .row .content-main p { line-height: 20px; margin: 20px 0px; }
|
||||
|
||||
.docs-usage .row .content-main blockquote { color: #31708f; background-color: #d9edf7; border-color: #bcdff1; padding: 30px; margin: 15px 0px; border-radius: 2px; }
|
||||
|
||||
.docs-usage .row .content-main blockquote p:first-child { margin-top: 0px; }
|
||||
|
||||
.docs-usage .row .content-main blockquote p:last-child { margin-bottom: 0px; }
|
||||
|
||||
.docs-usage .row .content-main strong { font-weight: bold; }
|
||||
|
||||
.docs-usage .row .content-main h1 { margin: 40px 0px 20px 0px; font-size: 22px; }
|
||||
|
||||
.docs-usage .row .content-main h1:first-child { margin-top: 0px; }
|
||||
|
||||
.docs-usage .row .content-main h2 { margin: 40px 0px 30px 0px; font-size: 20px; border-top: 1px solid #EEE; padding-top: 30px; }
|
||||
|
||||
.docs-usage .row .content-main h3 { margin: 40px 0px 20px 0px; font-size: 16px; }
|
||||
|
||||
.docs-usage .row .content-main ul code, .docs-usage .row .content-main ol code, .docs-usage .row .content-main p code { background: #eff1f5; color: #2b303b; padding: 0px 7px; font-family: "Roboto Mono"; font-size: 13px; white-space: nowrap; }
|
||||
|
||||
.docs-usage .row .content-main pre { margin-right: 0px; padding-left: 40px; background: #eff1f5; color: #2b303b; white-space: pre-wrap; word-wrap: break-word; box-sizing: border-box; padding: 25px 30px; font-family: "Roboto Mono"; border-radius: 2px; font-size: 13px; }
|
||||
|
||||
.docs-usage .row .content-main pre > code { background: #eff1f5; color: #2b303b; font-family: "Roboto Mono"; font-size: 13px; }
|
||||
|
||||
.tt-open { position: absolute; top: 34px; left: 0px; z-index: 100; display: none; background: #FFF; min-width: 100%; border: 1px solid #eee; border-radius: 0px; }
|
||||
|
||||
.tt-selectable:hover, .tt-cursor { background: #f4f4f4; }
|
||||
|
|
|
@ -20,6 +20,7 @@ block content
|
|||
div.container-fluid.docs.docs-usage
|
||||
div.row
|
||||
div.content-nav
|
||||
#{Site.Nav.HTML}
|
||||
ul
|
||||
#{Site.Nav.HTML}
|
||||
div.content-main
|
||||
#{Page.HTML}
|
Loading…
Reference in a new issue