Browse Source

Merge pull request #7864 from gyuho/doc-link-fixes

*: run 'marker' in CI
Gyu-Ho Lee 8 years ago
parent
commit
505bf8c708
5 changed files with 50 additions and 4 deletions
  1. 1 0
      .travis.yml
  2. 8 2
      Documentation/op-guide/configuration.md
  3. 8 2
      Documentation/v2/configuration.md
  4. 21 0
      scripts/install-marker.sh
  5. 12 0
      test

+ 1 - 0
.travis.yml

@@ -46,6 +46,7 @@ before_install:
  - go get -v -u honnef.co/go/tools/cmd/gosimple
  - go get -v -u honnef.co/go/tools/cmd/unused
  - go get -v -u honnef.co/go/tools/cmd/staticcheck
+ - ./scripts/install-marker.sh amd64
 
 # disable godep restore override
 install:

+ 8 - 2
Documentation/op-guide/configuration.md

@@ -185,7 +185,10 @@ To start etcd automatically using custom settings at startup in Linux, using a [
 
 The security flags help to [build a secure etcd cluster][security].
 
-### --ca-file [DEPRECATED]
+### --ca-file 
+
+**DEPRECATED**
+
 + Path to the client server TLS CA file. `--ca-file ca.crt` could be replaced by `--trusted-ca-file ca.crt --client-cert-auth` and etcd will perform the same.
 + default: none
 + env variable: ETCD_CA_FILE
@@ -215,7 +218,10 @@ The security flags help to [build a secure etcd cluster][security].
 + default: false
 + env variable: ETCD_AUTO_TLS
 
-### --peer-ca-file [DEPRECATED]
+### --peer-ca-file 
+
+**DEPRECATED**
+
 + Path to the peer server TLS CA file. `--peer-ca-file ca.crt` could be replaced by `--peer-trusted-ca-file ca.crt --peer-client-cert-auth` and etcd will perform the same.
 + default: none
 + env variable: ETCD_PEER_CA_FILE

+ 8 - 2
Documentation/v2/configuration.md

@@ -176,7 +176,10 @@ To start etcd automatically using custom settings at startup in Linux, using a [
 
 The security flags help to [build a secure etcd cluster][security].
 
-### --ca-file [DEPRECATED]
+### --ca-file
+
+**DEPRECATED**
+
 + Path to the client server TLS CA file. `--ca-file ca.crt` could be replaced by `--trusted-ca-file ca.crt --client-cert-auth` and etcd will perform the same.
 + default: none
 + env variable: ETCD_CA_FILE
@@ -201,7 +204,10 @@ The security flags help to [build a secure etcd cluster][security].
 + default: none
 + env variable: ETCD_TRUSTED_CA_FILE
 
-### --peer-ca-file [DEPRECATED]
+### --peer-ca-file
+
+**DEPRECATED**
+
 + Path to the peer server TLS CA file. `--peer-ca-file ca.crt` could be replaced by `--peer-trusted-ca-file ca.crt --peer-client-cert-auth` and etcd will perform the same.
 + default: none
 + env variable: ETCD_PEER_CA_FILE

+ 21 - 0
scripts/install-marker.sh

@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -e
+
+ARCH=$1
+
+if [ -z "$1" ]; then
+    echo "Usage: ${0} [amd64 or darwin], defaulting to 'amd64'" >> /dev/stderr
+    ARCH=amd64
+fi
+
+MARKER_URL=https://storage.googleapis.com/etcd/test-binaries/marker-v0.4.0-x86_64-unknown-linux-gnu
+if [ ${ARCH} == "darwin" ]; then
+    MARKER_URL=https://storage.googleapis.com/etcd/test-binaries/marker-v0.4.0-x86_64-apple-darwin
+fi
+
+echo "Installing marker"
+curl -L ${MARKER_URL} -o ${GOPATH}/bin/marker
+chmod 755 ${GOPATH}/bin/marker
+
+${GOPATH}/bin/marker --version

+ 12 - 0
test

@@ -233,6 +233,18 @@ function fmt_pass {
 		exit 255
 	fi
 
+	# TODO: check other markdown files when marker handles headers with '[]'
+	if which marker >/dev/null; then
+		echo "Checking marker to find broken links..."
+		markerResult=`marker --skip-http --root ./Documentation 2>&1 || true`
+		if [ -n "${markerResult}" ]; then
+			echo -e "marker checking failed:\n${markerResult}"
+			exit 255
+		fi
+	else
+		echo "Skipping marker..."
+	fi
+
 	if which goword >/dev/null; then
 		echo "Checking goword..."
 		# get all go files to process