image: registry.gitlab.com/notch8/scripts/builder:latest
services:
  - docker:dind
stages:
  - build
#  - test
#  - review
#  - staging
#  - production

variables:
  DOCKER_DRIVER: overlay
  REGISTRY_HOST: registry.gitlab.com
  REGISTRY_URI: /notch8/rutgers-vdc
  SITE_URI_BASE: hykuup.com

before_script:
  - export TAG=${CI_COMMIT_SHA:0:8}
  - export BRANCH=${CI_COMMIT_REF_NAME}
  - export REGISTRY_HOST=${CI_REGISTRY}
  - export REGISTRY_URI="/${CI_PROJECT_PATH}"
  - touch .env.development
  - touch .env.production

base:
  stage: build
  script:
    - docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY
    - sc build -s base
    - sc push -s base
  when: manual
  tags:
    - docker

build:
  stage: build
  script:
    - docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY
    - sc build
    - sc push
    - docker tag $CI_REGISTRY_IMAGE:$TAG $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
  tags:
    - docker

image: registry.gitlab.com/notch8/scripts/builder:latest
services:
  - docker:dind
stages:
  - build
#  - test
#  - review
#  - staging
#  - production

variables:
  DOCKER_DRIVER: overlay
  REGISTRY_HOST: registry.gitlab.com
  REGISTRY_URI: /notch8/rutgers-vdc
  SITE_URI_BASE: hykuup.com

before_script:
  - export TAG=${CI_COMMIT_SHA:0:8}
  - export BRANCH=${CI_COMMIT_REF_NAME}
  - export REGISTRY_HOST=${CI_REGISTRY}
  - export REGISTRY_URI="/${CI_PROJECT_PATH}"

build:
  stage: build
  script:
    - docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY
    - sc build
    - sc push
    - docker tag $CI_REGISTRY_IMAGE $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
  tags:
    - docker

Fix CI pipeline `build` stage
Fix CI pipeline `build` stage

This frontloads part of !9 to get the `build` stage passing. The rest of !9 is
blocked on a good CI configuration for Solr, but in the meanwhile we can have
passing builds.
