forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
47 lines (39 loc) · 2.08 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
43
44
45
46
47
sudo: required
language: csharp
mono: none
dotnet: 2.1.400
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
- wget -q https://packages.microsoft.com/config/ubuntu/14.04/packages-microsoft-prod.deb
- sudo dpkg -i packages-microsoft-prod.deb
- sudo apt-get install apt-transport-https
- 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 dotnet src/Package/StaticAnalysis/StaticAnalysis.Netcore.dll -p $TRAVIS_BUILD_DIR/src/Package/$CONFIG -r $TRAVIS_BUILD_DIR/src/Package/StaticAnalysis -u || travis_terminate 1
- sudo pwsh -NonInteractive -NoLogo -NoProfile -File tools/TestModuleLoading.ps1 || travis_terminate 1
- sudo dotnet pack src/TestPrerequisites/Common.TestPrerequisites.sln --configuration $CONFIG || travis_terminate 1
- sudo dotnet test src/Azure.PowerShell.Netcore.Test.sln --filter "AcceptanceType=CheckIn&RunType!=DesktopOnly" --configuration $CONFIG --framework netcoreapp2.0
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