forked from OrchardCMS/OrchardCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
81 lines (68 loc) · 2.89 KB
/
appveyor.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
image: Visual Studio 2017
environment:
global:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOCKER_USER:
secure: 2a9QfyDw5J1NDZD80kMwhQ==
DOCKER_PASS:
secure: aLjaywnziVFcRa3uZ8iMteFDjA1wp0fSaPMaBE55LO4=
MYGET_API_KEY:
secure: 8Fp2ETunhU6PvhlotuQXTZ7WkG1FikJ3BM7YLAZyfmbpy00knABu5yL7MhJ9uNcl
NUGET_API_KEY:
secure: bR0JuO8NuLOxL18tQ7ZtQXOHNHjqCJXlkUOzEyNQniptTszwYcwufYhKTyoybqei
stack: node 9, docker
# build cache to preserve files/folders between builds
cache:
- node_modules # local npm modules
- '%LocalAppData%\NuGet\v3-cache' # NuGet v3
# Install scripts. (runs after repo cloning)
install:
- ps: $env:BuildNumber= $env:APPVEYOR_BUILD_NUMBER
- ps: $IsMasterBranch = ($env:APPVEYOR_REPO_BRANCH -eq "master" -And -not $env:APPVEYOR_PULL_REQUEST_NUMBER)
- ps: $IsDevBranch = ($env:APPVEYOR_REPO_BRANCH -eq "dev" -And -not $env:APPVEYOR_PULL_REQUEST_NUMBER)
# Uncomment to download a specific version of dotnet
# - ps: Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1" -OutFile "dotnet-install.ps1"
# - ps: .\dotnet-install.ps1 --Version 2.1.301
build_script:
- dotnet build -c Release
- ps: if ($IsMasterBranch -or $IsDevBranch) { dotnet pack -c Release --no-build }
init:
- dotnet --version
- node --version
- npm --version
- git config --global core.autocrlf true
test_script:
- dotnet test -c Release --no-build .\test\OrchardCore.Tests\OrchardCore.Tests.csproj
- cd .\test\Functional
- test-setup.cmd
- test-run.cmd
clone_depth: 1
test: on
artifacts:
- path: 'src\**\*.nupkg'
deploy_script:
# Nuget
- ps: if ($IsMasterBranch) { foreach ($artifactName in $artifacts.keys) { nuget push $artifacts[$artifactName].path $env:NUGET_API_KEY -Source https://www.nuget.org/api/v2/package } }
# Myget
- ps: if ($IsDevBranch) { foreach ($artifactName in $artifacts.keys) { nuget push $artifacts[$artifactName].path $env:MYGET_API_KEY -Source https://www.myget.org/F/orchardcore-preview/api/v2/package } }
# DockerHub
- ps: |
if ($IsMasterBranch)
{
cd $env:APPVEYOR_BUILD_FOLDER\src\OrchardCore.Cms.Web
dotnet publish -c Release -o $env:APPVEYOR_BUILD_FOLDER\.build\release
cd $env:APPVEYOR_BUILD_FOLDER
docker build -t orchardproject/orchardcore-cms-windows:latest -t orchardproject/orchardcore-cms-windows:1.0.0-beta3 .
docker login -u="$env:DOCKER_USER" -p="$env:DOCKER_PASS"
docker push orchardproject/orchardcore-cms-windows
}
if ($IsDevBranch)
{
cd $env:APPVEYOR_BUILD_FOLDER\src\OrchardCore.Cms.Web
dotnet publish -c Release -o $env:APPVEYOR_BUILD_FOLDER\.build\release
cd $env:APPVEYOR_BUILD_FOLDER
docker build -t orchardproject/orchardcore-cms-windows:dev .
docker login -u="$env:DOCKER_USER" -p="$env:DOCKER_PASS"
docker push orchardproject/orchardcore-cms-windows
}