Skip to content

Commit

Permalink
Moved travis commands into make file for local development
Browse files Browse the repository at this point in the history
This will allow using the same commands as run by travis via the
Makefile for local development.
  • Loading branch information
cebe committed Jan 12, 2017
1 parent 97bcdd3 commit b69143a
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# generated website files
/hs-toxcore
/toktok-site
_site
17 changes: 4 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,12 @@ env:

install:
- gem install jekyll mdl
- git clone --depth=1 https://github.com/TokTok/hs-toxcore
- make hs-toxcore

script:
- mdl -w -s .md-style.rb toktok
- cp -a hs-toxcore/res toktok/
- >
(cd hs-toxcore && \
pandoc -f latex+lhs -t native src/tox/Network/Tox.lhs \
| grep -v '^,CodeBlock ' \
| pandoc -f native -t markdown_github \
>> ../toktok/spec.md)
- curl https://git-critique.herokuapp.com/hello/changelog >> toktok/changelog/c-toxcore.md
- curl https://git-critique.herokuapp.com/hello/roadmap >> toktok/roadmap/c-toxcore.md
- make toktok-site
- linkchecker --ignore-url "https://travis-ci.org.*" --ignore-url "irc://.*" toktok-site || true
- make lint
- make all
- make check || true

after_success:
- git config --global push.default simple
Expand Down
45 changes: 44 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,50 @@ else
WEB_REPO := git@github.com:TokTok/$(WEB_NAME)
endif

all: changelog roadmap spec toktok-site

#
# build the website with jekyll
#
toktok-site: $(shell which jekyll) $(shell find toktok -type f) emoij
rm -rf $@
cd toktok && jekyll build && mv _site ../$@

#
# single pages, generated from external content
#
changelog: toktok/changelog/c-toxcore.md
roadmap: toktok/roadmap/c-toxcore.md
toktok/%/c-toxcore.md: toktok/%/c-toxcore.md.dist
cp $< $@
curl https://git-critique.herokuapp.com/hello/$* >> $@

spec: toktok/spec.md
toktok/spec.md: hs-toxcore $(shell find hs-toxcore -name "*.lhs" 2> /dev/null)
cp $@.dist $@
cp -a hs-toxcore/res toktok/
cd hs-toxcore && \
pandoc -f latex+lhs -t native src/tox/Network/Tox.lhs \
| grep -v '^,CodeBlock ' \
| pandoc -f native -t markdown_github \
>> ../toktok/spec.md

hs-toxcore:
if [ -d $@ ] ; then \
cd $@ && git pull ;\
else \
git clone --depth=1 https://github.com/TokTok/hs-toxcore $@ ;\
fi

#
# deployment tasks
#
lint:
mdl -w -s .md-style.rb toktok

check:
linkchecker --ignore-url "https://travis-ci.org.*" --ignore-url "irc://.*" toktok-site

upload: toktok-site
@test -d $(WEB_NAME) || git clone --depth=1 $(WEB_REPO)
rm -rf $(WEB_NAME)/*
Expand All @@ -19,7 +59,9 @@ upload: toktok-site
cd $(WEB_NAME) && git commit --amend --reset-author -m'Updated website'
cd $(WEB_NAME) && git push --force --quiet


#
# emoij generator
#
toktok/static/img/emoij/16x16/%.png:
mkdir -p toktok/static/img/emoij/16x16
wget https://raw.githubusercontent.com/twitter/twemoji/gh-pages/16x16/$*.png -O $@
Expand All @@ -29,3 +71,4 @@ emoij: $(addsuffix .png,$(addprefix toktok/static/img/emoij/16x16/,$(shell grep

clean-emoij:
rm -r toktok/static/img/emoij/16x16

24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# website

The new website with something better than Yst (also, change the title)

## Development

To work on the website you need the following things:

- Jekyll and mdl via ruby gems: `gem install jekyll mdl` (mdl is optional, for linting the markdown).
- pandoc, version 1.10 or higher
(optional for building the spec).

Install it via `apt-get install pandoc`,
or `cabal install pandoc`, if you prefer the haskell way of doing it (this may take a while to install though).
See <http://pandoc.org/installing.html> for other methods.
- linkchecker via `apt-get install linkchecker`
(optional for link checking).

The follwing make targets are available:

- `make all`: build the complete website including external content.
- `make changelog`: download changelogs (included in `all`)
- `make roadmap`: download roadmaps (included in `all`)
- `make spec`: download and parse the spec with pandoc (included in `all`)
- `make lint`: run markdown linter `mdl`
- `make check`: run linkchecker

8 changes: 8 additions & 0 deletions toktok/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ _site

# ignore emoij, they are downloaded on deployment
/static/img/emoij

# auto generated files
/changelog/c-toxcore.md
/roadmap/c-toxcore.md
/spec.md
/res


File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b69143a

Please sign in to comment.