-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (40 loc) · 1.51 KB
/
Makefile
File metadata and controls
54 lines (40 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
protocol_dir="lib/tus-resumable-upload-protocol"
protocol_html="protocol.html"
protocol_target="protocols/resumable-upload.html"
onthegithubs_dir="node_modules/on-the-githubs"
ghpages_repo="tus/tus.github.io"
ghpages_branch="master"
all: site protocol community publish
site:
jekyll build
protocol:
git submodule update --init
cd $(protocol_dir) && npm install
make -C $(protocol_dir) $(protocol_html)
echo "---\nlayout: protocol\ntitle: tus resumable upload protocol\ncomments: true\n---\n" > "$(protocol_target)"
cat "$(protocol_dir)/$(protocol_html)" >> "$(protocol_target)"
community:
npm install
$(onthegithubs_dir)/bin/in-the-githubs \
--user tus \
--repo tus.io,tusd,tus-jquery-client,tus-ios-client,tus-android-client,tus-resumable-upload-protocol \
--format html \
--concurrency 1 \
--input _site/about.html \
--tag '<p>replaced-by-in-the-githubs</p>' \
--output _site/about.html \
--debug
publish:
rm -rf /tmp/publish-ghpages
mkdir -p /tmp/publish-ghpages
# Custom steps
cp -Raf ./_site/* /tmp/publish-ghpages/
rm -rf /tmp/publish-ghpages/{lib,node_modules}
echo 'This repo is just a deploy target. Do not edit. You changes will be lost.' > /tmp/publish-ghpages/README.md
cd /tmp/publish-ghpages \
&& git init && git add . \
&& git commit -nm "Update $(ghpages_repo) site by $${USER}" \
&& git remote add origin git@github.com:$(ghpages_repo).git \
&& git push origin master:refs/heads/$(ghpages_branch) --force
rm -rf /tmp/publish-ghpages
.PHONY: protocol site community publish