os:
  - linux
  - osx
language: generic
sudo: required
dist: trusty
osx_image: xcode7.3
install:
  - eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/02090c7ede5a637b76e6df1710e83cd0bbe7dcdf/swiftenv-install.sh)"
script:
  # the first two steps are equivalent to the user installation instructions
  # here: https://vapor.readme.io/docs/install-cli
  - chmod +x vapor.swift
  - sudo cp ./vapor.swift /usr/local/bin/vapor
  
  - vapor self compile              # compile

  - vapor version                   # version

  # docker
  - rm Dockerfile                   # docker init won't run if file exists
  - vapor docker init

  # heroku
  # - vapor heroku init

  # basic
  - vapor help                      # help
  - vapor new test-project          # new
  - cd test-project
  - vapor clean                     # clean
  - vapor build                     # build
  - vapor run &                     # run

  # test update
  - vapor self update       # will update to older version
  
os:
  - linux
  - osx
language: generic
sudo: required
dist: trusty
osx_image: xcode7.3
install:
  - eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/02090c7ede5a637b76e6df1710e83cd0bbe7dcdf/swiftenv-install.sh)"
script:
  # the first two steps are equivalent to the user installation instructions
  # here: https://vapor.readme.io/docs/install-cli
  - chmod +x vapor.swift
  - sudo cp ./vapor.swift /usr/local/bin/vapor
  
  # fixing error on Linux:
  #   mv: try to overwrite ‘/usr/local/bin/vapor’, overriding mode 0755 (rwxr-xr-x)?
  - sudo chmod ugo+w /usr/local/bin/vapor
  
  - vapor self compile              # compile

  - vapor version                   # version

  # docker
  - rm Dockerfile                   # docker init won't run if file exists
  - vapor docker init

  # heroku
  # - vapor heroku init

  # basic
  - vapor help                      # help
  - vapor new test-project          # new
  - cd test-project
  - vapor clean                     # clean
  - vapor build                     # build
  - vapor run &                     # run

  # test update
  - vapor self update       # will update to older version
  
Fix for `mv: try to overwrite ‘/usr/local/bin/vapor’, overriding mode 0755 (rwxr-xr-x)?`
Fix for `mv: try to overwrite ‘/usr/local/bin/vapor’, overriding mode 0755 (rwxr-xr-x)?`
