Skip to content

Commit

Permalink
verse: Add build arg CTAN_REPO_BUILD_LATEST
Browse files Browse the repository at this point in the history
- Set CTAN_REPO to CTAN_REPO_BUILD_LATEST during build
  • Loading branch information
benz0li committed Aug 16, 2024
1 parent 3ec5712 commit f3e12df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions verse/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.env:
variables:
R_VERSION: "4.4.1"
CTAN_REPO_BUILD_LATEST: "https://mirror.init7.net/ctan/systems/texlive/tlnet"
TAG_VERSION_MAJ_MIN: "false"
TAG_VERSION_MAJ: "false"

Expand Down Expand Up @@ -65,6 +66,7 @@ build:latest-linux-amd64:
docker build --pull
--build-arg BUILD_ON_IMAGE
--build-arg R_VERSION
--build-arg CTAN_REPO_BUILD_LATEST
--build-arg NCPUS=$((`nproc`/2+1))
--build-arg BUILD_START=$(date -uIseconds)
-t $CI_APP_REPO:$CI_APP_TAG-linux-amd64
Expand Down Expand Up @@ -108,6 +110,7 @@ build:latest-linux-arm64v8:
docker build --pull
--build-arg BUILD_ON_IMAGE
--build-arg R_VERSION
--build-arg CTAN_REPO_BUILD_LATEST
--build-arg NCPUS=$((`nproc`/2+1))
--build-arg BUILD_START=$(date -uIseconds)
-t $CI_APP_REPO:$CI_APP_TAG-linux-arm64v8
Expand Down
10 changes: 8 additions & 2 deletions verse/latest.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ ARG BUILD_ON_IMAGE
ARG CODE_BUILTIN_EXTENSIONS_DIR
ARG QUARTO_VERSION
ARG CTAN_REPO
ARG CTAN_REPO_BUILD_LATEST
ARG BUILD_START

USER root

ENV PARENT_IMAGE=${BUILD_ON_IMAGE}:${R_VERSION} \
QUARTO_VERSION=${QUARTO_VERSION} \
CTAN_REPO=${CTAN_REPO} \
BUILD_DATE=${BUILD_START}

ENV HOME=/root \
Expand Down Expand Up @@ -90,7 +90,10 @@ RUN dpkgArch="$(dpkg --print-architecture)" \
&& dpkg -i texlive-local.deb \
&& apt-get -y purge equivs \
&& apt-get -y autoremove \
## Admin-based install of TinyTeX:
## Admin-based install of TinyTeX
&& CTAN_REPO_ORIG=${CTAN_REPO} \
&& CTAN_REPO=${CTAN_REPO_BUILD_LATEST:-$CTAN_REPO} \
&& export CTAN_REPO \
&& wget -qO- "https://yihui.org/tinytex/install-unx.sh" \
| sh -s - --admin --no-path \
&& mv ${HOME}/.TinyTeX /opt/TinyTeX \
Expand All @@ -117,6 +120,7 @@ RUN dpkgArch="$(dpkg --print-architecture)" \
oberdiek \
titling \
&& tlmgr path add \
&& tlmgr option repository ${CTAN_REPO_ORIG} \
&& Rscript -e "tinytex::r_texmf()" \
&& chown -R root:${NB_GID} /opt/TinyTeX \
&& chmod -R g+w /opt/TinyTeX \
Expand Down Expand Up @@ -176,6 +180,8 @@ RUN dpkgArch="$(dpkg --print-architecture)" \
## Switch back to ${NB_USER} to avoid accidental container runs as root
USER ${NB_USER}

ENV CTAN_REPO=${CTAN_REPO}

ENV HOME=/home/${NB_USER}

WORKDIR ${HOME}

0 comments on commit f3e12df

Please sign in to comment.