@@ -29,28 +29,11 @@ while getopts ":hl" opt; do
29
29
done
30
30
31
31
# Do some sanity-checking to make sure we are running this from the right place
32
- if [ $LOCAL -eq 1 ]; then
33
- SOURCE=" ."
34
- if ! [ -f _config.yml ]; then
35
- echo " Could not find _config.yml. We may not be in the right place. Bailing."
36
- exit 1
37
- fi
38
- else
39
- SOURCE=" md_source"
40
- if ! [ -d md_source ]; then
41
- echo " Could not find md_source directory. We may not be running in the right place. Bailing."
42
- exit 1
43
- fi
44
- fi
45
-
46
- # Reasonable default to find the Markdown files
47
- if [ -z " $SOURCE " ]; then
48
- echo " No source passed in, assuming md_source/..."
49
- SOURCE=" md_source"
32
+ if ! [ -f _config.yml ]; then
33
+ echo " Could not find _config.yml. We may not be in the right place. Bailing."
34
+ exit 1
50
35
fi
51
36
52
- echo " Operating on contents of $SOURCE "
53
-
54
37
# Parse some variables from _config.yml and make them available to this script
55
38
# This only finds top-level variables with _version in them that don't have any
56
39
# leading space. This is brittle!
@@ -61,32 +44,27 @@ while read i; do
61
44
varvalue=$( echo " $i " | sed ' s/"//g' | awk -F ' :' {' print $2' } | tr -d ' [:space:]' )
62
45
echo " Setting \$ ${varname} to $varvalue "
63
46
declare " $varname =$varvalue "
64
- done < <( cat ${SOURCE} /_config.yml | grep ' _version:' | grep ' ^[a-z].*' )
47
+ done < <( cat . /_config.yml | grep ' _version:' | grep ' ^[a-z].*' )
65
48
66
49
# Replace variable in toc.yml with value from above
67
- sedi " s/{{ site.latest_stable_docker_engine_api_version }}/$latest_stable_docker_engine_api_version /g" ${SOURCE} /_data/toc.yaml
68
-
69
- # Engine stable
70
- ENGINE_SVN_BRANCH=" branches/18.03"
71
- ENGINE_BRANCH=" 18.03"
72
- ENGINE_EDGE_BRANCH=" 18.05"
50
+ sedi " s/{{ site.latest_stable_docker_engine_api_version }}/$latest_stable_docker_engine_api_version /g" ./_data/toc.yaml
73
51
74
52
# Distribution
75
53
DISTRIBUTION_SVN_BRANCH=" branches/release/2.6"
76
54
DISTRIBUTION_BRANCH=" release/2.6"
77
55
78
56
# Directories to get via SVN. We use this because you can't use git to clone just a portion of a repository
79
- svn co https://github.com/docker/docker-ce/" $ENGINE_SVN_BRANCH " / components/cli/docs/extend ${SOURCE} /engine/extend || (echo " Failed engine/extend download" && exit - 1)
80
- svn co https://github.com/docker/docker-ce/" $ENGINE_SVN_BRANCH " / components/engine/docs/api ${SOURCE} /engine/api || (echo " Failed engine/api download" && exit - 1) # This will only get you the old API MD files 1.18 through 1.24
81
- svn co https://github.com/docker/distribution/" $DISTRIBUTION_SVN_BRANCH " /docs/spec ${SOURCE} /registry/spec || (echo " Failed registry/spec download" && exit - 1)
82
- svn co https://github.com/docker/compliance/trunk/docs/compliance ${SOURCE} /compliance || (echo " Failed docker/compliance download" && exit - 1)
57
+ svn co https://github.com/docker/docker-ce/tags/v18.03.1-ce/ components/cli/docs/extend . /engine/extend || (echo " Failed engine/extend download" && exit 1)
58
+ svn co https://github.com/docker/docker-ce/tags/v18.03.1-ce/ components/engine/docs/api . /engine/api || (echo " Failed engine/api download" && exit 1) # This will only get you the old API MD files 1.18 through 1.24
59
+ svn co https://github.com/docker/distribution/" $DISTRIBUTION_SVN_BRANCH " /docs/spec . /registry/spec || (echo " Failed registry/spec download" && exit 1)
60
+ svn co https://github.com/docker/compliance/trunk/docs/compliance . /compliance || (echo " Failed docker/compliance download" && exit 1)
83
61
84
62
# Get the Library docs
85
- svn co https://github.com/docker-library/docs/trunk ${SOURCE} /_samples/library || (echo " Failed library download" && exit - 1)
63
+ svn co https://github.com/docker-library/docs/trunk . /_samples/library || (echo " Failed library download" && exit 1)
86
64
# Remove symlinks to maintainer.md because they break jekyll and we don't use em
87
- find ${SOURCE} /_samples/library -maxdepth 9 -type l -delete
65
+ find . /_samples/library -maxdepth 9 -type l -delete
88
66
# Loop through the README.md files, turn them into rich index.md files
89
- FILES=$( find ${SOURCE} /_samples/library -type f -name ' README.md' )
67
+ FILES=$( find . /_samples/library -type f -name ' README.md' )
90
68
for f in $FILES
91
69
do
92
70
curdir=$( dirname " ${f} " )
119
97
echo GitHub repo: \[ " ${gitrepo} " \]\( " ${gitrepo} " \)\{ : target=" _blank" \} >> ${curdir} /front-matter.txt
120
98
echo >> ${curdir} /front-matter.txt
121
99
fi
122
- cat ${curdir} /front-matter.txt ${SOURCE} /_samples/boilerplate.txt > ${curdir} /header.txt
100
+ cat ${curdir} /front-matter.txt . /_samples/boilerplate.txt > ${curdir} /header.txt
123
101
echo {% raw %} >> ${curdir} /header.txt
124
102
cat ${curdir} /header.txt ${curdir} /README.md > ${curdir} /index.md
125
103
echo {% endraw %} >> ${curdir} /index.md
@@ -129,44 +107,34 @@ done
129
107
130
108
# Get the Engine APIs that are in Swagger
131
109
# Be careful with the locations on Github for these
132
- wget -O ${SOURCE} /engine/api/v1.25/swagger.yaml https://raw.githubusercontent.com/docker/docker/v1.13.0/api/swagger.yaml || (echo " Failed 1.25 swagger download" && exit -1)
133
- wget -O ${SOURCE} /engine/api/v1.26/swagger.yaml https://raw.githubusercontent.com/docker/docker/v17.03.0-ce/api/swagger.yaml || (echo " Failed 1.26 swagger download" && exit -1)
134
- wget -O ${SOURCE} /engine/api/v1.27/swagger.yaml https://raw.githubusercontent.com/docker/docker/v17.03.1-ce/api/swagger.yaml || (echo " Failed 1.27 swagger download" && exit -1)
135
-
136
- # Get the Edge API Swagger
137
110
# When you change this you need to make sure to copy the previous
138
111
# directory into a new one in the docs git and change the index.html
139
- wget -O ${SOURCE} /engine/api/v1.28/swagger.yaml https://raw.githubusercontent.com/docker/docker/v17.04.0-ce/api/swagger.yaml || (echo " Failed 1.28 swagger download or the 1.28 directory doesn't exist" && exit -1)
140
- wget -O ${SOURCE} /engine/api/v1.29/swagger.yaml https://raw.githubusercontent.com/docker/docker/17.05.x/api/swagger.yaml || (echo " Failed 1.29 swagger download or the 1.29 directory doesn't exist" && exit -1)
112
+ wget --quiet --directory-prefix=./engine/api/v1.25/ https://raw.githubusercontent.com/docker/docker/v1.13.0/api/swagger.yaml || (echo " Failed 1.25 swagger download" && exit 1)
113
+ wget --quiet --directory-prefix=./engine/api/v1.26/ https://raw.githubusercontent.com/docker/docker/v17.03.0-ce/api/swagger.yaml || (echo " Failed 1.26 swagger download" && exit 1)
114
+ wget --quiet --directory-prefix=./engine/api/v1.27/ https://raw.githubusercontent.com/docker/docker/v17.03.1-ce/api/swagger.yaml || (echo " Failed 1.27 swagger download" && exit 1)
115
+ wget --quiet --directory-prefix=./engine/api/v1.28/ https://raw.githubusercontent.com/docker/docker/v17.04.0-ce/api/swagger.yaml || (echo " Failed 1.28 swagger download" && exit 1)
116
+ wget --quiet --directory-prefix=./engine/api/v1.29/ https://raw.githubusercontent.com/docker/docker/v17.05.0-ce/api/swagger.yaml || (echo " Failed 1.29 swagger download" && exit 1)
141
117
# New location for swagger.yaml for 17.06+
142
- wget -O ${SOURCE} /engine/api/v1.30/swagger.yaml https://raw.githubusercontent.com/docker/docker-ce/17.06/components/engine/api/swagger.yaml || (echo " Failed 1.30 swagger download or the 1.30 directory doesn't exist" && exit -1)
143
- wget -O ${SOURCE} /engine/api/v1.31/swagger.yaml https://raw.githubusercontent.com/docker/docker-ce/17.07/components/engine/api/swagger.yaml || (echo " Failed 1.31 swagger download or the 1.31 directory doesn't exist" && exit -1)
144
- wget -O ${SOURCE} /engine/api/v1.32/swagger.yaml https://raw.githubusercontent.com/docker/docker-ce/17.09/components/engine/api/swagger.yaml || (echo " Failed 1.32 swagger download or the 1.32 directory doesn't exist" && exit -1)
145
- wget -O ${SOURCE} /engine/api/v1.33/swagger.yaml https://raw.githubusercontent.com/docker/docker-ce/17.10/components/engine/api/swagger.yaml || (echo " Failed 1.33 swagger download or the 1.33 directory doesn't exist" && exit -1)
146
- wget -O ${SOURCE} /engine/api/v1.34/swagger.yaml https://raw.githubusercontent.com/docker/docker-ce/17.11/components/engine/api/swagger.yaml || (echo " Failed 1.34 swagger download or the 1.34 directory doesn't exist" && exit -1)
147
- wget -O ${SOURCE} /engine/api/v1.35/swagger.yaml https://raw.githubusercontent.com/docker/docker-ce/17.12/components/engine/api/swagger.yaml || (echo " Failed 1.35 swagger download or the 1.35 directory doesn't exist" && exit -1)
148
- wget -O ${SOURCE} /engine/api/v1.36/swagger.yaml https://raw.githubusercontent.com/docker/docker-ce/18.02/components/engine/api/swagger.yaml || (echo " Failed 1.36 swagger download or the 1.36 directory doesn't exist" && exit -1)
149
- wget -O ${SOURCE} /engine/api/v1.37/swagger.yaml https://raw.githubusercontent.com/docker/docker-ce/18.03/components/engine/api/swagger.yaml || (echo " Failed 1.37 swagger download or the 1.37 directory doesn't exist" && exit -1)
150
-
151
- # Get dockerd.md for stable and edge, from upstream
152
- wget -O ${SOURCE} /engine/reference/commandline/dockerd.md https://raw.githubusercontent.com/docker/docker-ce/" $ENGINE_BRANCH " /components/cli/docs/reference/commandline/dockerd.md || (echo " Failed to fetch stable dockerd.md" && exit -1)
153
- wget -O ${SOURCE} /edge/engine/reference/commandline/dockerd.md https://raw.githubusercontent.com/docker/docker-ce/" $ENGINE_EDGE_BRANCH " /components/cli/docs/reference/commandline/dockerd.md || (echo " Failed to fetch edge dockerd.md" && exit -1)
118
+ wget --quiet --directory-prefix=./engine/api/v1.30/ https://raw.githubusercontent.com/docker/docker-ce/v17.06.2-ce/components/engine/api/swagger.yaml || (echo " Failed 1.30 swagger download" && exit 1)
119
+ wget --quiet --directory-prefix=./engine/api/v1.31/ https://raw.githubusercontent.com/docker/docker-ce/v17.07.0-ce/components/engine/api/swagger.yaml || (echo " Failed 1.31 swagger download" && exit 1)
120
+ wget --quiet --directory-prefix=./engine/api/v1.32/ https://raw.githubusercontent.com/docker/docker-ce/v17.09.1-ce/components/engine/api/swagger.yaml || (echo " Failed 1.32 swagger download" && exit 1)
121
+ wget --quiet --directory-prefix=./engine/api/v1.33/ https://raw.githubusercontent.com/docker/docker-ce/v17.10.0-ce/components/engine/api/swagger.yaml || (echo " Failed 1.33 swagger download" && exit 1)
122
+ wget --quiet --directory-prefix=./engine/api/v1.34/ https://raw.githubusercontent.com/docker/docker-ce/v17.11.0-ce/components/engine/api/swagger.yaml || (echo " Failed 1.34 swagger download" && exit 1)
123
+ wget --quiet --directory-prefix=./engine/api/v1.35/ https://raw.githubusercontent.com/docker/docker-ce/v17.12.1-ce/components/engine/api/swagger.yaml || (echo " Failed 1.35 swagger download" && exit 1)
124
+ wget --quiet --directory-prefix=./engine/api/v1.36/ https://raw.githubusercontent.com/docker/docker-ce/v18.02.0-ce/components/engine/api/swagger.yaml || (echo " Failed 1.36 swagger download" && exit 1)
125
+ wget --quiet --directory-prefix=./engine/api/v1.37/ https://raw.githubusercontent.com/docker/docker-ce/v18.03.1-ce/components/engine/api/swagger.yaml || (echo " Failed 1.37 swagger download" && exit 1)
154
126
155
- # Add an admonition to the edge dockerd file
156
- EDGE_DOCKERD_INCLUDE=' {% include edge_only.md section=\"dockerd\" %}'
157
- sedi " s/^#\ daemon/${EDGE_DOCKERD_INCLUDE} /1" ${SOURCE} /edge/engine/reference/commandline/dockerd.md
158
127
159
128
# Get a few one-off files that we use directly from upstream
160
- wget -O ${SOURCE} /engine/reference/builder.md https://raw.githubusercontent.com/docker/docker-ce/" $ENGINE_BRANCH " /components/cli/docs/reference/builder.md || (echo " Failed engine/reference/builder.md download" && exit -1)
161
- wget -O ${SOURCE} /engine/reference/run.md https://raw.githubusercontent.com/docker/docker-ce/" $ENGINE_BRANCH " /components/cli/docs/reference/run.md || (echo " Failed engine/reference/run.md download" && exit -1)
162
- # Adjust this one when Edge != Stable
163
- wget -O ${SOURCE} /edge/engine/reference/run.md https://raw.githubusercontent.com/docker/docker-ce/" $ENGINE_BRANCH " /components/cli/docs/reference/run.md || (echo " Failed engine/reference/run.md download" && exit -1)
164
- wget -O ${SOURCE} /engine/reference/commandline/cli.md https://raw.githubusercontent.com/docker/docker-ce/" $ENGINE_BRANCH " /components/cli/docs/reference/commandline/cli.md || (echo " Failed engine/reference/commandline/cli.md download" && exit -1)
165
- wget -O ${SOURCE} /engine/deprecated.md https://raw.githubusercontent.com/docker/docker-ce/" $ENGINE_BRANCH " /components/cli/docs/deprecated.md || (echo " Failed engine/deprecated.md download" && exit -1)
166
- wget -O ${SOURCE} /registry/configuration.md https://raw.githubusercontent.com/docker/distribution/" $DISTRIBUTION_BRANCH " /docs/configuration.md || (echo " Failed registry/configuration.md download" && exit -1)
129
+ wget --quiet --directory-prefix=./engine/ https://raw.githubusercontent.com/docker/docker-ce/v18.03.1-ce/components/cli/docs/deprecated.md || (echo " Failed engine/deprecated.md download" && exit 1)
130
+ wget --quiet --directory-prefix=./engine/reference/ https://raw.githubusercontent.com/docker/docker-ce/v18.03.1-ce/components/cli/docs/reference/builder.md || (echo " Failed engine/reference/builder.md download" && exit 1)
131
+ wget --quiet --directory-prefix=./engine/reference/ https://raw.githubusercontent.com/docker/docker-ce/v18.03.1-ce/components/cli/docs/reference/run.md || (echo " Failed engine/reference/run.md download" && exit 1)
132
+ wget --quiet --directory-prefix=./engine/reference/commandline/ https://raw.githubusercontent.com/docker/docker-ce/v18.03.1-ce/components/cli/docs/reference/commandline/cli.md || (echo " Failed engine/reference/commandline/cli.md download" && exit 1)
133
+ wget --quiet --directory-prefix=./engine/reference/commandline/ https://raw.githubusercontent.com/docker/docker-ce/v18.03.1-ce/components/cli/docs/reference/commandline/dockerd.md || (echo " Failed engine/reference/commandline/dockerd.md download" && exit 1)
134
+ wget --quiet --directory-prefix=./registry/ https://raw.githubusercontent.com/docker/distribution/" $DISTRIBUTION_BRANCH " /docs/configuration.md || (echo " Failed registry/configuration.md download" && exit 1)
167
135
168
136
# Remove things we don't want in the build
169
- rm ${SOURCE} /registry/spec/api.md.tmpl
170
- rm -rf ${SOURCE} /apidocs/cloud-api-source
171
- rm -rf ${SOURCE} /tests
172
- rm ${SOURCE} /_samples/library/index.md
137
+ rm . /registry/spec/api.md.tmpl
138
+ rm -rf . /apidocs/cloud-api-source
139
+ rm -rf . /tests
140
+ rm . /_samples/library/index.md
0 commit comments