1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01:00

build-ci script

This commit is contained in:
Kyle Spearrin 2019-03-08 14:16:44 -05:00
parent d09a00c3be
commit 10d6ace700
3 changed files with 48 additions and 11 deletions

View File

@ -1,33 +1,33 @@
image:
- Visual Studio 2017
#- Visual Studio 2017
- Ubuntu1804
environment:
APPVEYOR_YML_DISABLE_PS_LINUX: true
services:
- docker
stack: node 10
install:
- sh: npm i -g gulp
- sh: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- cmd: choco install cloc --no-progress
- cmd: "cloc --include-lang C#,SQL,Razor,\"Bourne Shell\",PowerShell,HTML,CSS,Sass,JavaScript,TypeScript --vcs git"
before_build:
#- sh: dotnet restore
- cmd: msbuild /t:restore
build_script:
#- dotnet build --configuration Debug
- sh: chmod +x ./build.sh
- sh: ./build.sh
- sh: ./build.sh tag dev
- sh: '[[ "${APPVEYOR_REPO_TAG_NAME}" != "" ]] && echo "TAG IS SET"'
- sh: '[[ $APPVEYOR_FORCED_BUILD ]] && echo "FORCED BUILD"'
#- sh: '[[ "${APPVEYOR_REPO_TAG_NAME}" != "" && $APPVEYOR_FORCED_BUILD ]] && ./build.sh tag ${APPVEYOR_REPO_TAG_NAME#"v"}'
- sh: docker images
- sh: ./build.sh push dev
#- sh: '[[ "${APPVEYOR_REPO_TAG_NAME}" != "" && $APPVEYOR_FORCED_BUILD ]] && ./build.sh push latest && ./build.sh push ${APPVEYOR_REPO_TAG_NAME#"v"}'
- sh: chmod +x ./build-ci.sh
- sh: ./build-ci.sh
- cmd: msbuild bitwarden-server.sln /p:Configuration=Debug /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
after_build:
- sh: docker logout
test_script:
#- sh: dotnet test .\test\Core.Test\Core.Test.csproj --configuration Debug --no-build
- cmd: dotnet test .\test\Core.Test\Core.Test.csproj --configuration Debug --no-build

View File

@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig
.gitignore = .gitignore
appveyor.yml = appveyor.yml
build-ci.sh = build-ci.sh
build.ps1 = build.ps1
build.sh = build.sh
LICENSE.txt = LICENSE.txt

36
build-ci.sh Normal file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -e
echo "Repo tag name: ${APPVEYOR_REPO_TAG_NAME}"
echo "Rebuild: ${APPVEYOR_RE_BUILD}"
PROD_DEPLOY=false
TAG_NAME=""
if [ "${APPVEYOR_REPO_TAG_NAME}" != "" -a "${APPVEYOR_RE_BUILD}" == "true" ]
then
PROD_DEPLOY=true
TAG_NAME=${APPVEYOR_REPO_TAG_NAME#"v"}
fi
chmod +x ./build.sh
#dotnet build --configuration Debug
./build.sh
./build.sh tag dev
if [ $PROD_DEPLOY ]
then
./build.sh tag beta
./build.sh tag $TAG_NAME
fi
docker images
./build.sh push dev
if [ $PROD_DEPLOY ]
then
./build.sh push beta
./build.sh push latest
./build.sh push $TAG_NAME
fi