mirror of
https://github.com/TeachBooks/manual.git
synced 2026-11-12 22:35:51 +00:00
Merge branch 'release' of github.com:TeachBooks/manual into release
This commit is contained in:
commit
794eda40d7
4 changed files with 3 additions and 82 deletions
|
|
@ -1,70 +0,0 @@
|
|||
stages:
|
||||
- test
|
||||
- build
|
||||
- deploy
|
||||
variables:
|
||||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
||||
REGISTRY_HOST: localhost:5000
|
||||
TAG_LATEST: $REGISTRY_HOST/$CI_PROJECT_NAME/$CI_COMMIT_REF_NAME:latest
|
||||
TAG_DRAFT: $REGISTRY_HOST/$CI_PROJECT_NAME-draft/$CI_COMMIT_REF_NAME:latest
|
||||
GIT_SUBMODULE_STRATEGY: recursive # For submodules
|
||||
cache:
|
||||
paths:
|
||||
- .cache/pip
|
||||
# This job tests if the book compiles gracefully after a new addition
|
||||
test-build:
|
||||
stage: test
|
||||
image: continuumio/miniconda3
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
script:
|
||||
- pip install -r requirements.txt
|
||||
- jupyter-book clean book/
|
||||
- jupyter-book build book/
|
||||
# This job builds the Docker container
|
||||
build-book:
|
||||
stage: build
|
||||
image: docker
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "release" && $CI_PIPELINE_SOURCE == "push"
|
||||
variables:
|
||||
TAG: $TAG_LATEST
|
||||
- if: $CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE == "push"
|
||||
variables:
|
||||
TAG: $TAG_DRAFT
|
||||
before_script:
|
||||
- docker info
|
||||
script:
|
||||
- if [ "$TAG" = "$TAG_LATEST" ]; then sed --in-place=".bak" '/# START DRAFT/,/# END DRAFT/{//!d}' book/_config.yml; fi
|
||||
- docker build -t $TAG .
|
||||
- docker push $TAG
|
||||
# This job takes down the existing container and starts the new one
|
||||
deploy-book:
|
||||
stage: deploy
|
||||
image: docker
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "release" && $CI_PIPELINE_SOURCE == "push"
|
||||
before_script:
|
||||
- docker info
|
||||
- docker stop $CI_PROJECT_NAME || exit_code=$?
|
||||
- if [ $exit_code -ne 0 ]; then echo "Container not found, cannot stop"; else docker rm $CI_PROJECT_NAME; fi
|
||||
script:
|
||||
- docker run -d --restart always -p 8000:8000 --name $CI_PROJECT_NAME $TAG_LATEST # Make sure to use a different port for each book!
|
||||
environment:
|
||||
name: production
|
||||
url: https://interactivetextbooks.citg.tudelft.nl/jupyter-book-manual
|
||||
# Deploy the draft version of the book
|
||||
deploy-draft:
|
||||
stage: deploy
|
||||
image: docker
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE == "push"
|
||||
before_script:
|
||||
- docker info
|
||||
- docker stop $CI_PROJECT_NAME-draft || exit_code=$?
|
||||
- if [ $exit_code -ne 0 ]; then echo "Container not found, cannot stop"; else docker rm $CI_PROJECT_NAME-draft; fi
|
||||
script:
|
||||
- docker run -d --restart always -p 8018:8000 --name $CI_PROJECT_NAME-draft $TAG_DRAFT
|
||||
environment:
|
||||
name: draft
|
||||
url: https://interactivetextbooks.citg.tudelft.nl/jupyter-book-manual-draft
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
FROM continuumio/miniconda3
|
||||
WORKDIR /book
|
||||
COPY book/ .
|
||||
RUN apt-get update && apt-get -y install git gcc
|
||||
COPY requirements.txt requirements.txt
|
||||
RUN pip install -r requirements.txt
|
||||
RUN jupyter book build .
|
||||
ENTRYPOINT [ "python", "-m", "http.server", "8000", "--directory", "/book/_build/html" ]
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
title: TeachBooks Manual
|
||||
author: TeachBooks Team, built with <a href="https://teachbooks.tudelft.nl/">TeachBooks</a> and <a href="https://jupyterbook.org/">Jupyter Book</a>, <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license noopener noreferrer"">CC BY 4.0<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg" alt=""></a>
|
||||
author: TeachBooks Team, built with <a href="https://teachbooks.io/">TeachBooks</a> and <a href="https://jupyterbook.org/">Jupyter Book</a>, <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank" rel="license noopener noreferrer"">CC BY 4.0<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg" alt=""></a>
|
||||
|
||||
logo: images/Logo_without_background.png
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ only_build_toc_files: true
|
|||
|
||||
html:
|
||||
favicon : "images/favicon.ico"
|
||||
baseurl : "https://teachbooks.tudelft.nl/jupyter-book-manual/"
|
||||
baseurl : "https://teachbooks.io/manual/"
|
||||
# START REMOVE-FROM-PUBLISH
|
||||
comments:
|
||||
hypothesis: true
|
||||
|
|
@ -29,7 +29,7 @@ sphinx:
|
|||
use_thebe_lite: true
|
||||
exclude_patterns: ["**/_*.yml", "**/*.md", "**/*.ipynb","**/*.gif","**/*.txt","**/*.json",]
|
||||
html_theme_options:
|
||||
repository_url: "https://gitlab.tudelft.nl/interactivetextbooks-citg/jupyter-book-manual"
|
||||
repository_url: "https://github.com/TeachBooks/manual/"
|
||||
path_to_docs: "book"
|
||||
repository_branch: "release"
|
||||
use_repository_button: true
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
dummy
|
||||
Loading…
Add table
Add a link
Reference in a new issue