2022-06-09 05:34:50 +00:00
|
|
|
# To contribute improvements to CI/CD templates, please follow the Development guide at:
|
|
|
|
# https://docs.gitlab.com/ee/development/cicd/templates.html
|
|
|
|
# This specific template is located at:
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Docker.gitlab-ci.yml
|
2021-05-28 19:11:39 +00:00
|
|
|
|
2022-06-09 05:34:50 +00:00
|
|
|
# Build a Docker image with CI/CD and push to the GitLab registry.
|
|
|
|
# Docker-in-Docker documentation: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
|
|
|
|
#
|
|
|
|
# This template uses one generic job with conditional builds
|
|
|
|
# for the default branch and all other (MR) branches.
|
2021-05-28 19:32:50 +00:00
|
|
|
|
2022-06-09 05:34:50 +00:00
|
|
|
docker-build:
|
|
|
|
# Use the official docker image.
|
|
|
|
image: docker:dind
|
|
|
|
variables:
|
|
|
|
HTTPS_PROXY: "http://172.17.0.1:7890"
|
|
|
|
HTTP_PROXY: "http://172.17.0.1:7890"
|
|
|
|
stage: build
|
|
|
|
when: manual
|
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
before_script:
|
|
|
|
- echo "$CI_REGISTRY_PASSWORD" | docker login glcr.cra.ac.cn --username "$CI_REGISTRY_USER" --password-stdin
|
|
|
|
# Default branch leaves tag empty (= latest tag)
|
|
|
|
# All other branches are tagged with the escaped branch name (commit ref slug)
|
2021-05-28 19:11:39 +00:00
|
|
|
script:
|
2022-06-09 05:34:50 +00:00
|
|
|
- |
|
2022-06-10 13:20:16 +00:00
|
|
|
docker build -t "glcr.cra.ac.cn/sustech-cra/overleaf-ldap-oauth2:3.1-20220610" .
|
|
|
|
docker push "glcr.cra.ac.cn/sustech-cra/overleaf-ldap-oauth2:3.1-20220610"
|