forked from rebus-org/Rebus.RabbitMq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.cmd
57 lines (41 loc) · 830 Bytes
/
release.cmd
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
@echo off
set scriptsdir=%~dp0
set root=%scriptsdir%\..
set deploydir=%root%\deploy
set project=%1
set version=%2
if "%project%"=="" (
echo Please invoke the build script with a project name as its first argument.
echo.
goto exit_fail
)
if "%version%"=="" (
echo Please invoke the build script with a version as its second argument.
echo.
goto exit_fail
)
set Version=%version%
if exist "%deploydir%" (
rd "%deploydir%" /s/q
)
pushd %root%
dotnet restore --interactive
if %ERRORLEVEL% neq 0 (
popd
goto exit_fail
)
dotnet pack "%root%/%project%" -c Release -o "%deploydir%" -p:PackageVersion=%version% --no-restore
if %ERRORLEVEL% neq 0 (
popd
goto exit_fail
)
call scripts\push.cmd "%version%"
if %ERRORLEVEL% neq 0 (
popd
goto exit_fail
)
popd
goto exit_success
:exit_fail
exit /b 1
:exit_success