forked from OrchardCMS/OrchardCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
132 lines (115 loc) · 4.49 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
image: Visual Studio 2019
# Do not build feature branch with open Pull Requests
skip_branch_with_pr: true
branches:
only:
- master
- dev
- /release\/.*/
# Do not build if there are only documentation changes
skip_commits:
files:
- '**/*.md'
- mkdocs.yml
- src/docs/**/*
services:
- mssql2017
- mysql
- postgresql96
environment:
nodejs_version: "12"
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: nhxlp80FeVXTBsSsLok7RVUPbSa+DKEwbhqa4EJrf8vzK+vD9Jff1v+eA6HUP402
stack: node 12, docker
# build cache to preserve files/folders between builds
cache:
- node_modules -> **\package.json # local npm modules
- '%LocalAppData%\NuGet\v3-cache -> **\*.props' # NuGet v3
# Install scripts. (runs after repo cloning)
install:
- ps: Install-Product node $env:nodejs_version
- 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)
- ps: $IsReleaseBranch = ($env:APPVEYOR_REPO_BRANCH -eq "release/rc2" -And -not $env:APPVEYOR_PULL_REQUEST_NUMBER)
- ps: $GeneratePackages = ($IsMasterBranch -or $IsDevBranch -or $IsReleaseBranch)
# 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 3.1.403
build_script:
- dotnet build -c Release
- ps: if ($GeneratePackages) { dotnet pack -c Release --no-build }
init:
- dotnet --version
- git config --global core.autocrlf true
before_test:
- SET ORCHARD_TEST_MYSQL_CONNECTION_STRING=server=localhost;uid=root;pwd=Password12!;database=octest;
- SET MYSQL_PWD=Password12!
- PATH=C:\Program Files\MySQL\MySQL Server 5.7\bin;%PATH%
- mysql -e "create database octest;" --user=root
- SET ORCHARD_TEST_POSTGRESQL_CONNECTION_STRING=Server=localhost;Port=5432;Database=octest;User Id=postgres;Password=Password12!;
- SET PGUSER=postgres
- SET PGPASSWORD=Password12!
- PATH=C:\Program Files\PostgreSQL\9.6\bin\;%PATH%
- createdb octest
- SET ORCHARD_TEST_SQLSERVER_CONNECTION_STRING=Server=(local)\SQL2017;Database=tempdb;User ID=sa;Password=Password12!
test_script:
- node --version
- npm --version
- 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:
# all packages go to CloudSmith
- provider: NuGet
server: https://nuget.cloudsmith.io/orchardcore/preview/v2/package
api_key:
secure: ql3vT7BSpSrlvrZjpsf2zbw9A41J43ZhJUaibyI7Y3QHFFk69ecNXHOcXf0ykvm3
skip_symbols: true
artifact: /.*\.nupkg/
# only packages from master branch go to NuGet
- provider: NuGet
on:
branch: master
server: https://www.nuget.org/api/v2/package
api_key:
secure: fPTpi6T2Ioy0r39I2B0SW/RGDgZrduX//a1uSqMOTnGj0vkTdBk0gULMCMS7xc/I
skip_symbols: true
artifact: /.*\.nupkg/
# DockerHub
after_deploy:
- ps: |
if ($IsMasterBranch)
{
cd $env:APPVEYOR_BUILD_FOLDER\src\OrchardCore.Cms.Web
Get-ChildItem -path ".\App_Data\" | Remove-Item -Recurse -Confirm:$false -Force
dotnet publish -c Release --no-build -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-rc2 .
echo "$env:DOCKER_PASS" | docker login -u="$env:DOCKER_USER" --password-stdin
docker push orchardproject/orchardcore-cms-windows
}
if ($IsDevBranch)
{
cd $env:APPVEYOR_BUILD_FOLDER\src\OrchardCore.Cms.Web
Get-ChildItem -path ".\App_Data\" | Remove-Item -Recurse -Confirm:$false -Force
dotnet publish -c Release --no-build -o $env:APPVEYOR_BUILD_FOLDER\.build\release
cd $env:APPVEYOR_BUILD_FOLDER
docker build -t orchardproject/orchardcore-cms-windows:dev .
echo "$env:DOCKER_PASS" | docker login -u="$env:DOCKER_USER" --password-stdin
docker push orchardproject/orchardcore-cms-windows
}