1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-26 12:55:17 +01:00
bitwarden-server/appveyor.yml

114 lines
2.9 KiB
YAML
Raw Normal View History

2019-03-08 05:21:58 +01:00
image:
2019-03-13 15:26:01 +01:00
- Visual Studio 2017
2019-03-08 05:21:58 +01:00
- Ubuntu1804
2019-03-08 20:16:44 +01:00
2019-03-08 05:21:58 +01:00
services:
- docker
2019-03-08 20:16:44 +01:00
2019-03-08 05:46:06 +01:00
stack: node 10
2019-03-08 20:16:44 +01:00
2019-03-12 17:36:32 +01:00
init:
2019-03-15 06:02:18 +01:00
- ps: |
if($isWindows -and $env:DEBUG_RDP -eq "true") {
iex ((new-object net.webclient).DownloadString(`
'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
}
2019-03-13 15:17:24 +01:00
- ps: |
if($isWindows) {
Install-Product node 10
}
2019-03-12 17:36:32 +01:00
2019-03-08 05:37:34 +01:00
install:
2019-03-13 15:17:24 +01:00
- ps: |
2019-03-15 14:33:49 +01:00
$env:STUB_CORE_VER = "dev"
$env:STUB_WEB_VER = "dev"
2019-03-13 15:17:24 +01:00
$env:PROD_DEPLOY = "false"
$env:TAG_NAME = ""
if($env:APPVEYOR_REPO_TAG -eq "true" -and $env:APPVEYOR_RE_BUILD -eq "True") {
$env:PROD_DEPLOY = "true"
$env:TAG_NAME = $env:APPVEYOR_REPO_TAG_NAME.TrimStart("v")
2019-03-15 14:33:49 +01:00
$env:STUB_CORE_VER = $env:TAG_NAME
2019-03-13 15:17:24 +01:00
echo "This is a production deployment for ${env:TAG_NAME}."
}
if($isLinux) {
npm i -g gulp
} else {
choco install cloc --no-progress
cloc --include-lang C#,SQL,Razor,"Bourne Shell",PowerShell,HTML,CSS,Sass,JavaScript,TypeScript --vcs git
}
2019-03-08 20:16:44 +01:00
2019-03-08 06:14:38 +01:00
before_build:
2019-03-13 15:17:24 +01:00
- sh: |
if [ "${DOCKER_USERNAME}" != "" -a "${DOCKER_PASSWORD}" != "" ]
then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi
- ps: |
if($isLinux) {
#dotnet restore
} else {
msbuild /t:restore
}
2019-03-08 20:16:44 +01:00
2019-03-08 05:21:58 +01:00
build_script:
2019-03-13 15:17:24 +01:00
- sh: chmod +x ./build.sh
2019-03-11 03:35:41 +01:00
- ps: |
2019-03-13 15:17:24 +01:00
if($isLinux) {
#dotnet build --configuration Debug
./build.sh
./build.sh tag dev
if($env:PROD_DEPLOY -eq "true") {
./build.sh tag beta
2019-03-13 15:18:37 +01:00
./build.sh tag $env:TAG_NAME
2019-03-13 15:17:24 +01:00
}
docker images
./build.sh push dev
if($env:PROD_DEPLOY -eq "true") {
./build.sh push beta
./build.sh push latest
2019-03-13 15:18:37 +01:00
./build.sh push $env:TAG_NAME
2019-03-13 15:17:24 +01:00
}
} else {
msbuild bitwarden-server.sln /p:Configuration=Debug /verbosity:minimal `
2019-03-11 03:21:57 +01:00
/logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
2019-03-13 15:32:00 +01:00
2019-03-13 15:30:41 +01:00
$env:swaggerGen = "true"
$env:ASPNETCORE_ENVIRONMENT = "Production"
cd .\src\Api
dotnet swagger tofile --output ..\..\swagger.json --host api.bitwarden.com --format Indented `
2019-03-11 03:21:57 +01:00
.\bin\Debug\netcoreapp2.1\Api.dll public
2019-03-13 15:17:24 +01:00
cd ..\..
2019-03-13 15:30:41 +01:00
$env:ASPNETCORE_ENVIRONMENT = ""
$env:swaggerGen = ""
2019-03-13 15:17:24 +01:00
Push-AppveyorArtifact .\swagger.json
}
2019-03-15 14:33:49 +01:00
sh: |
echo "Make docker stubs"
mkdir stub
docker run -it --rm --name setup -v stub:/bitwarden bitwarden/setup:$STUB_CORE_VER \
dotnet Setup.dll -stub 1 -install 1 -domain bitwarden.company.com -os lin \
-corev $STUB_CORE_VER -webv $STUB_WEB_VER
cd stub
ls
2019-03-08 20:16:44 +01:00
2019-03-08 14:55:19 +01:00
after_build:
- sh: docker logout
2019-03-08 20:16:44 +01:00
2019-03-08 06:34:51 +01:00
test_script:
2019-03-13 15:17:24 +01:00
- ps: |
if($isWindows) {
dotnet test .\test\Core.Test\Core.Test.csproj --configuration Debug --no-build
}
2019-03-15 06:02:18 +01:00
on_finish:
- ps: |
if($isWindows -and $env:DEBUG_RDP -eq "true") {
$blockRdp = $true
iex ((new-object net.webclient).DownloadString(`
'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
}