variables:
  DOCKER_REGISTRY: 't-docker.51gjj.com'

before_script:
  - docker login -u pengtianzi -p 4dc8b3a4d91fa7fa $DOCKER_REGISTRY

stages:
  - pre_deploy

build_docker_image:
  stage: pre_deploy
  script:
    - export IMAGE_TAG=${CI_COMMIT_TAG:-latest}
    - docker build -t $DOCKER_REGISTRY/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:$IMAGE_TAG .
    - docker push $DOCKER_REGISTRY/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:$IMAGE_TAG
  tags:
    - docker-image-builder
