forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
42 lines (34 loc) · 1.59 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
sudo: required
language: csharp
mono: none
dotnet: 2.1.200
dist: trusty
env:
- NAME="azure-powershell-core" CONFIG="Debug"
services:
- docker
before_install:
- sudo apt-get update
- sudo apt-get install docker-ce
- curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
- curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
- sudo apt-get update
- sudo apt-get install -y powershell
- sudo pwsh -NonInteractive -NoLogo -NoProfile -Command "Install-Module platyPS -Force -Confirm:\$false -Scope CurrentUser"
# https://github.com/travis-ci/travis-ci/issues/1066#issuecomment-383489298
script:
- sudo dotnet msbuild build.proj /t:BuildNetcore /p:Configuration=$CONFIG || travis_terminate 1
- sudo pwsh -NonInteractive -NoLogo -NoProfile -File tools/TestModuleLoading.ps1 || travis_terminate 1
- sudo dotnet test src/Azure.PowerShell.Netcore.Test.sln --filter "AcceptanceType=CheckIn&RunType!=DesktopOnly" --configuration $CONFIG
after_success:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
docker build . -t $DOCKER_USER/$NAME:$TRAVIS_COMMIT --build-arg CONFIG=$CONFIG;
docker tag $DOCKER_USER/$NAME:$TRAVIS_COMMIT $DOCKER_USER/$NAME:$TRAVIS_BRANCH;
echo "$DOCKER_PASS" | docker login -u $DOCKER_USER --password-stdin;
docker push $DOCKER_USER/$NAME:$TRAVIS_COMMIT;
docker push $DOCKER_USER/$NAME:$TRAVIS_BRANCH;
if [ "$TRAVIS_BRANCH" == "master" ]; then
docker tag $DOCKER_USER/$NAME:$TRAVIS_COMMIT $DOCKER_USER/$NAME:latest;
docker push $DOCKER_USER/$NAME:latest;
fi;
fi