overleaf-sso/.gitlab-ci.yml

48 lines
1.3 KiB
YAML
Raw Normal View History

variables:
DOCKER_DRIVER: vfs
image: docker
services:
- name: docker:19-dind
# Currently we need this ugly workaround in order to use docker in Kata:
entrypoint:
- sh
- -c
- >-
mkdir /sys/fs/cgroup/systemd
&& mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
&& exec dockerd-entrypoint.sh
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- source environment
2021-05-19 11:49:02 +00:00
- ulimit -n 90000
2021-05-19 13:22:59 +00:00
- ulimit -a
- docker pull "$CI_REGISTRY_IMAGE" || true
2021-05-18 22:26:22 +00:00
- >
docker build
--ulimit nofile=90000
2021-05-18 22:26:22 +00:00
--cache-from "$CI_REGISTRY_IMAGE"
--pull
2021-05-18 09:09:26 +00:00
--build-arg "BASE=$BASE"
--build-arg "LDAP_PLUGIN_URL=$LDAP_PLUGIN_URL"
--build-arg login_text="${LOGIN_TEXT}"
--build-arg collab_text="${COLLAB_TEXT}"
--build-arg admin_is_sysadmin="${ADMIN_IS_SYSADMIN}"
-t "$CI_REGISTRY_IMAGE" .
build-main:
script:
- docker tag "$CI_REGISTRY_IMAGE" "$CI_REGISTRY_IMAGE:$IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE:$IMAGE_TAG"
- docker push "$CI_REGISTRY_IMAGE"
only:
- main
build:
script:
- docker tag "$CI_REGISTRY_IMAGE" "$CI_REGISTRY_IMAGE:branch-$CI_COMMIT_REF_SLUG"
- docker push "$CI_REGISTRY_IMAGE:branch-$CI_COMMIT_REF_SLUG"
except:
- main