stages: - build - test variables: IMAGE: ${CI_REGISTRY_IMAGE} debug: image: docker:git stage: test script: - git clone https://github.com/jupyterhub/nbgitpuller.git build-image: stage: build #and stage services: - docker:dind image: docker:git before_script: - docker login -u gitlab-ci-token -p $CI_REGISTRY_PASSWORD $CI_REGISTRY script: - docker pull jupyter/tensorflow-notebook - docker build -t ${IMAGE} . - docker push ${IMAGE} after_script: - 'docker logout $CI_REGISTRY' only: changes: - Dockerfile - environment.yml image: ${IMAGE} tests_python_packages: stage: test script: - pytest