Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 78d2798

Browse files
author
Release Manager
committed
Trac #28374: MR31: Build documentation artifacts during docker build
Julian Rüth ([https://gitlab.com/saraedum @saraedum]) opened a merge request at https://gitlab.com/sagemath/sage/merge_requests/31: ---- {{{ #!markdown The documentation is stored as a GitLab artifact (700MB per build.) We might get into trouble eventually for storing so much data on GitLab but I did not see any explicit limits there. See https://sagemath.gitlab.io/-/dev/sage/-/jobs/276493066/artifacts/htm l/en/index.html for the documentation generated by this branch. }}} [[BR]][[BR]][[BR]] URL: https://trac.sagemath.org/28374 Reported by: galois Ticket author(s): Julian Rüth Reviewer(s): Samuel Lelièvre
2 parents 178d581 + 819cf4a commit 78d2798

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.ci/build-docker.sh

+6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ docker_build --target run-time-dependencies --tag run-time-dependencies:$DOCKER_
3939
docker_build --target build-time-dependencies --tag build-time-dependencies:$DOCKER_TAG .
4040
docker_build --target make-all --tag make-all:$DOCKER_TAG .
4141

42+
# Copy docs out of the docker image to save them into browseable GitLab artifacts
43+
container=$(docker create make-all:$DOCKER_TAG)
44+
docker cp $container:/home/sage/sage/local/share/doc/sage/html html_
45+
# GitLab's browser does not like symlinks, so we flatten them
46+
rsync html_/ html/ -a --copy-links
47+
4248
# Build the release image without build artifacts.
4349
docker_build --target sagemath --tag "$DOCKER_IMAGE_CLI" .
4450
# Display the layers of this image

.gitlab-ci.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ build-from-latest:
8888
when: always
8989
paths:
9090
- gitlab-build-docker.log
91+
- html
9192
expire_in: 1 month
9293
script:
93-
- apk --update add coreutils
94+
- apk --update add coreutils rsync
9495
# The output of the build can get larger than gitlab.com's limit; only
9596
# print the first 1MB (and the last 80 lines.) GitLab's limit is 4MB,
9697
# however, the list of all branches and tags that shows up in the initial
@@ -115,6 +116,12 @@ build-from-latest:
115116
build-from-clean:
116117
extends:
117118
- build-from-latest
119+
artifacts:
120+
when: always
121+
paths:
122+
- gitlab-build-docker.log
123+
- html
124+
expire_in: 99 years
118125
variables:
119126
ARTIFACT_BASE: "source-clean"
120127
only:
@@ -136,18 +143,21 @@ build-from-clean:
136143

137144
test-dev:
138145
stage: test
146+
dependencies: []
139147
script:
140148
- . .ci/pull-gitlab.sh sagemath-dev
141149
- sh .ci/test-dev.sh "$DOCKER_IMAGE"
142150

143151
test-cli:
144152
stage: test
153+
dependencies: []
145154
script:
146155
- . .ci/pull-gitlab.sh sagemath
147156
- sh .ci/test-cli.sh "$DOCKER_IMAGE"
148157

149158
test-jupyter:
150159
stage: test
160+
dependencies: []
151161
script:
152162
- . .ci/pull-gitlab.sh sagemath
153163
- sh .ci/test-jupyter.sh "$DOCKER_IMAGE" docker
@@ -156,6 +166,7 @@ test-jupyter:
156166
# variables DOCKER_USER and SECRET_DOCKER_PASS have been set up.
157167
push-dockerhub:
158168
stage: release
169+
dependencies: []
159170
only:
160171
refs:
161172
- branches
@@ -170,6 +181,7 @@ push-dockerhub:
170181
# variables DOCKER_USER and SECRET_DOCKER_PASS have been set up.
171182
push-dockerhub-dev:
172183
stage: release
184+
dependencies: []
173185
only:
174186
refs:
175187
- master

0 commit comments

Comments
 (0)