Skip to content

Commit 4ade9fd

Browse files
committed
add automatic doc build & deploy
this adds a Make target to automatically build and deploy docs and hooks it up to travis-ci. This commit also ports the packaging tasks from a utils shell script to a Make target.
1 parent c467955 commit 4ade9fd

File tree

5 files changed

+2435
-64
lines changed

5 files changed

+2435
-64
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,11 @@ m4
2929
*gcno
3030
html
3131
coverage.info
32+
33+
# packaging
34+
*.rpm
35+
*.deb
36+
usr
37+
38+
# generated files
39+
docs

.travis.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
language: cpp
2-
# command to install dependencies
32
script: ./autogen.sh && ./configure --enable-coverage && make test
43
before_script:
5-
- ./utils/build_gtest.sh
6-
- gem install coveralls-lcov
4+
- ./utils/build_gtest.sh
5+
- gem install coveralls-lcov
76
after_success:
8-
- make coverage.info
9-
- coveralls-lcov coverage.info
7+
- make coverage.info
8+
- coveralls-lcov coverage.info
9+
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && make
10+
deploy-docs
1011
sudo: false
1112
addons:
1213
apt:
1314
packages:
1415
- build-essential
1516
- libcurl4-openssl-dev
17+
- doxygen
18+
env:
19+
global:
20+
secure: RBqsrKEQwH7g4gFKqIDvMIPctt402mxnW36RYg8X5yRZhAyiiF116m9G514coNDYndbnxtNLhtzMI5Vq+vVcDasXsms52VHedVXWTtJ/GfQo4GrTFaPNblG/WsWhwJqU/kSoldkX1G/rLKz6F+ds0ZCEUPy/4rPFlCF+jUJTR/I=

Makefile.am

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ librestclient_cpp_la_SOURCES=source/restclient.cpp
1212
librestclient_cpp_la_CXXFLAGS=-fPIC
1313
librestclient_cpp_la_LDFLAGS=-version-info 1:0:1
1414

15-
.PHONY: test check clean-coverage-files coverage-html
15+
.PHONY: test check clean-coverage-files coverage-html docs clean-docs deploy-docs doxygen jekyll packages rpm deb
1616

1717
test: check
1818
./test-program
@@ -26,3 +26,57 @@ coverage.info: test
2626

2727
coverage-html: coverage.info
2828
./utils/lcov-1.11/bin/genhtml -t "restclient-cpp coverage report" --legend --show-details coverage.info --output-directory html
29+
30+
local-install:
31+
$(MAKE) install PREFIX=usr
32+
33+
NAME=restclient-cpp
34+
VERSION = $(shell git describe --tags --always --dirty)
35+
BUILDER = $(shell echo "`git config user.name` <`git config user.email`>")
36+
PKG_RELEASE ?= 1
37+
PROJECT_URL="https://github.com/mrtazz/$(NAME)"
38+
FPM_FLAGS= --name $(NAME) --version $(VERSION) --iteration $(PKG_RELEASE) --epoch 1 --license MIT --maintainer "$(BUILDER)" --url $(PROJECT_URL) --vendor mrtazz usr
39+
40+
rpm:
41+
fpm -t rpm -s dir $(FPM_FLAGS)
42+
43+
deb:
44+
fpm -t deb -s dir $(FPM_FLAGS)
45+
46+
packages: local-install rpm deb
47+
48+
include/snyder/version.h:
49+
m4 -I m4 --define=M4_SNYDER_VERSION=$(VERSION) version.h.m4 > $@
50+
51+
52+
GAUGES_CODE="539c6c8de32bb442640005f3"
53+
54+
doxygen:
55+
doxygen doxygen.config
56+
57+
jekyll:
58+
echo "gaugesid: $(GAUGES_CODE)" > docs/_config.yml
59+
echo "projecturl: $(PROJECT_URL)" >> docs/_config.yml
60+
echo "basesite: http://www.unwiredcouch.com" >> docs/_config.yml
61+
echo "markdown: redcarpet" >> docs/_config.yml
62+
echo "---" > docs/index.md
63+
echo "layout: project" >> docs/index.md
64+
echo "title: restclient-cpp" >> docs/index.md
65+
echo "---" >> docs/index.md
66+
cat README.md >> docs/index.md
67+
68+
docs: doxygen jekyll
69+
70+
clean-docs:
71+
rm -rf ./docs
72+
73+
deploy-docs: docs
74+
cd docs && git init && git remote add upstream "https://${GH_TOKEN}@github.com/mrtazz/$(NAME).git" && \
75+
git submodule add https://github.com/mrtazz/jekyll-layouts.git ./_layouts && \
76+
git submodule update --init && \
77+
git fetch upstream && git reset upstream/gh-pages && \
78+
git config user.name 'Daniel Schauenberg' && git config user.email d@unwiredcouch.com && \
79+
touch . && git add -A . && \
80+
git commit -m "rebuild pages at $(VERSION)" && \
81+
git push upstream HEAD:gh-pages
82+

0 commit comments

Comments
 (0)