docker:
  file: delivery/docker/Dockerfile
  workingDir: /go/src/github/gocilla/gocilla

jobs:
  date: date
  build: go get -v .
  test: echo "Simulating acceptance tests"
  package: ls -al /var/run/docker.sock && export VERSION="$(git rev-parse HEAD)" && cp /go/bin/gocilla . && docker build -t gocilla/gocilla:$ENVIRONMENT .
  publish: docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD" && docker push gocilla/gocilla:$ENVIRONMENT

pipelines:
  - name: pipeline-pull
    jobs:
      - date
      - build
      - test
      - date

  - name: pipeline-dev
    jobs:
      - date
      - build
      - test
      - package
      - publish
      - date

triggers:
  - name: pull
    event: pull
    branch: master
    pipeline: pipeline-pull
    envVars:
      ENVIRONMENT: pull

  - name: dev
    event: push
    branch: master
    pipeline: pipeline-dev
    envVars:
      ENVIRONMENT: dev

docker:
  file: delivery/docker/Dockerfile
  workingDir: /go/src/github/gocilla/gocilla

jobs:
  date: date
  build: go get -v .
  test: echo "Simulating acceptance tests"
  package: |
    ls -al /var/run/docker.sock && \
    export VERSION="$(git rev-parse HEAD)" && \
    cp /go/bin/gocilla . && docker build -t gocilla/gocilla:$ENVIRONMENT .
  publish: |
    docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD" -e "$DOCKER_HUB_EMAIL" && \
    docker push gocilla/gocilla:$ENVIRONMENT

pipelines:
  - name: pipeline-pull
    jobs:
      - date
      - build
      - test
      - date

  - name: pipeline-dev
    jobs:
      - date
      - build
      - test
      - package
      - publish
      - date

triggers:
  - name: pull
    event: pull
    branch: master
    pipeline: pipeline-pull
    envVars:
      ENVIRONMENT: pull

  - name: dev
    event: push
    branch: master
    pipeline: pipeline-dev
    envVars:
      ENVIRONMENT: dev

Fix docker login including email
Fix docker login including email
