# renku: v1.dev20180404

stages:
  - build
  - review

dot:
  stage: build
  image: renku/renku-python:latest
  script:
    - python -c "import renku, networkx; graph = renku.cli._graph.Graph(renku.LocalClient()); graph.build_status(); networkx.drawing.nx_pydot.write_dot(graph.G, 'graph.dot')"
  artifacts:
    paths:
      - graph.dot
  environment:
    name: dot/$CI_COMMIT_REF_NAME
    url: $CI_PROJECT_URL/-/jobs/artifacts/$CI_COMMIT_REF_NAME/raw/graph.dot?job=$CI_JOB_NAME

review_notebook:
  stage: review
  script: echo http://jupyterhub.$AUTO_DEVOPS_DOMAIN/services/notebooks/$CI_PROJECT_PATH/$CI_COMMIT_SHA?branch=$CI_COMMIT_REF_NAME
  variables:
    GIT_STRATEGY: clone
  environment:
    name: review/$CI_COMMIT_REF_NAME
    url: http://jupyterhub.$AUTO_DEVOPS_DOMAIN/services/notebooks/$CI_PROJECT_PATH/$CI_COMMIT_SHA?branch=$CI_COMMIT_REF_NAME
  only:
    - branches
