-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkins-copy-lastbuild.bat
37 lines (26 loc) · 1.31 KB
/
jenkins-copy-lastbuild.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
@echo off
echo "*** Running jenkins-copy-lastbuild.bat..."
REM ===========================================================================
REM Configure environment on Jenkins machine
REM ===========================================================================
call "%~dp0"jenkins-custom.bat
REM ===========================================================================
REM Copy to shared team dir
REM ===========================================================================
echo date=%date%
REM timestamp without spaces
for /F "tokens=1,2,3 delims= " %%i in ("%date%") do set da_nospaces=%%j
echo da_nospaces=%da%
REM timestamp without slashes
for /F "tokens=1,2,3 delims=/" %%i in ("%da_nospaces%") do set da_nospaces_noslashes=%%k-%%i-%%j
echo da_nospaces_noslashes=%da_nospaces_noslashes%
REM timestamp with time
for /F "usebackq tokens=1,2,3 delims=: " %%i in (`time /T`) do set timestamp=%da_nospaces_noslashes%-T%%i%%j
echo timestamp=%timestamp%
set "TEAMDIR=%JENKINS_LAST_BUILD_DIR%\%timestamp%"
if not exist %TEAMDIR% md %TEAMDIR%
xcopy /Y cmake-install-dir\setup %TEAMDIR%
REM ===========================================================================
REM Copy to shared public dir
REM ===========================================================================
xcopy /Y cmake-install-dir\setup %JENKINS_PUBLIC_DIR%