Skip to content

Commit

Permalink
Add build docs script
Browse files Browse the repository at this point in the history
Backport elastic#1873
  • Loading branch information
ruflin committed Jun 16, 2016
1 parent 3b94426 commit 8990d7b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ fmt:

simplify:
$(foreach var,$(PROJECTS),make -C $(var) simplify || exit 1;)

# Builds the documents for each beat
.PHONY: docs
docs:
sh libbeat/scripts/build_docs.sh ${PROJECTS}
22 changes: 22 additions & 0 deletions libbeat/scripts/build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

# Checks if docs clone already exists
if [ ! -d "build/docs" ]; then
# Only head is cloned
git clone --depth=1 https://github.com/elastic/docs.git build/docs
else
echo "build/docs already exists. Not cloning."
fi

# beatnames must be passed as parameters. Example: packetbeat filebeat
for name in $*
do
index="$GOPATH/src/github.com/elastic/beats/${name}/docs/index.asciidoc"
echo $index
if [ -f "$index" ]; then
echo "Building docs for ${name}..."
dest_dir="build/html_docs/${name}"
mkdir -p "$dest_dir"
./build/docs/build_docs.pl --doc "$index" -out "$dest_dir"
fi
done

0 comments on commit 8990d7b

Please sign in to comment.