forked from OrchardCMS/OrchardCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
52 lines (51 loc) · 2.02 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
48
49
50
51
52
before_install:
- |
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(.md)|^(mkdocs.yml)|^(src/docs)'
then
echo "Not running CI since only docs were changed."
exit
fi
language: csharp
sudo: required
services:
- docker
dist: xenial
mono: none
# dotnet: 2.1.300
branches:
only:
- master
- dev
env:
global:
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
os:
- linux
- osx
osx_image: xcode10.1
script:
- curl https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh | bash /dev/stdin --version 3.1.403
- if test "$TRAVIS_OS_NAME" == "linux"; then export PATH="/home/travis/.dotnet":"$PATH"; fi
- if test "$TRAVIS_OS_NAME" == "osx"; then export PATH="/Users/travis/.dotnet":"$PATH"; fi
- dotnet --info
- dotnet build -c Release
- if [[ "$TRAVIS_BRANCH" == "master" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then
cd $TRAVIS_BUILD_DIR/src/OrchardCore.Cms.Web;
rm -rf ./App_Data;
dotnet publish -c Release -o $TRAVIS_BUILD_DIR/.build/release;
cd $TRAVIS_BUILD_DIR;
docker build -t orchardproject/orchardcore-cms-linux:latest -t orchardproject/orchardcore-cms-linux:1.0.0-rc2 .;
echo "$DOCKER_PASS" | docker login -u="$DOCKER_USER" --password-stdin;
docker push orchardproject/orchardcore-cms-linux;
fi;
- if [[ "$TRAVIS_BRANCH" == "dev" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then
cd $TRAVIS_BUILD_DIR/src/OrchardCore.Cms.Web;
rm -rf ./App_Data;
dotnet publish -c Release -o $TRAVIS_BUILD_DIR/.build/release;
cd $TRAVIS_BUILD_DIR;
docker build -t orchardproject/orchardcore-cms-linux:dev .;
echo "$DOCKER_PASS" | docker login -u="$DOCKER_USER" --password-stdin;
docker push orchardproject/orchardcore-cms-linux;
fi;
- if test "$TRAVIS_OS_NAME" == "linux"; then dotnet test -c Release ./test/OrchardCore.Tests/OrchardCore.Tests.csproj; fi