sudo: required
dist: trusty

# Don't do shallow clones
git:
  depth: false

os:
  - osx
  - linux

language: csharp
mono: none
env:
  global:
    - DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
    - DOTNET_CLI_TELEMETRY_OPTOUT=1
    - COMPlus_UseManagedHttpClientHandler=true

# minikube-related changes
    - CHANGE_MINIKUBE_NONE_USER=true
    - MINIKUBE_WANTREPORTERRORPROMPT=false
    - MINIKUBE_WANTUPDATENOTIFICATION=false
    - KUBECONFIG=/home/travis/.kube/config

# We need the .NET Core 2.1 SDK to build. Travis doesn't know how to install this yet.
before_install:
  - ./install-$TRAVIS_OS_NAME.sh

script:
  - ./ci.sh

after_script:
  - if [ "$TRAVIS_OS_NAME" = "linux" ]; then ./integration-tests.sh; fi

deploy:
  skip_cleanup: true
  provider: script
  script: dotnet nuget push src/KubernetesClient/bin/Release/KubernetesClient.*.nupkg --api-key $NUGET_API_KEY --source $NUGET_SOURCE
  on:
    branch: master
    condition: '"x${NUGET_API_KEY}" != "x" && "x$NUGET_SOURCE" != "x" && "$TRAVIS_OS_NAME" == "linux"'