Merge pull request #10458 from thaJeztah/update_gh_pages

Dockerfile: update to github-pages 198, and some other fixes/improvements
This commit is contained in:
Usha Mandya
2020-03-16 09:59:39 +00:00
committed by GitHub
4 changed files with 17 additions and 8 deletions

View File

@@ -1,11 +1,18 @@
.dockerignore
.DS_Store
.git
.github
.gitignore
.gitmodules
.idea
.jekyll-metadata
.sass-cache
tests
_site
CONTRIBUTING.md
Dockerfile
Dockerfile.archive
docker-compose.yml
Gemfile
Gemfile.lock
Jenkinsfile

View File

@@ -24,9 +24,7 @@ ARG ENABLE_ARCHIVES=true
###
# Set up base stages for building and deploying
###
# Get basic configs and Jekyll env
FROM docs/docker.github.io:docs-builder AS builderbase
FROM starefossen/github-pages:198 AS builderbase
ENV TARGET=/usr/share/nginx/html
WORKDIR /usr/src/app/md_source/
@@ -58,8 +56,12 @@ FROM archives-${ENABLE_ARCHIVES} AS archives
# Only add the files that are needed to build these reference docs, so that these
# docs are only rebuilt if changes were made to ENGINE_BRANCH or DISTRIBUTION_BRANCH.
# Disable caching (docker build --no-cache) to force updating these docs.
FROM builderbase AS upstream-resources
FROM alpine AS upstream-resources
RUN apk add --no-cache subversion wget
WORKDIR /usr/src/app/md_source/
COPY ./_scripts/fetch-upstream-resources.sh ./_scripts/
ARG ENGINE_BRANCH
ARG DISTRIBUTION_BRANCH
RUN ./_scripts/fetch-upstream-resources.sh .
@@ -71,8 +73,8 @@ COPY --from=upstream-resources /usr/src/app/md_source/. ./
# substitute the "{site.latest_engine_api_version}" in the title for the latest
# API docs, based on the latest_engine_api_version parameter in _config.yml
RUN ./_scripts/update-api-toc.sh
RUN jekyll build -d ${TARGET}
RUN find ${TARGET} -type f -name '*.html' | grep -vE "v[0-9]+\." | while read i; do sed -i 's#href="https://docs.docker.com/#href="/#g' "$i"; done
RUN jekyll build -d ${TARGET} \
&& find ${TARGET} -type f -name '*.html' | grep -vE "v[0-9]+\." | while read i; do sed -i 's#href="https://docs.docker.com/#href="/#g' "$i"; done
# This stage only contains the generated files. It can be used to host the

View File

@@ -39,5 +39,5 @@ source "https://rubygems.org"
# live site deploy, which uses the Dockerfiles found in the publish-tools
# branch.
gem "github-pages", "177"
gem "github-pages", "198"
gem 'wdm' if Gem.win_platform?

View File

@@ -24,7 +24,7 @@ svn co "https://github.com/docker/distribution/${distribution_svn_branch}/docs/s
svn co "https://github.com/mirantis/compliance/trunk/docs/compliance" ./compliance || (echo "Failed docker/compliance download" && exit 1)
# Cleanup svn directories
find . -name .svn -exec rm -rf '{}' \;
find . -name ".svn" -print0 | xargs -0 /bin/rm -rf
# Get the Engine APIs that are in Swagger
# Add a new engine/api/<version>.md file to add a new API version page.