diff --git a/contrib/generate-docs.go b/contrib/generate-docs.go index fe8b63d88..626c37094 100644 --- a/contrib/generate-docs.go +++ b/contrib/generate-docs.go @@ -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 { diff --git a/controller/repo.go b/controller/repo.go index 7dab814ff..2bbca5e1c 100644 --- a/controller/repo.go +++ b/controller/repo.go @@ -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) diff --git a/docs/build/build.md b/docs/build/build.md index 3229b9600..0341777e9 100644 --- a/docs/build/build.md +++ b/docs/build/build.md @@ -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: diff --git a/docs/build/cache.md b/docs/build/cache.md index 10771ef69..d05a35de0 100644 --- a/docs/build/cache.md +++ b/docs/build/cache.md @@ -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. diff --git a/docs/build/clone.md b/docs/build/clone.md index c326b615c..54e6e4af2 100644 --- a/docs/build/clone.md +++ b/docs/build/clone.md @@ -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 diff --git a/docs/build/overview.md b/docs/build/overview.md index 13f798416..58faf54d4 100644 --- a/docs/build/overview.md +++ b/docs/build/overview.md @@ -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: diff --git a/engine/engine.go b/engine/engine.go index 133cdfbb4..32f1c9eb3 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -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 diff --git a/remote/github/helper.go b/remote/github/helper.go index 42e84f9e4..12f1cd880 100644 --- a/remote/github/helper.go +++ b/remote/github/helper.go @@ -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. diff --git a/static/styles/pages/docs.sass b/static/styles/pages/docs.sass index cbb0c598a..fd10b12ac 100644 --- a/static/styles/pages/docs.sass +++ b/static/styles/pages/docs.sass @@ -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; + diff --git a/static/styles_gen/style.css b/static/styles_gen/style.css index 5de94f23b..5b621fdd7 100644 --- a/static/styles_gen/style.css +++ b/static/styles_gen/style.css @@ -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; } diff --git a/template/amber/docs.amber b/template/amber/docs.amber index a8aff4960..2be722a4c 100644 --- a/template/amber/docs.amber +++ b/template/amber/docs.amber @@ -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} \ No newline at end of file