-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUpdateContainer.bat
More file actions
69 lines (54 loc) · 1.86 KB
/
UpdateContainer.bat
File metadata and controls
69 lines (54 loc) · 1.86 KB
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
@echo off
rem This script updates a specific IGLib's module by cloning its Git
rem repository (if necessary), and updating it to the current state.
rem Bootstrap scripting such that update scripts are available:
set BootStrapScripting=%~dp0\workspace\BootStrapScripting.bat
echo.
echo SCRIPT: BootStrapScripting: "%BootStrapScripting%"
echo.
if not exist "%BootStrapScripting%" (
echo.
echo ERROR: Variable BootStrapScripting does not contain a valid
echo script path.
echo.
goto finalize
)
call "%BootStrapScripting%"
rem Start local context, such that generation script does not have side effects:
setlocal
rem Reset the error level (by running an always successfull command):
ver > nul
rem Addition to common update scripts - attempt to add appropriate remotes:
set InitialDir=%CD%
cd "%~dp0"
git remote add origin https://github.com/ajgorhoe/iglibcontainer.git
git remote add zz_origin_gitlab https://gitlab.com/ajgorhoe/iglibcontainer.git
git remote add local d:\backup_sync\bk_code\git\ig\IGLibContainer
cd "%InitialDir%"
ver > nul
rem Repository update parameters:
set ModuleDirRelative=.\
set CheckoutBranch=master
set RepositoryAddress=https://github.com/ajgorhoe/iglibcontainer.git
set RepositoryAddressSecondary=https://gitlab.com/ajgorhoe/iglibcontainer.git
set RepositoryAddressLocal=d:\backup_sync\bk_code\git\ig\IGLibContainer
set Remote=origin
set RemoteSecondary=zz_origin_gitlab
set RemoteLocal=local
rem Derived parameters:
set ModuleDir=%~dp0%ModuleDirRelative%
echo.
echo SCRIPT: UpdateRepo: "%UpdateRepo%"
echo.
if not exist "%UpdateRepo%" (
echo.
echo ERROR: Variable UpdateRepo does not contain a valid script path.
echo BoorstrapScripting probably not performed correctly.
echo.
goto finalize
)
rem Finally, perform repository clone / update by using the scripts
rem prepared in the bootstrapping stage:
"%UpdateRepo%" %*
:finalize
endlocal