From a4eee9e5104f7da46c610b5c57b4378ec6e38242 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 7 Oct 2015 11:35:35 -0700 Subject: [PATCH] generating documentation --- contrib/generate-docs.go | 2 +- docs/samples/build.json | 38 ----------------------------------- docs/samples/builds.json | 20 ------------------ docs/samples/ccmenu.xml | 9 --------- docs/samples/job.json | 8 -------- docs/samples/repo.json | 28 -------------------------- docs/samples/repos.json | 19 ------------------ docs/samples/token.json | 5 ----- docs/samples/tokens.json | 6 ------ docs/samples/user.json | 7 ------- docs/samples/users.json | 9 --------- docs/setup/README.md | 6 +++--- engine/engine.go | 3 +++ static/static.go | 6 ++++-- static/styles/pages/docs.sass | 16 ++++++++++++--- static/styles_gen/style.css | 8 +++++--- template/amber/docs.amber | 14 +++++++++---- template/amber/swagger.amber | 8 ++++---- 18 files changed, 43 insertions(+), 169 deletions(-) delete mode 100644 docs/samples/build.json delete mode 100644 docs/samples/builds.json delete mode 100644 docs/samples/ccmenu.xml delete mode 100644 docs/samples/job.json delete mode 100644 docs/samples/repo.json delete mode 100644 docs/samples/repos.json delete mode 100644 docs/samples/token.json delete mode 100644 docs/samples/tokens.json delete mode 100644 docs/samples/user.json delete mode 100644 docs/samples/users.json diff --git a/contrib/generate-docs.go b/contrib/generate-docs.go index 626c37094..db627ea0b 100644 --- a/contrib/generate-docs.go +++ b/contrib/generate-docs.go @@ -151,7 +151,7 @@ func toPage(site *Site, el *goquery.Selection) (*Page, error) { // follow the link to see if this is a page // that should be added to our documentation. href, ok := el.Attr("href") - if !ok { + if !ok || href == "#" { return nil, nil } diff --git a/docs/samples/build.json b/docs/samples/build.json deleted file mode 100644 index c82440d2f..000000000 --- a/docs/samples/build.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "number": 1, - "status": "success", - "started_at": 5788800, - "finished_at": 5789500, - - "head_commit": { - "sha": "d101ef3ed6e973b039c3fd5ccdec378b0fa8684c", - "ref": "refs\/heads\/master", - "branch": "master", - "message": "updated the README.md file", - "timestamp": "", - "remote": "https:\/\/github.com\/drone\/drone.git", - "author": { - "login": "bradrydzewski", - "email": "brad.rydzewski@gmail.com" - } - }, - - "jobs": [ - { - "number": 1, - "status": "success", - "started_at": 5788800, - "finished_at": 5789500, - "exit_code": 0, - "environment": { "GO_VERSION": "1.4" } - }, - { - "number": 2, - "status": "success", - "started_at": 5788800, - "finished_at": 5789500, - "exit_code": 0, - "environment": { "GO_VERSION": "1.5" } - } - ] -} diff --git a/docs/samples/builds.json b/docs/samples/builds.json deleted file mode 100644 index 5fd051e67..000000000 --- a/docs/samples/builds.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "number": 1, - "status": "success", - "started_at": 5788800, - "finished_at": 5789500, - "head_commit": { - "sha": "d101ef3ed6e973b039c3fd5ccdec378b0fa8684c", - "ref": "refs\/heads\/master", - "branch": "master", - "message": "updated the README.md file", - "timestamp": "", - "remote": "https:\/\/github.com\/drone\/drone.git", - "author": { - "login": "bradrydzewski", - "email": "brad.rydzewski@gmail.com" - } - }, - } -] diff --git a/docs/samples/ccmenu.xml b/docs/samples/ccmenu.xml deleted file mode 100644 index 77f14833a..000000000 --- a/docs/samples/ccmenu.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/docs/samples/job.json b/docs/samples/job.json deleted file mode 100644 index 401df22fa..000000000 --- a/docs/samples/job.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "number": 1, - "status": "success", - "started_at": 5788800, - "finished_at": 5789500, - "exit_code": 0, - "environment": { "GO_VERSION": "1.4" } -} diff --git a/docs/samples/repo.json b/docs/samples/repo.json deleted file mode 100644 index a0dffe85b..000000000 --- a/docs/samples/repo.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "owner":"drone", - "name":"drone-test-go", - "full_name":"drone/drone-test-go", - "self_url":"http://localhost:8080/drone/drone-test-go", - "link_url":"https://github.com/drone/drone-test-go", - "clone_url":"https://github.com/drone/drone-test-go.git", - "default_branch":"master", - "private":true, - "trusted":false, - "timeout":60, - "hooks":{ - "pull_request":true, - "push":true, - "tags":false - }, - "keypair":{ - "public": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDwXK..." - }, - "permissions":{ - "pull":true, - "push":true, - "admin":true - }, - "params": { - "HEROKU_KEY": "f0e4c2f76c58916ec258f24" - } -} diff --git a/docs/samples/repos.json b/docs/samples/repos.json deleted file mode 100644 index 1f2871754..000000000 --- a/docs/samples/repos.json +++ /dev/null @@ -1,19 +0,0 @@ -[ - { - "owner":"drone", - "name":"drone-test-go", - "full_name":"drone/drone-test-go", - "self_url":"http://localhost:8080/drone/drone-test-go", - "link_url":"https://github.com/drone/drone-test-go", - "clone_url":"https://github.com/drone/drone-test-go.git", - "default_branch":"master", - "private":true, - "trusted":false, - "timeout":60, - "hooks":{ - "pull_request":true, - "push":true, - "tags":false - } - } -] diff --git a/docs/samples/token.json b/docs/samples/token.json deleted file mode 100644 index 570ba7574..000000000 --- a/docs/samples/token.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "label":"brads_token", - "issued_at":1435289846, - "hash":"yUQJHM4YfNZcCLlikAshgjM6hCMlFXmHuABAECGsMQ" -} diff --git a/docs/samples/tokens.json b/docs/samples/tokens.json deleted file mode 100644 index 0bb1bf93d..000000000 --- a/docs/samples/tokens.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "label":"brads_token", - "issued_at":1435289846 - } -] diff --git a/docs/samples/user.json b/docs/samples/user.json deleted file mode 100644 index 7f0a7eed1..000000000 --- a/docs/samples/user.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "Octocat", - "email": "octocat@github.com", - "avatar": "https://www.gravatar.com/avatar/7194e8d48fa1d2b689f99443b767316c", - "admin": false, - "active": true -} diff --git a/docs/samples/users.json b/docs/samples/users.json deleted file mode 100644 index 4f6f339f3..000000000 --- a/docs/samples/users.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - { - "name": "Octocat", - "email": "octocat@github.com", - "avatar": "https://www.gravatar.com/avatar/7194e8d48fa1d2b689f99443b767316c", - "admin": false, - "active": true - } -] diff --git a/docs/setup/README.md b/docs/setup/README.md index 19f5eb5d1..d8366e409 100644 --- a/docs/setup/README.md +++ b/docs/setup/README.md @@ -1,13 +1,13 @@ -* [Install](#) +* Install * [Ubuntu](ubuntu.md) * [Docker](install.md) -* [Setup](#) +* Setup * [Server](server.md) * [Docker](docker.md) * [GitHub](github.md) * [GitLab](gitlab.md) * [Bitbucket](bitbucket.md) -* [Database](#) +* Database * [SQLite](sqlite.md) * [MySQL](mysql.md) * [Postgres](postgres.md) diff --git a/engine/engine.go b/engine/engine.go index 32f1c9eb3..c0524332e 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -410,6 +410,9 @@ func (e *engine) runJobNotify(r *Task, client dockerclient.Client) error { log.Infof("preparing container %s", name) info, err := docker.Run(client, conf, name) + if err != nil { + log.Errorf("Error starting notification container %s. %s", name, err) + } // for debugging purposes we print a failed notification executions // output to the logs. Otherwise we have no way to troubleshoot failed diff --git a/static/static.go b/static/static.go index fca849a6e..ec027fc97 100644 --- a/static/static.go +++ b/static/static.go @@ -7,8 +7,10 @@ import ( ) //go:generate go run ../contrib/generate-js.go -dir scripts/ -o scripts_gen/drone.min.js -//go:generate go run ../contrib/generate-api-docs.go -input ../docs/swagger.yml -template ../template/amber/swagger.amber -output docs_gen/api/index.html -//go:generate go run ../contrib/generate-docs.go -input ../docs/build/README.md -template ../template/amber/docs.amber -output docs_gen/build/ +//go:generate go run ../contrib/generate-api-docs.go -input ../docs/swagger.yml -template ../template/amber/swagger.amber -output docs_gen/api/index.html +//go:generate go run ../contrib/generate-docs.go -input ../docs/build/README.md -name Builds -template ../template/amber/docs.amber -output docs_gen/build/ +//go:generate go run ../contrib/generate-docs.go -input ../docs/plugin/README.md -name Plugins -template ../template/amber/docs.amber -output docs_gen/plugin/ +//go:generate go run ../contrib/generate-docs.go -input ../docs/setup/README.md -name Install -template ../template/amber/docs.amber -output docs_gen/setup/ //go:generate sassc --style compact styles/style.sass styles_gen/style.css //go:generate go-bindata-assetfs -ignore "\\.go" -pkg static -o static_gen.go ./... diff --git a/static/styles/pages/docs.sass b/static/styles/pages/docs.sass index fd10b12ac..ed14b9304 100644 --- a/static/styles/pages/docs.sass +++ b/static/styles/pages/docs.sass @@ -237,14 +237,21 @@ padding:0px; margin:0px; list-style-type: none; - a + li + position:relative; + color: rgba(0,0,0,0.5); + text-transform: uppercase; + font-size: 13px; + li a color:rgba(43, 48, 59, 0.8); line-height: 30px; display: block; - li - position:relative; + font-size: 16px; + text-transform: none; li.active a color:#2b303b; + font-size: 16px; + text-transform: none; li.active:before content: ""; border-left: 4px solid #2b303b; @@ -252,6 +259,9 @@ top: 0px; bottom: 0px; left: -20px; + ul + margin-bottom: 25px; + margin-top: 5px; .content-main max-width: 900px; margin: 0px auto; diff --git a/static/styles_gen/style.css b/static/styles_gen/style.css index 5b621fdd7..37a2e244b 100644 --- a/static/styles_gen/style.css +++ b/static/styles_gen/style.css @@ -381,14 +381,16 @@ body.login div.alert { position: fixed; top: 0px; left: 0px; right: 0px; line-he .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; color: rgba(0, 0, 0, 0.5); text-transform: uppercase; font-size: 13px; } -.docs-usage .row .content-nav ul li { position: relative; } +.docs-usage .row .content-nav ul li a { color: rgba(43, 48, 59, 0.8); line-height: 30px; display: block; font-size: 16px; text-transform: none; } -.docs-usage .row .content-nav ul li.active a { color: #2b303b; } +.docs-usage .row .content-nav ul li.active a { color: #2b303b; font-size: 16px; text-transform: none; } .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-nav ul ul { margin-bottom: 25px; margin-top: 5px; } + .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; } diff --git a/template/amber/docs.amber b/template/amber/docs.amber index 2be722a4c..f2182dfab 100644 --- a/template/amber/docs.amber +++ b/template/amber/docs.amber @@ -8,13 +8,19 @@ block header li Documentation ul.nav.nav-tabs li.nav-item - a.nav-link[href="#"] Install + a[class="nav-link"][href="../setup/ubuntu.html"] + .active ? Site.Name == "Install" + | Install li.nav-item - a.nav-link[href="#"] Builds + a[class="nav-link"][href="../build/overview.html"] + .active ? Site.Name == "Builds" + | Builds li.nav-item - a.nav-link[href="#"] Plugins + a[class="nav-link"][href="../plugin/overview.html"] + .active ? Site.Name == "Plugins" + | Plugins li.nav-item - a.nav-link[href="#"] API Reference + a.nav-link[href="../api/index.html"] API Reference block content div.container-fluid.docs.docs-usage diff --git a/template/amber/swagger.amber b/template/amber/swagger.amber index 1cd4ff3e3..44c1c189b 100644 --- a/template/amber/swagger.amber +++ b/template/amber/swagger.amber @@ -8,11 +8,11 @@ block header li Documentation ul.nav.nav-tabs li.nav-item - a.nav-link[href="#"] Install + a.nav-link[href="../setup/ubuntu.html"] Install li.nav-item - a.nav-link[href="#"] Builds + a.nav-link[href="../build/overview.html"] Builds li.nav-item - a.nav-link[href="#"] Plugins + a.nav-link[href="../plugin/overview.html"] Plugins li.nav-item a.nav-link.active[href="#"] API Reference @@ -27,7 +27,7 @@ block content ul each $op in $tag.Ops li - a[href="#"+$op.ID][data-method=$op.Method] #{$op.Path} + a[href="#"+$op.ID][data-method=$op.Method] #{$op.Summary} div.row each $tag in Swagger.Tags each $op in $tag.Ops