-
Notifications
You must be signed in to change notification settings - Fork 10
/
feature.bat
91 lines (81 loc) · 2.27 KB
/
feature.bat
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
echo off
chcp 65001
setlocal
set USER=%DEV1C-USER%
set PASSWORD=%DEV1C-PASSWORD%
set SRC=./src
for %%a in (".") do set FEATURE=%%~na
set RUNNER_ROOT=%CD%
set RUNNER_V8VERSION=8.3.10
set GITSYNC_V8VERSION=%RUNNER_V8VERSION%
set GITSYNC_STORAGE_PATH=./build/storage
set GITSYNC_WORKDIR=%SRC%
set VA_SINGLE_PATH=%VA_SINGLE_PATH%
if "%1"=="" (
echo "Unknown mode"
exit /b
) else (
call git config --local core.autocrlf true
call git config --local core.quotepath false
set MODE=%1
)
if "%MODE%"=="start" (
call git checkout -b "feature/%FEATURE%"
call :src
call :createrepo
)
if "%MODE%"=="from" (
if "%2"=="" (
set RUNNER_STORAGE-VER=
) else (
set RUNNER_STORAGE-VER=%2
)
call :storage
call :createrepo
)
if "%MODE%"=="export" (
set GITSYNC_STORAGE_USER=Администратор
set GITSYNC_STORAGE_PASSWORD=Администратор
call :export
)
if "%MODE%"=="push" (
call git push --set-upstream origin "feature/%FEATURE%"
call git push --tags
)
if "%MODE%"=="test" (
call :test
)
echo "feature done"
exit /b
:src
call runner init-dev --settings .\tools\runner.json --src %SRC%
call :initDB
exit /b
:storage
call runner init-dev --settings .\tools\runner.json --storage
call :initDB
exit /b
:createrepo
call runner createrepo --db-user "Администратор" --settings .\tools\runner.json
call gitsync set-version 0 %SRC%
if not "%USER%"=="" (
if "%PASSWORD%"=="" (
call runner createrepouser --storage-user %USER% --settings .\tools\runner.json
) else (
call runner createrepouser --storage-user %USER% --storage-pwd %PASSWORD% --settings .\tools\runner.json
)
)
exit /b
:initDB
call oscript .\tools\onescript\Compile.os .\tools\epf\
call runner run --settings .\tools\runner.json --execute .\tools\epf\InitDB.epf --command "file=.\tools\users.json"
exit /b
:export
call tools\DecompileFeatures
call gitsync s -R
exit /b
:test
call oscript .\tools\onescript\Compile.os .\test\
call runner run --settings .\tools\runner.json --db-user "Разработчик" --execute %VA_SINGLE_PATH% --command "StartFeaturePlayer;ShowMainForm=False;ClearCacheSteps;workspaceRoot=%CD%;VBParams=%CD%\tools\va\unit.json" --additional /TESTMANAGER
call allure serve %CD%\reports\allure
exit /b