---
kind: pipeline
name: default

platform:
  os: linux
  arch: amd64

steps:
- name: test
  pull: default
  image: rancher/dapper:v0.4.1
  commands:
  - dapper ci
  privileged: true
  volumes:
  - name: docker
    path: /var/run/docker.sock
  when:
    event:
    - pull_request

- name: build
  pull: default
  image: rancher/dapper:v0.4.1
  commands:
  - BUILD_LATEST=true dapper ci
  privileged: true
  volumes:
  - name: docker
    path: /var/run/docker.sock
  when:
    branch:
    - master
    event:
      exclude:
      - pull_request

- name: upload
  pull: default
  image: plugins/gcs
  settings:
    acl:
    - allUsers:READER
    cache_control: "no-cache,must-revalidate"
    source: dist/static/latest2
    target: releases.rancher.com/ui/latest2
    token:
      from_secret: google_auth_key
  when:
    branch:
    - master
    event:
      exclude:
      - pull_request

volumes:
- name: docker
  host:
    path: /var/run/docker.sock
