Skip to content

Commit 5820a75

Browse files
committed
git subrepo pull website
subrepo: subdir: "website" merged: "f256d5c1fc" upstream: origin: "[email protected]:daisy/pipeline.git" branch: "website" commit: "7fdca2d2ec" git-subrepo: version: "0.3.1" origin: "???" commit: "???"
1 parent 61d15ac commit 5820a75

24 files changed

+432
-158
lines changed

website/.gitrepo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
remote = [email protected]:daisy/pipeline.git
88
branch = website
99
commit = 7fdca2d2ec86320d2d82e6e9a9fb9b4a7b84ceb5
10-
parent = b5eee561530e79cc7ec4b1cd3cd36af72a3227f8
10+
parent = 1ddd192cb4f722c3e7293fda6c68bee65a034d58
1111
cmdver = 0.3.1

website/.travis/publish.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ else
1717
git config --global user.name "travis-ci" && \
1818
git config --global user.email "[email protected]" && \
1919
make publish
20+
make publish-wiki
2021
fi

website/Makefile

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
MVN ?= mvn
12
JEKYLL_SRC_DIR := src
23
SHELL := bash
34
RUBY := bundle exec
@@ -28,7 +29,17 @@ baseurl := $(call yaml_get,$(CONFIG_FILE),baseurl)
2829
.PHONY : all
2930
all : $(JEKYLL_DIR)/_site
3031

31-
$(JEKYLL_DIR)/_site : %/_site : %/$(meta_file) %/modules %/api $(JEKYLL_FILES)
32+
ifeq ($(RUBY),bundle exec)
33+
.SECONDARY : gems
34+
gems : .bundle/config
35+
.bundle/config :
36+
bundle install --path gems
37+
else
38+
.PHONY : gems
39+
gems :
40+
endif
41+
42+
$(JEKYLL_DIR)/_site : %/_site : %/$(meta_file) %/modules %/api $(JEKYLL_FILES) | gems
3243
mkdir -p $(dir $@)
3344
cd $(dir $@) && $(JEKYLL) build --destination $(CURDIR)/$@$(baseurl)/
3445
if ! $(RUBY) make/post_process.rb $< $@$(baseurl) $(JEKYLL_DIR) $(CONFIG_FILE); then \
@@ -42,7 +53,7 @@ $(JEKYLL_FILES_CONTENT) : $(JEKYLL_DIR)/% : $(JEKYLL_SRC_DIR)/%
4253
eval "$$(echo 'newline="'; echo '"')"; \
4354
echo "---$${newline}---" | cat - $< >$@
4455

45-
$(JEKYLL_FILES_MUSTACHE) : $(JEKYLL_DIR)/% : $(JEKYLL_SRC_DIR)/% $(JEKYLL_DIR)/$(meta_file)
56+
$(JEKYLL_FILES_MUSTACHE) : $(JEKYLL_DIR)/% : $(JEKYLL_SRC_DIR)/% $(JEKYLL_DIR)/$(meta_file) | gems
4657
mkdir -p $(dir $@)
4758
cp $< $@
4859
if ! $(RUBY) make/mustache.rb $@ $(word 2,$^) $(JEKYLL_DIR) $(CONFIG_FILE); then \
@@ -79,14 +90,14 @@ $(JEKYLL_DIR)/api : $(MAVEN_DIR)/javadoc $(MAVEN_DIR)/xprocdoc
7990
cp -r $</* $@/
8091
cp -r $(word 2,$^)/* $@/
8192

82-
$(JEKYLL_DIR)/$(meta_file) : $(META_JEKYLL_DIR)/_site
93+
$(JEKYLL_DIR)/$(meta_file) : $(META_JEKYLL_DIR)/_site | gems
8394
mkdir -p $(dir $@)
8495
if ! $(RUBY) make/make_meta.rb "$<$(baseurl)/**/*.html" $<$(baseurl) $(CONFIG_FILE) >$@; then \
8596
rm -f $@; \
8697
exit 1; \
8798
fi
8899

89-
$(META_JEKYLL_DIR)/_site : %/_site : %/$(meta_file) %/modules %/api $(META_JEKYLL_FILES)
100+
$(META_JEKYLL_DIR)/_site : %/_site : %/$(meta_file) %/modules %/api $(META_JEKYLL_FILES) | gems
90101
cd $(dir $@) && $(JEKYLL) build --destination $(CURDIR)/$@$(baseurl)
91102
touch $@
92103

@@ -95,7 +106,7 @@ $(META_JEKYLL_FILES_CONTENT) : $(META_JEKYLL_DIR)/% : $(JEKYLL_SRC_DIR)/%
95106
eval "$$(echo 'newline="'; echo '"')"; \
96107
echo "---$${newline}---" | cat - $< >$@
97108

98-
$(META_JEKYLL_FILES_MUSTACHE) : $(META_JEKYLL_DIR)/% : $(JEKYLL_SRC_DIR)/% $(META_JEKYLL_DIR)/$(meta_file)
109+
$(META_JEKYLL_FILES_MUSTACHE) : $(META_JEKYLL_DIR)/% : $(JEKYLL_SRC_DIR)/% $(META_JEKYLL_DIR)/$(meta_file) | gems
99110
mkdir -p $(dir $@)
100111
cp $< $@
101112
if ! $(RUBY) make/mustache.rb $@ $(word 2,$^) $(META_JEKYLL_DIR) $(CONFIG_FILE); then \
@@ -135,7 +146,7 @@ $(META_JEKYLL_DIR)/$(meta_file) :
135146
mkdir -p $(dir $@)
136147
touch $@
137148

138-
$(MUSTACHE_DIR)/modules : $(MAVEN_DIR)/doc $(JEKYLL_DIR)/$(meta_file)
149+
$(MUSTACHE_DIR)/modules : $(MAVEN_DIR)/doc $(JEKYLL_DIR)/$(meta_file) | gems
139150
mkdir -p $(dir $@)
140151
rm -rf $@
141152
cp -r $</org/daisy/pipeline/modules $@
@@ -153,7 +164,7 @@ $(MAVEN_DIR)/sources : $(MAVEN_DIR)/pom.xml
153164
rm -rf $(MAVEN_DIR)/xprocdoc
154165
rm -rf $(MAVEN_DIR)/sources
155166
cd $(MAVEN_DIR) && \
156-
if ! mvn --quiet $(MVN_OPTS) "process-sources"; then \
167+
if ! $(MVN) "process-sources" >/dev/null ; then \
157168
rm -rf $(MAVEN_DIR)/doc; \
158169
rm -rf $(MAVEN_DIR)/javadoc; \
159170
exit 1; \
@@ -163,7 +174,7 @@ $(MAVEN_DIR)/sources : $(MAVEN_DIR)/pom.xml
163174
-exec sh -c "mkdir -p \$$(dirname $(CURDIR)/$(MAVEN_DIR)/sources/{}) && \
164175
mv {} $(CURDIR)/$(MAVEN_DIR)/sources/{}" \;
165176

166-
$(MAVEN_DIR)/pom.xml : $(JEKYLL_SRC_DIR)/_data/versions.yml $(JEKYLL_SRC_DIR)/_data/modules.yml $(JEKYLL_SRC_DIR)/_data/api.yml
177+
$(MAVEN_DIR)/pom.xml : $(JEKYLL_SRC_DIR)/_data/versions.yml $(JEKYLL_SRC_DIR)/_data/modules.yml $(JEKYLL_SRC_DIR)/_data/api.yml | gems
167178
mkdir -p $(dir $@)
168179
if ! $(RUBY) make/make_pom.rb $^ > $@; then \
169180
rm -f $@ && \
@@ -185,6 +196,10 @@ ws :
185196
publish : all
186197
make/publish.sh $(JEKYLL_DIR)/_site$(baseurl)
187198

199+
.PHONY : publish-wiki
200+
publish-wiki :
201+
make/publish-wiki.sh
202+
188203
.PHONY : clean
189204
clean :
190205
rm -rf target

website/make/post_process.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ def link_warning(link, href_attr, source_file)
170170
if rel_path =~ /^(.+)\.md$/o
171171
rel_path = $1 + '.html'
172172
end
173+
if rel_path =~ /\/$/o
174+
rel_path.sub!(/\/$/, '')
175+
end
173176
collection_files.each do |name, files|
174177
if src_path.start_with?(name)
175178
if files.key?(rel_path)

website/make/publish-wiki.sh

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
function invert() {
5+
for ((i=$#;i>=1;i--)); do echo "${!i}"; done
6+
}
7+
8+
WIKI_URL=$(git config --file src/_wiki/.gitrepo --get subrepo.remote)
9+
if [[ $WIKI_URL != "[email protected]:daisy/pipeline.wiki.git" ]]; then
10+
echo "unexpected remote url: $WIKI_URL" >&2
11+
exit 1
12+
fi
13+
WIKI_BRANCH=master
14+
15+
# If this is a local checkout (not on Travis for example), we should update the existing remotes and
16+
# tracking branches.
17+
for r in $(git remote); do
18+
if [ "$(git remote get-url $r)" = "$WIKI_URL" ]; then
19+
WIKI_REMOTE=$r
20+
break
21+
fi
22+
done
23+
24+
git fetch ${WIKI_REMOTE:-$WIKI_URL} $WIKI_BRANCH
25+
26+
if [[ -n $WIKI_REMOTE ]]; then
27+
# Find local branch that tracks wiki
28+
WIKI_HEAD=$(
29+
git for-each-ref --format="%(refname:short) %(upstream:short)" refs/heads \
30+
| grep " $WIKI_REMOTE/$WIKI_BRANCH$" 2>/dev/null \
31+
| cut -d' ' -f1)
32+
fi
33+
34+
if [[ -z $WIKI_HEAD ]]; then
35+
# If there is no tracking branch, set WIKI_HEAD it to a commit hash
36+
WIKI_HEAD=$(git rev-parse FETCH_HEAD)
37+
elif [[ $(git rev-parse $WIKI_HEAD) != $(git rev-parse FETCH_HEAD) ]]; then
38+
if git merge-base --is-ancestor $WIKI_HEAD FETCH_HEAD; then
39+
# If the local branch is behind, pull
40+
git update-ref $WIKI_HEAD FETCH_HEAD
41+
elif git merge-base --is-ancestor FETCH_HEAD $WIKI_HEAD; then
42+
# If the local branch is ahead, push
43+
git push ${WIKI_REMOTE:-$WIKI_URL} $WIKI_HEAD:$WIKI_BRANCH
44+
else
45+
echo "Your tracking branch has diverted from the wiki upstream." >&2
46+
WIKI_HEAD=$(git rev-parse FETCH_HEAD)
47+
fi
48+
fi
49+
50+
if [ -f .gitrepo ]; then
51+
# We are on a super branch. Check that it is in sync with a website branch.
52+
toplevel=$(git rev-parse --show-toplevel)
53+
cwd=$(pwd)
54+
subdir=${cwd#$toplevel/}
55+
# We can make use of git-subrepo because this command is part of the source code.
56+
cd $toplevel
57+
if ! status=$(.git-utils/git-subrepo-status --fetch --sha-only $subdir 2>/dev/null); then
58+
echo "There are unsynced commits in $subdir" >&2
59+
exit 1
60+
fi
61+
WEBSITE_HEAD=$(echo "$status" | sed "s|^$subdir @ ||")
62+
else
63+
# We are on a website branch.
64+
WEBSITE_HEAD=$(git rev-parse HEAD)
65+
fi
66+
67+
# Check whether there are changes done to src/_wiki that are not on the wiki yet
68+
last_sync=$(
69+
git log $WEBSITE_HEAD --grep='subrepo:' --format=format:%H \
70+
| perl -e 'while (<STDIN>) {
71+
chomp;
72+
$message=`git log --format=%B -n 1 $_`;
73+
if ($message =~ /^subrepo:\n +subdir: *"([^"]*)"\n merged: *"([0-9a-f]{7,})"/m) {
74+
if ($1 eq "src/_wiki") {
75+
print "$_ $2";
76+
last; }}}' \
77+
src/_wiki)
78+
last_sync_website=$(echo $last_sync | cut -d' ' -f1)
79+
last_sync_wiki=$(git rev-parse $(echo $last_sync | cut -d' ' -f2))
80+
cherry_pick_commits=$(
81+
for commit in $(git rev-list $WEBSITE_HEAD ^$last_sync_website); do
82+
if [[ -n $(git diff-tree -r $commit -- src/_wiki) ]]; then
83+
echo $commit
84+
fi
85+
done)
86+
if [[ -z $cherry_pick_commits ]]; then
87+
echo "Everything up to date" >&2
88+
exit 0
89+
else
90+
if ! git rev-parse --verify $last_sync_wiki >/dev/null 2>/dev/null; then
91+
echo "Corrupt subrepo commit: $last_sync_website" >&2
92+
exit 1
93+
fi
94+
if ! diff <(git ls-tree -r $last_sync_wiki 2>/dev/null | awk '{print $3}') \
95+
<(git ls-tree -r $last_sync_website src/_wiki 2>/dev/null | grep -vF src/_wiki/.gitrepo | awk '{print $3}') \
96+
>/dev/null; then
97+
echo "Corrupt subrepo commit: $last_sync_website" >&2
98+
exit 1
99+
fi
100+
cherry_pick_commits=($(invert $cherry_pick_commits))
101+
if [[ $last_sync_wiki != $(git rev-parse $WIKI_HEAD) ]]; then
102+
if git merge-base --is-ancestor $WIKI_HEAD $last_sync_wiki; then
103+
# If the wiki upstream is behind, push (see below)
104+
if [[ $(git rev-parse --abbrev-ref $WIKI_HEAD) == $WIKI_HEAD ]]; then
105+
git update-ref $WIKI_HEAD $last_sync_wiki
106+
else
107+
WIKI_HEAD=$last_sync_wiki
108+
fi
109+
elif git merge-base --is-ancestor $last_sync_wiki $WIKI_HEAD; then
110+
# If the wiki upstream is ahead, check if the new wiki commits are equal to the website commits
111+
new_upstream_commits=($(invert $(git rev-list $WIKI_HEAD ^$last_sync_wiki)))
112+
if [ ${#new_upstream_commits[@]} -le ${#cherry_pick_commits[@]} ]; then
113+
while [ ${#new_upstream_commits[@]} -gt 0 ]; do
114+
if diff <(git ls-tree -r ${new_upstream_commits[0]} 2>/dev/null | awk '{print $3}') \
115+
<(git ls-tree -r ${cherry_pick_commits[0]} src/_wiki 2>/dev/null \
116+
| grep -vF src/_wiki/.gitrepo \
117+
| awk '{print $3}') \
118+
>/dev/null; then
119+
unset new_upstream_commits[0]
120+
new_upstream_commits=(${new_upstream_commits[@]})
121+
unset cherry_pick_commits[0]
122+
cherry_pick_commits=(${cherry_pick_commits[@]})
123+
else
124+
break
125+
fi
126+
done
127+
fi
128+
if [ ${#new_upstream_commits[@]} -gt 0 ]; then
129+
echo "There are changes in the wiki that are not part of the website yet. Manual merge required." >&2
130+
exit 1
131+
fi
132+
if [ ${#cherry_pick_commits[@]} == 0 ]; then
133+
echo "Everything up to date" >&2
134+
exit 0
135+
fi
136+
else
137+
echo "There are changes in the wiki that are not part of the website yet. Manual merge required." >&2
138+
exit 1
139+
fi
140+
fi
141+
# Checkout wiki branch and cherry-pick all website commits that touch src/_wiki
142+
if ! git diff-index --quiet HEAD; then
143+
echo "You have uncommitted changes." >&2
144+
exit 1
145+
fi
146+
current=$(git rev-parse --abbrev-ref HEAD)
147+
git checkout $WIKI_HEAD
148+
for commit in "${cherry_pick_commits[@]}"; do
149+
git cherry-pick -Xsubtree=src/_wiki $commit
150+
done
151+
if [[ $(git rev-parse --abbrev-ref $WIKI_HEAD) != $WIKI_HEAD ]]; then
152+
WIKI_HEAD=$(git rev-parse HEAD)
153+
fi
154+
# Push
155+
git push ${WIKI_REMOTE:-$WIKI_URL} $WIKI_HEAD:$WIKI_BRANCH
156+
# Go back to previous branch
157+
git checkout $current
158+
fi

website/src/Download.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ layout: default
66
For installation instructions see
77
[Installation]({{site.baseurl}}/Get-Help/User-Guide/Installation/).
88

9+
Some packages do not include the command line tool. You can download
10+
it from
11+
[https://github.com/daisy/pipeline-cli-go/releases](https://github.com/daisy/pipeline-cli-go/releases).
12+
913
{% assign all = site.data.downloads | where:'group','main' | sort:'sort' %}
1014

1115
{% assign stable = all | where:'state','stable' %}

website/src/_data/api.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ javadoc:
22

33
- group: org.daisy.pipeline
44
artifact: clientlib-java
5-
version: 4.8.2-SNAPSHOT
5+
version: 5.0.0-SNAPSHOT
66
- group: org.daisy.pipeline
77
artifact: clientlib-java-httpclient
8-
version: 2.0.3-SNAPSHOT
8+
version: 2.1.0-SNAPSHOT
99
- group: org.daisy.pipeline
1010
artifact: common-utils
1111
- group: org.daisy.pipeline
@@ -83,7 +83,6 @@ xprocdoc:
8383
artifact: common-utils
8484
- group: org.daisy.pipeline.modules.braille
8585
artifact: css-utils
86-
version: 3.4.1-SNAPSHOT
8786
- group: org.daisy.pipeline.modules.braille
8887
artifact: dotify-utils
8988
- group: org.daisy.pipeline.modules.braille

website/src/_data/downloads.yml

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,59 @@
1-
## For file names and sizes, see:
2-
## curl -u bertfrees:*** https://api.github.com/repos/daisy/pipeline-assembly/releases
3-
## | jq '.[] | select(.tag_name == "v1.11.1") |.assets'
1+
## Generate with:
2+
## curl -u bertfrees:*** https://api.github.com/repos/daisy/pipeline-assembly/releases | jq --arg version 1.12.0 '.[] | select(.tag_name == ("v"+$version))|{group:"main",version:$version,sort:$version,state:"stable",github_tab:("v"+$version),github_url:.html_url,description:"FIXME",files:.assets|map({platform:.browser_download_url|capture("^.+\\.(?<ext>[^\\.]+)$")["ext"]|(if .=="exe" then "windows" elif.=="dmg" then "macosx" elif .=="zip" then "linux" elif .=="deb" then "debian" else "?" end),package:.browser_download_url|capture("^.+\\.(?<ext>[^\\.]+)$")["ext"]|sub("exe";"installer"),content:(if .browser_download_url|endswith(".deb") then ["gui","server"] else ["gui","server","cli"] end),url:.browser_download_url,size:.size})}' | ruby -ryaml -rjson -e 'puts YAML.dump(JSON.load(ARGF))'
3+
4+
- group: webui
5+
version: "2.7.0"
6+
state: stable
7+
github_tag: "v2.7.0"
8+
github_url: "https://github.com/daisy/pipeline-webui/releases/tag/v2.7.0"
9+
files:
10+
- platform: windows
11+
package: installer
12+
content: webui
13+
url: "http://repo1.maven.org/maven2/org/daisy/pipeline/webui/2.7.0/webui-2.7.0.msi"
14+
size: 57229644
15+
- platform: debian
16+
package: deb
17+
content: webui
18+
url: "http://repo1.maven.org/maven2/org/daisy/pipeline/webui/2.7.0/webui-2.7.0.deb"
19+
size: 54400812
20+
- platform: redhat
21+
package: rpm
22+
content: webui
23+
url: "http://repo1.maven.org/maven2/org/daisy/pipeline/webui/2.7.0/webui-2.7.0.rpm"
24+
size: 56643645
25+
26+
- group: main
27+
version: "1.12.0"
28+
sort: "1.12.0"
29+
state: stable
30+
github_tab: "v1.12.0"
31+
github_url: "https://github.com/daisy/pipeline-assembly/releases/tag/v1.12.0"
32+
description: >
33+
Includes the standalone desktop application, the server, and the command line
34+
interface. Versions available for Mac OS (a DMG disk image containing a
35+
standard Mac OS application) and Linux (ZIP and DEB files).
36+
files:
37+
- platform: debian
38+
package: deb
39+
content: [gui, server]
40+
url: "https://github.com/daisy/pipeline-assembly/releases/download/v1.12.0/pipeline2-1.12.0_debian.deb"
41+
size: 82181964
42+
- platform: linux
43+
package: zip
44+
content: [gui, server, cli]
45+
url: "https://github.com/daisy/pipeline-assembly/releases/download/v1.12.0/pipeline2-1.12.0_linux.zip"
46+
size: 87372690
47+
- platform: macosx
48+
package: dmg
49+
content: [gui, server, cli]
50+
url: "https://github.com/daisy/pipeline-assembly/releases/download/v1.12.0/pipeline2-1.12.0_mac.dmg"
51+
size: 144996109
52+
- platform: windows
53+
package: installer
54+
content: [gui, server, cli]
55+
url: "https://github.com/daisy/pipeline-assembly/releases/download/v1.12.0/pipeline2-1.12.0_windows.exe"
56+
size: 109200914
457

558
- group: main
659
version: "1.11.1"

website/src/_data/modules.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
artifact: common-utils
4949
- group: org.daisy.pipeline.modules.braille
5050
artifact: css-utils
51-
version: 3.4.1-SNAPSHOT
5251
- group: org.daisy.pipeline.modules.braille
5352
artifact: dotify-utils
5453
- group: org.daisy.pipeline.modules.braille

website/src/_data/versions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
assembly: 1.11.1
1+
assembly: 1.12.0
22
css-spec: 20160801

0 commit comments

Comments
 (0)