sudo: required
script: make travis
install:
  # AWS CLI is required for pushing the edge binaries to S3.
  - pip install --user awscli
env:
  global:
  - secure: "STFHbK4N70sU+mekByuMx6uQTcAhD7sy+PEJUILlTnL2O56OlCuyjFt8nQ28LCEhLd1HJ+SQff7Uuv4jBkYLfhrR3ptQ5l5AdRpPBQ9PcH839DloAdOB/V7Rkfe15QlUaphvNe6lcsMt+i0TnfEJ0adh784h5B8jA9KiXE7LDfbxKBj8KewfRRlHnyH/H0Qy8Wk4afVNqTUbFucbSm82IneykzHEhIMOsY1/CqbMndUFmrs/TmRY0+K2YVw7sAMobrXWgCuYJo3e5xDGqi3zm2i8/AQHpbx0dYjTJWTnv7inujvCABLCsI1hKqMarOQr4COHk6wBOXMClLOSl7JmmFm5vmQIZyWBRJHZBbbloQGWMDjw/BniV3K9W33tfq3s90cI0MqtjSSwdY/l6tBMMxtIyUTDtOqF576OFghYdvA39MShzI1KC0qh2a9x6Bk15ATRMdTRCXPM6ZIZaIlmuP4Z1ETuQ3MUIpiQpJxKfeZ3UHwxMoSP9R8LzR2qFT+AauW8E+0nVf+mOYEDgenuAvX5b+rEAN1E8ef9HTHzhW8tjSZxLU1P5jaWAFZUw3/T0E0/XdieJOyTzwR/7ZHivceODz/x7GWg9HiwFPxt4PvYTw5QjPqkruq7YMP0B7aX7gF+30nEG8ljJT6egGJ1scLDv7pc/J28O8GAwo2YgeE="
  - secure: "PHiSwVZvWhSalyPgZ2vXpl8MKOzoyZdDr2Ib8n7Dx8iOEhm3QFbnxhLHfFI01Uy0rSbEFY8ZKarmOcmK1tyOKjXHi7byx8/HArXKiOB4kNEGBdtXZirJtc5OKkzdG8Q66E8m5NKU8Psi9Id3tHDlWF4akqzWREyNHyDo5ZH1t20q79PisTZ6YJKU9P4QZP/iO3NtudUetZHege77NU4e1Ivj/Xsj7nlY8sXdZV7XkNfvr2XXW2GKZ7HBBAuxohPdt8dYL1iMyf7MddDJAuPrScJZj+hqthz2CIR5l6Ep0P2k6Fz02sUloGr4Ec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bDWXwO4383S6F8/USUASE/r06Zxws0XombEsy7dlG1YBS/3aLLGe5/5umrYu8XlKa0C5f1k+1ABroxQIDaiOoHJLmCTlCW0mDcbAH+THiKriPnULBnCk9qGCVofWDObPqGIIgeE5tHGm8kdfgx0hmuX5XxbZEDStSTh0eag3MFC0AdLqm4LYMaqHs56om976DmxKiO9FvkDhTSUhXsOjcgXnKoneBbzbf+1RnAr2QvuRaHS8nSZEcFnHiWNjGD/ag6Cvd2T4Aa8r5LasdYr9sx93GDteaZiyJmT4zTce4ote2kzddcEdAfK93ERUPiNXBvf0jMrqaVzbx6yI9EdcNvHRA5LARSxkT7CrOA/BjYeP+HuCjW6BJVmstDR9kFL2GoQSZJtrlI2KvHM6H3WWAMYpOCekaYKlxNa6KFoi/4RZbptJj0X5999G3qccBocfs133YQVgSNLrlBQ0KhXw4yMaO7UU8p1m063ls8VWFupWynagWGCrzWGl5w7S0r1YRVUB9kXrUmkRwqtW0niZfM1fX6BKo5PPfql7n0knhjqwo73n3kBuWxfQzYjOACYN3DFPgj0/qaNWR+AvZpqBAE5PyfxccEfpcWUvp2yrfZGuUWV628qPZLA/vQ33iN0lIndK/bCtoz6oqQq9iw=
services:
- docker
deploy:


  # This deployment is mutually exclusive with the other deployments. This
  # deployment builds and publishes the docker image whenever changes are
  # committed to master. The edge tag is updated to track this version.
  # The latest tag is not updated.
  - provider: script
    skip_cleanup: true  # do not delete artifacts because linux executable is needed
    script: make deploy-travis
    on:
      repo: open-policy-agent/opa
      branch: master
      tags: false

  # This deployment is mutually exclusive with the other deployments. This
  # deployment builds and publishes the docker image whenever a new tag is
  # created on the master branch. The latest tag is updated to point to the
  # image produced by this deployment. The edge tag is not updated.
  - provider: script
    skip_cleanup: true  # do not delete artifacts because linux executable is needed
    script: make release-travis
    on:
      repo: open-policy-agent/opa
      branch: master
      tags: true

  # This deployment is mutually exclusive with the other deployments. This
  # deployment builds and publishes the docker image whenever a new tag is
  # created on a release branch.
  - provider: script
    skip_cleanup: true  # do not delete artifacts because linux executable is needed
    script: make release-bugfix-travis
    on:
      repo: open-policy-agent/opa
      condition: $TRAVIS_BRANCH =~ ^release-.*$
      tags: true
