Skip to content

Commit 62fea05

Browse files
authored
Automatic generation of documentation (#818)
* generate a detailed CLI help * generate a documentation site * new readme
1 parent 235ab66 commit 62fea05

File tree

152 files changed

+9535
-579
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+9535
-579
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ lego.exe
55
.vscode/
66
dist/
77
builds/
8+
docs/

.travis.yml

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
language: go
22

33
go:
4-
- 1.10.x
4+
- 1.12.x
55
- 1.x
66

77
services:
88
- memcached
99

10+
go_import_path: github.com/xenolf/lego
11+
1012
addons:
1113
hosts:
1214
# for e2e tests
@@ -33,13 +35,24 @@ before_install:
3335
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.15.0
3436
- golangci-lint --version
3537

38+
# Hugo - documentation
39+
- wget -O /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.54.0/hugo_0.54.0_Linux-64bit.deb
40+
- sudo dpkg -i /tmp/hugo.deb
41+
3642
install:
3743
- echo "TRAVIS_GO_VERSION=$TRAVIS_GO_VERSION"
3844
- dep status -v
3945

4046
after_success:
4147
- make clean
4248

49+
before_deploy:
50+
- >
51+
if ! [ "$BEFORE_DEPLOY_RUN" ]; then
52+
export BEFORE_DEPLOY_RUN=1;
53+
make docs-build
54+
fi
55+
4356
deploy:
4457
- provider: script
4558
skip_cleanup: true
@@ -57,3 +70,11 @@ deploy:
5770
on:
5871
tags: true
5972
condition: $TRAVIS_GO_VERSION =~ ^1\.x$
73+
74+
- provider: pages
75+
local_dir: docs/public
76+
skip_cleanup: true
77+
github_token: ${GITHUB_TOKEN}
78+
on:
79+
tags: true
80+
condition: $TRAVIS_GO_VERSION =~ ^1\.x$

CONTRIBUTING.md

-59
Original file line numberDiff line numberDiff line change
@@ -73,62 +73,3 @@ git push -u origin my-feature
7373

7474
## create a pull request on Github ##
7575
```
76-
77-
78-
## DNS Providers: API references
79-
80-
| DNS provider | Code | Documentation | Go client |
81-
|---------------------------|----------------|--------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
82-
| Acme DNS | `acmedns` | [documentation](https://github.com/joohoi/acme-dns#api) | [Go client](https://github.com/cpu/goacmedns) |
83-
| Alibaba Cloud | `alidns` | [documentation](https://www.alibabacloud.com/help/doc-detail/42875.htm) | [Go client](https://github.com/aliyun/alibaba-cloud-sdk-go) |
84-
| Aurora DNS | `auroradns` | [documentation](https://libcloud.readthedocs.io/en/latest/dns/drivers/auroradns.html#api-docs) | [Go client](https://github.com/nrdcg/auroradns) |
85-
| Azure | `azure` | [documentation](https://docs.microsoft.com/en-us/go/azure/) | [Go client](https://github.com/Azure/azure-sdk-for-go) |
86-
| Bluecat | `bluecat` | ? | - |
87-
| Cloudflare | `cloudflare` | [documentation](https://api.cloudflare.com/) | [Go client](https://github.com/cloudflare/cloudflare-go) |
88-
| ClouDNS | `cloudns` | [documentation](https://www.cloudns.net/wiki/article/42/) | - |
89-
| CloudXNS | `cloudxns` | [documentation](https://www.cloudxns.net/Public/Doc/CloudXNS_api2.0_doc_zh-cn.zip) | - |
90-
| ConoHa | `conoha` | [documentation](https://www.conoha.jp/docs/) | - |
91-
| Openstack Designate | `designate` | [documentation](https://docs.openstack.org/designate/latest/) | [Go client](https://godoc.org/github.com/gophercloud/gophercloud/openstack/dns/v2) |
92-
| Digital Ocean | `digitalocean` | [documentation](https://developers.digitalocean.com/documentation/v2/#domain-records) | - |
93-
| DNSimple | `dnsimple` | [documentation](https://developer.dnsimple.com/v2/) | [Go client](https://github.com/dnsimple/dnsimple-go) |
94-
| DNS Made Easy | `dnsmadeeasy` | [documentation](https://api-docs.dnsmadeeasy.com/) | - |
95-
| DNSPod | `dnspod` | [documentation](https://www.dnspod.cn/docs/index.html) | [Go client](https://github.com/decker502/dnspod-go) |
96-
| DreamHost | `dreamhost` | [documentation](https://help.dreamhost.com/hc/en-us/articles/217560167-API_overview) | - |
97-
| Duck DNS | `duckdns` | [documentation](https://www.duckdns.org/spec.jsp) | - |
98-
| Dyn | `dyn` | [documentation](https://help.dyn.com/rest/) | - |
99-
| exec | `exec` | - | - |
100-
| Exoscale | `exoscale` | [documentation](https://community.exoscale.com/documentation/dns/api/) | [Go client](https://github.com/exoscale/egoscale) |
101-
| FastDNS | `fastdns` | [documentation](https://developer.akamai.com/api/web_performance/fast_dns_record_management/v1.html) | [Go client](https://github.com/akamai/AkamaiOPEN-edgegrid-golang) |
102-
| Gandi | `gandi` | [documentation](http://doc.rpc.gandi.net/index.html) | - |
103-
| Gandi v5 | `gandiv5` | [documentation](http://doc.livedns.gandi.net) | - |
104-
| Google Cloud | `gcloud` | ? | [Go client](https://github.com/googleapis/google-api-go-client) |
105-
| Glesys | `glesys` | [documentation](https://github.com/GleSYS/API/wiki/API-Documentation) | - |
106-
| Go Daddy | `godaddy` | [documentation](https://developer.godaddy.com/doc/endpoint/domains) | - |
107-
| hosting.de | `hostingde` | [documentation](https://www.hosting.de/api/#dns) | - |
108-
| Internet Initiative Japan | `iij` | [documentation](http://manual.iij.jp/p2/pubapi/) | [Go client](https://github.com/iij/doapi) |
109-
| INWX | `inwx` | [documentation](https://www.inwx.de/en/help/apidoc) | [Go client](https://github.com/nrdcg/goinwx) |
110-
| Lightsail | `lightsail` | ? | [Go client](https://github.com/aws/aws-sdk-go/aws) |
111-
| Linode (deprecated) | `linode` | [documentation](https://www.linode.com/api/dns) | [Go client](https://github.com/timewasted/linode) |
112-
| Linodev4 | `linodev4` | [documentation](https://developers.linode.com/api/v4) | [Go client](https://github.com/linode/linodego) |
113-
| Namecheap | `namecheap` | [documentation](https://www.namecheap.com/support/api/methods.aspx) | - |
114-
| Name.com | `namedotcom` | [documentation](https://www.name.com/api-docs/DNS) | [Go client](https://github.com/namedotcom/go) |
115-
| manual | `manual` | - | - |
116-
| MyDNS.jp | `mydnsjp` | [documentation](https://www.mydns.jp/?MENU=030) | - |
117-
| Netcup | `netcup` | [documentation](https://www.netcup-wiki.de/wiki/DNS_API) | - |
118-
| NIFCloud | `nifcloud` | [documentation](https://mbaas.nifcloud.com/doc/current/rest/common/format.html) | - |
119-
| NS1 | `ns1` | [documentation](https://ns1.com/api) | [Go client](https://github.com/ns1/ns1-go) |
120-
| Open Telekom Cloud | `otc` | [documentation](https://docs.otc.t-systems.com/en-us/dns/index.html) | - |
121-
| Oracle Cloud | `oraclecloud` | [documentation](https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm) | [Go Client](https://github.com/oracle/oci-go-sdk) |
122-
| OVH | `ovh` | [documentation](https://eu.api.ovh.com/) | [Go client](https://github.com/ovh/go-ovh) |
123-
| PowerDNS | `pdns` | [documentation](https://doc.powerdns.com/md/httpapi/README/) | - |
124-
| Rackspace | `rackspace` | [documentation](https://developer.rackspace.com/docs/cloud-dns/v1/) | - |
125-
| RFC2136 | `rfc2136` | [documentation](https://tools.ietf.org/html/rfc2136) | - |
126-
| Route 53 | `route53` | [documentation](https://docs.aws.amazon.com/Route53/latest/APIReference/API_Operations_Amazon_Route_53.html) | [Go client](https://github.com/aws/aws-sdk-go/aws) |
127-
| Sakura Cloud | `sakuracloud` | [documentation](https://developer.sakura.ad.jp/cloud/api/1.1/) | [Go client](https://github.com/sacloud/libsacloud) |
128-
| Selectel | `selectel` | [documentation](https://kb.selectel.com/23136054.html) | - |
129-
| Stackpath | `stackpath` | [documentation](https://developer.stackpath.com/en/api/dns/#tag/Zone) | - |
130-
| TransIP | `transip` | [documentation](https://api.transip.nl/docs/transip.nl/package-Transip.html) | [Go client](https://github.com/transip/gotransip) |
131-
| VegaDNS | `vegadns` | [documentation](https://github.com/shupp/VegaDNS-API) | [Go client](https://github.com/OpenDNS/vegadns2client) |
132-
| Vultr | `vultr` | [documentation](https://www.vultr.com/api/#dns) | [Go client](https://github.com/JamesClonk/vultr) |
133-
| Vscale | `vscale` | [documentation](https://developers.vscale.io/documentation/api/v1/#api-Domains_Records) | - |
134-
| Zone.ee | `zone` | [documentation](https://api.zone.eu/v2) | - |

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:alpine3.8 as builder
1+
FROM golang:alpine3.9 as builder
22

33
RUN apk --update upgrade \
44
&& apk --no-cache --no-progress add make git \
@@ -8,7 +8,7 @@ WORKDIR /go/src/github.com/xenolf/lego
88
COPY . .
99
RUN make build
1010

11-
FROM alpine:3.8
11+
FROM alpine:3.9
1212
RUN apk update && apk add --no-cache --virtual ca-certificates
1313
COPY --from=builder /go/src/github.com/xenolf/lego/dist/lego /usr/bin/lego
1414
ENTRYPOINT [ "/usr/bin/lego" ]

Gopkg.lock

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

+21-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: clean checks test build image dependencies
1+
.PHONY: clean checks test build image dependencies e2e fmt
22

33
SRCS = $(shell git ls-files '*.go' | grep -v '^vendor/')
44

@@ -10,7 +10,7 @@ TAG_NAME := $(shell git tag -l --contains HEAD)
1010
SHA := $(shell git rev-parse HEAD)
1111
VERSION := $(if $(TAG_NAME),$(TAG_NAME),$(SHA))
1212

13-
default: clean checks test build
13+
default: clean generate-dns checks test build
1414

1515
clean:
1616
rm -rf dist/ builds/ cover.out
@@ -39,6 +39,7 @@ fmt:
3939
gofmt -s -l -w $(SRCS)
4040

4141
# Release helper
42+
.PHONY: patch minor major detach
4243

4344
patch:
4445
go run internal/release.go release -m patch
@@ -51,3 +52,21 @@ major:
5152

5253
detach:
5354
go run internal/release.go detach
55+
56+
# Docs
57+
.PHONY: docs-build docs-serve docs-themes
58+
59+
docs-build: generate-dns
60+
@make -C ./docs hugo-build
61+
62+
docs-serve: generate-dns
63+
@make -C ./docs hugo
64+
65+
docs-themes:
66+
@make -C ./docs hugo-themes
67+
68+
# Generate DNS
69+
.PHONY: generate-dns
70+
71+
generate-dns:
72+
go generate ./...

0 commit comments

Comments
 (0)