workspace:
  base: /app
  path: .

pipeline:
  backend: 
    image: golang
    environment:
      - GOPATH=/app/go/deps:/app/go
      - PATH+=:/app/go/deps/bin
    commands: 
      - go get github.com/axw/gocov/gocov
      - go get -d ./go/src/...
      - go get -d -t ./go/src/...
      - ls /app/go/deps
      - ls /app/go/deps/bin
      - go test -v -race ./go/src/...
      - gocov test ./go/src/... | gocov report
      - CGO_ENABLED=0 go build -o DIST/flowserver flowserver/cmd/flowserver  
  frontend:
    image: node:6
    commands:
      - cd browser/vue-flow 
      - yarn 
      - yarn build
  deploy:
    image: docker
    when:
      event: deployment
      environment: staging
    commands:
      - echo $HOME
      - mkdir -p DIST
      - cp -r browser/vue-flow/dist DIST/web
      - docker build --rm -t hexasoftware.com:5000/flow-proto -f ./docker/Dockerfile .
      - docker push hexasoftware.com:5000/flow-proto
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /home/stdio/.docker/config.json:/root/.docker/config.json


