# CI/CD:
# * branch      Continuously Builds & Push TOSCA parser image

#image: docker:latest

#services:
#  - docker:dind

variables:
  GIT_DEPTH: "3"
  TOSCA_PARSER: "Cloudnet-TOSCA-toolbox" # "Puccini"

stages:
  - build
  - test

build-tosca-toolbox:
  stage: build
  only:
    refs:
      - dev
    variables:
      - $TOSCA_PARSER == "Cloudnet-TOSCA-toolbox"
  #before_script:
  #  - echo "Check Docker Images and System info"
  #  - docker image ls
  #  - docker system info
  script:
    - echo "Building Cloudnet-TOSCA-toolbox image..."
    - ./build_tosca_parser.sh $TOSCA_PARSER
    - echo "Build finished"    

test-definitions:
  stage: test
  script:
    - echo "Parsing TOSCA definitions"
    - ./parse_tosca_definitions.sh $TOSCA_PARSER
  only:
    - dev
  artifacts:
    paths:
      - debug.log
