docker-images/.gitlab-ci.yml

46 lines
No EOL
1.2 KiB
YAML

stages:
- build
- push
variables:
IMAGE_NAME: ${CI_REGISTRY}/${CI_PROJECT_PATH}/sharelatex:with_texlive_full
ARCHIVED_IMAGE: sharelatex_with_texlive_full.tar
TEXLIVE_REPO: https://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/2023/tlnet-final
build:
stage: build
tags:
- privileged
image: docker:24.0.5
services:
- name: docker:24.0.5-dind
script:
- |
if [ ! -f $ARCHIVED_IMAGE ]; then
docker pull sharelatex/sharelatex:latest
docker run --name temp --entrypoint /bin/bash sharelatex/sharelatex:latest -c "tlmgr option repository $TEXLIVE_REPO && tlmgr update --self --all && tlmgr install scheme-full"
docker commit temp $IMAGE_NAME
docker save -o $ARCHIVED_IMAGE sharelatex:with-texlive-full
fi
artifacts:
paths:
- $ARCHIVED_IMAGE
expire_in: 30 days
push:
stage: push
tags:
- privileged
image: docker:24.0.5
services:
- name: docker:24.0.5-dind
dependencies:
- build
script:
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
- docker load -i $ARCHIVED_IMAGE
- docker push $IMAGE_NAME
artifacts:
paths:
- $ARCHIVED_IMAGE
expire_in: 30 days