# This file is a template, and might need editing before it works on your project.
# Official docker image.
image: docker:latest

services:
  - docker:dind

build:
  stage: build
  only:
    - master
  script:
    - export IMAGE_TAG=$(echo -en $CI_COMMIT_REF_NAME | tr -c '[:alnum:]_.-' '-')
    - docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY
    - docker build --pull -t "$CI_REGISTRY_IMAGE:$IMAGE_TAG" ./provisioning
    - docker push "$CI_REGISTRY_IMAGE/provisioning:latest"

cross-cloud:
  image: registry.gitlab.com/cncf/demo/provisioning:latest
  stage: deploy
  only:
    - ci
  when: manual
  script:
    - /cncf/provision.sh ${CLOUD}-deploy ${DEPLOY}
    - sleep 99999999


# This file is a template, and might need editing before it works on your project.
# Official docker image.
image: docker:latest
variables:
  DOCKER_HOST: 127.0.0.1:2375
  privileged: 'true'
services:
  - docker:dind

stages:
  - build-provisioning
  - deploy

build-provisioning:
  stage: build-provisioning
  only:
    - master
  script:
    - docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY
    - docker build --pull -t "$CI_REGISTRY_IMAGE/provisioning:latest" ./provisioning
    - docker push "$CI_REGISTRY_IMAGE/provisioning:latest"

cross-cloud:
  image: registry.gitlab.com/cncf/demo/provisioning:latest
  stage: deploy
  only:
    - ci
  when: manual
  script:
    - /cncf/provision.sh ${CLOUD}-deploy ${DEPLOY}
    - sleep 99999999


Add DOCKER_HOST: 127.0.0.1 and build-provisioning stage
Add DOCKER_HOST: 127.0.0.1 and build-provisioning stage
