Skip to content

Commit 0a4297e

Browse files
committed
Merge pull request #664 from gracjan/pr-autodeploy-html-manual
Add auto deploy for html manual
2 parents 56ed241 + 63b8b4f commit 0a4297e

File tree

6 files changed

+115
-17
lines changed

6 files changed

+115
-17
lines changed

.travis.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ language: emacs-lisp
22

33
env:
44
matrix:
5-
- EMACS=emacs23
6-
- EMACS=emacs24
7-
- EMACS=emacs-snapshot
5+
- EMACS=emacs23 TARGET=check
6+
- EMACS=emacs24 TARGET=check
7+
- EMACS=emacs-snapshot TARGET=check
8+
- EMACS=emacs24 TARGET=deploy-manual
9+
global:
10+
- secure: "ejv1+ub/v+Hm/23fhp4zLAHT3HiCG+YdDHai57LDe4LfEZCeGz4i/6LazbPbwm58v2YuKvMcdNshebc1s4A293ARJryPyFfW/8kEe+3hQ+cDxunNdHfqcS8SyhcDG0mrv7dqiVAtMJqB8qZb0c161KeEM8nyhC0wyQ+EZ5qJnzM="
811

912
matrix:
1013
allow_failures:
@@ -27,9 +30,18 @@ install:
2730
sudo apt-get install -qq emacs-snapshot &&
2831
sudo apt-get install -qq emacs-snapshot-el;
2932
fi
33+
- if [ "$TARGET" = "deploy-manual" ]; then
34+
curl -O http://ftp.gnu.org/gnu/texinfo/texinfo-5.2.tar.xz;
35+
tar -xf texinfo-5.2.tar.xz;
36+
cd texinfo-5.2;
37+
./configure;
38+
make;
39+
sudo make install;
40+
cd ..;
41+
fi
3042

3143
script:
32-
lsb_release -a && $EMACS --version && make EMACS=$EMACS check
44+
lsb_release -a && $EMACS --version && make EMACS=$EMACS $TARGET
3345

3446
notifications:
3547
email: false

Makefile

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,41 +118,42 @@ info: haskell-mode.info dir
118118
dir: haskell-mode.info
119119
$(INSTALL_INFO) --dir=$@ $<
120120

121-
haskell-mode.info: haskell-mode.texi
121+
haskell-mode.info: doc/haskell-mode.texi
122122
# Check if chapter order is same as node order
123123
@sed -n -e '/@chapter/ s/@code{\(.*\)}/\1/' \
124124
-e 's/@chapter \(.*\)$$/* \1::/p' \
125125
-e 's/@unnumbered \(.*\)$$/* \1::/p' \
126-
haskell-mode.texi > haskell-mode-menu-order.txt
126+
$< > haskell-mode-menu-order.txt
127127
@sed -e '1,/@menu/ d' \
128128
-e '/end menu/,$$ d' \
129-
haskell-mode.texi > haskell-mode-content-order.txt
129+
$< > haskell-mode-content-order.txt
130130
diff -C 1 haskell-mode-menu-order.txt haskell-mode-content-order.txt
131131
@rm haskell-mode-menu-order.txt haskell-mode-content-order.txt
132132

133133
# Processing proper
134134
LANG=en_US.UTF-8 $(MAKEINFO) $(MAKEINFO_FLAGS) -o $@ $<
135135

136-
haskell-mode.html: haskell-mode.texi haskell-mode.css
137-
LANG=en_US.UTF-8 $(MAKEINFO) $(MAKEINFO_FLAGS) --html --css-include=haskell-mode.css --no-split -o $@ $<
136+
doc/haskell-mode.html: doc/haskell-mode.texi doc/haskell-mode.css
137+
LANG=en_US.UTF-8 $(MAKEINFO) $(MAKEINFO_FLAGS) --html --css-include=doc/haskell-mode.css --no-split -o $@ $<
138138

139-
html/index.html : haskell-mode.texi
140-
if [ -e html ]; then rm -r html; fi
139+
doc/html/index.html : doc/haskell-mode.texi
140+
if [ -e doc/html ]; then rm -r doc/html; fi
141141
LANG=en_US.UTF-8 $(MAKEINFO) $(MAKEINFO_FLAGS) --html \
142142
--css-ref=haskell-mode.css \
143143
-c AFTER_BODY_OPEN="<div class='background'> </div>" \
144144
-c SHOW_TITLE=0 \
145-
-o html $<
145+
-o doc/html $<
146146

147-
html/haskell-mode.css : haskell-mode.css html/index.html
147+
doc/html/haskell-mode.css : doc/haskell-mode.css doc/html/index.html
148148
cp $< $@
149149

150-
html/images/haskell-mode.svg : images/haskell-mode.svg html/index.html
151-
mkdir -p html/images
150+
doc/html/haskell-mode.svg : images/haskell-mode.svg doc/html/index.html
152151
cp $< $@
153152

154-
html : html/index.html html/haskell-mode.css html/images/haskell-mode.svg
153+
doc/html : doc/html/index.html doc/html/haskell-mode.css doc/html/haskell-mode.svg
155154

155+
deploy-manual : doc/html
156+
cd doc && ./deploy-manual.sh
156157

157158
$(AUTOLOADS): $(ELFILES) haskell-mode.elc
158159
$(BATCH) \

doc/deploy-manual.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -u
5+
6+
if [[ "${TRAVIS_REPO_SLUG:-}" != "haskell/haskell-mode" ]]; then
7+
echo "TRAVIS_REPO_SLUG is '${TRAVIS_REPO_SLUG:-}' expected 'haskell/haskell-mode'"
8+
echo "Manual deployment available only directly for 'haskell/haskell-mode' repo"
9+
exit 0
10+
fi
11+
12+
if [[ "${TRAVIS_BRANCH:-}" != "master" ]]; then
13+
echo "TRAVIS_BRANCH is '${TRAVIS_BRANCH:-}' expected 'master'"
14+
echo "Manual deployment available only for 'master' branch"
15+
exit 0
16+
fi
17+
18+
if [[ -z "${GITHUB_DEPLOY_KEY_PASSPHRASE:-}" ]]; then
19+
echo "GITHUB_DEPLOY_KEY_PASSPHRASE must be set to passphrase for github deploy key"
20+
echo "Pull requests do not have access to secure variables"
21+
exit 0
22+
fi
23+
24+
# Note: GITHUB_DEPLOY_KEY_PASSPHRASE comes from 'secure' section in .travis.yml
25+
cp haskell-mode-travis-deploy-key haskell-mode-travis-deploy-key-plain
26+
chmod 0600 haskell-mode-travis-deploy-key-plain
27+
ssh-keygen -f haskell-mode-travis-deploy-key-plain -P $GITHUB_DEPLOY_KEY_PASSPHRASE -p -N ""
28+
29+
eval $(ssh-agent)
30+
ssh-add haskell-mode-travis-deploy-key-plain
31+
32+
# Git setup, this commit should appear as if Travis made it
33+
export GIT_COMMITTER_EMAIL='[email protected]'
34+
export GIT_COMMITTER_NAME='Travis CI'
35+
export GIT_AUTHOR_EMAIL='[email protected]'
36+
export GIT_AUTHOR_NAME='Travis CI'
37+
38+
HEAD_COMMIT=$(git rev-parse --short HEAD)
39+
40+
if [ -d gh-pages-deploy ]; then
41+
rm -fr gh-pages-deploy
42+
fi
43+
44+
git clone --quiet --branch=gh-pages "[email protected]:haskell/haskell-mode.git" gh-pages-deploy
45+
46+
cd gh-pages-deploy
47+
git rm -qr manual/latest
48+
cp -r ../html manual/latest
49+
git add manual/latest
50+
(git commit -m "Update manual from haskell/haskell-mode@${HEAD_COMMIT}" && git push) || true
51+
cd ..
52+
rm -fr gh-pages-deploy
53+
54+
eval $(ssh-agent -k)
55+
echo Done!

doc/haskell-mode-travis-deploy-key

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
-----BEGIN RSA PRIVATE KEY-----
2+
Proc-Type: 4,ENCRYPTED
3+
DEK-Info: AES-128-CBC,9385B3F19E12C488ACF654D37A7B70B2
4+
5+
3ucmv5i37lwRejeFWTliQ9pfs8Vfq1G/30lnI7/GroClDiE2LAKm9tWzD8EAVdjx
6+
lAcD9gKy9g+5Gft/qj+ucXmh2OWhTz2veBIJzjuujoZBNbbgBhBGrkAzr0h2LK5u
7+
OE06F5Goz6rAjnyFbxTU9slZnWENHKpnwYBRriIq3KM1vS9Kr/0S3cYYfY5exITT
8+
Gy5uTLHDVzps5Bn7wjLgXRUoLbDRRDF6L4LPkaFyEHRt+1VjtqWc3jnMuY7P2Rru
9+
y8Mlr0cv9UzeJleTrN8AvcEtUCcl7FpieSZsGh0Q2/wEj3fEFk6Zf/q3aAqz0mn4
10+
hdp3CvTRUeYv1JibdXSptd34dpxB+9IJIbZnZ4ixaj5Ay3oCj9PPHC+qDGsjeA6J
11+
ect9EzxuVr6j4gvJYR0nOKNH1KOBOAZDhCQG0kvZxXaQyUbu5NV+kh6XUCedzfJZ
12+
XyutuOF6frUjEkJlRj5aWdgtXUDKrPDO9jnV9jknoyaOQMjWt4vd8uhkWZo+SfZ8
13+
bVO8pcx/YxNBKiHeDiLVUPc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dPYojZVWPgeskNCrxEg2/CJQ4lHGQhv8tab5HWleHCS75RjwlFpYE9Ie4K3
30+
-----END RSA PRIVATE KEY-----

haskell-mode.css renamed to doc/haskell-mode.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ div.background {
2727
width: 256px;
2828
height: 256px;
2929
opacity: 0.3;
30-
background-image: url("images/haskell-mode.svg");
30+
background-image: url("haskell-mode.svg");
3131
background-repeat: no-repeat;
3232
background-size: 256px 256px;
3333
}
File renamed without changes.

0 commit comments

Comments
 (0)