Update cmd script example

Since !1260 we
used delayed expansion for errorlevel when running Windows Batch.
parent 02d9f103
Pipeline #58211857 passed with stages
in 2 minutes and 26 seconds
......@@ -71,13 +71,13 @@ set nl=^
echo Running on %COMPUTERNAME%...
call :prescript
IF %errorlevel% NEQ 0 exit /b %errorlevel%
IF !errorlevel! NEQ 0 exit /b !errorlevel!
call :buildscript
IF %errorlevel% NEQ 0 exit /b %errorlevel%
IF !errorlevel! NEQ 0 exit /b !errorlevel!
call :postscript
IF %errorlevel% NEQ 0 exit /b %errorlevel%
IF !errorlevel! NEQ 0 exit /b !errorlevel!
goto :EOF
:prescript
......@@ -103,25 +103,25 @@ SET CI_SERVER_TLS_CA_FILE=C:\GitLab-Runner\builds\0\project-1.tmp\CI_SERVER_TLS_
echo Cloning repository...
rd /s /q "C:\GitLab-Runner\builds\0\project-1" 2>NUL 1>NUL
"git" "clone" "http://gitlab.example.com/group/project.git" "Z:\Gitlab\tests\test\builds\0\project-1"
IF %errorlevel% NEQ 0 exit /b %errorlevel%
IF !errorlevel! NEQ 0 exit /b !errorlevel!
cd /D "C:\GitLab-Runner\builds\0\project-1"
IF %errorlevel% NEQ 0 exit /b %errorlevel%
IF !errorlevel! NEQ 0 exit /b !errorlevel!
echo Checking out db45ad9a as master...
"git" "checkout" "db45ad9af9d7af5e61b829442fd893d96e31250c"
IF %errorlevel% NEQ 0 exit /b %errorlevel%
IF !errorlevel! NEQ 0 exit /b !errorlevel!
IF EXIST "..\..\..\cache\project-1\pages\master\cache.tgz" (
echo Restoring cache...
"gitlab-runner-windows-amd64.exe" "extract" "--file" "..\..\..\cache\project-1\pages\master\cache.tgz"
IF %errorlevel% NEQ 0 exit /b %errorlevel%
IF !errorlevel! NEQ 0 exit /b !errorlevel!
) ELSE (
IF EXIST "..\..\..\cache\project-1\pages\master\cache.tgz" (
echo Restoring cache...
"gitlab-runner-windows-amd64.exe" "extract" "--file" "..\..\..\cache\project-1\pages\master\cache.tgz"
IF %errorlevel% NEQ 0 exit /b %errorlevel%
IF !errorlevel! NEQ 0 exit /b !errorlevel!
)
)
......@@ -148,7 +148,7 @@ md "C:\\GitLab-Runner\\builds\\0\\project-1.tmp" 2>NUL 1>NUL
echo multiline!nl!tls!nl!chain > C:\GitLab-Runner\builds\0\project-1.tmp\CI_SERVER_TLS_CA_FILE
SET CI_SERVER_TLS_CA_FILE=C:\GitLab-Runner\builds\0\project-1.tmp\CI_SERVER_TLS_CA_FILE
cd /D "C:\GitLab-Runner\builds\0\project-1"
IF %errorlevel% NEQ 0 exit /b %errorlevel%
IF !errorlevel! NEQ 0 exit /b !errorlevel!
echo $ echo true
echo true
......@@ -175,11 +175,11 @@ md "C:\\GitLab-Runner\\builds\\0\\project-1.tmp" 2>NUL 1>NUL
echo multiline!nl!tls!nl!chain > C:\GitLab-Runner\builds\0\project-1.tmp\CI_SERVER_TLS_CA_FILE
SET CI_SERVER_TLS_CA_FILE=C:\GitLab-Runner\builds\0\project-1.tmp\CI_SERVER_TLS_CA_FILE
cd /D "C:\GitLab-Runner\builds\0\project-1"
IF %errorlevel% NEQ 0 exit /b %errorlevel%
IF !errorlevel! NEQ 0 exit /b !errorlevel!
echo Archiving cache...
"gitlab-runner-windows-amd64.exe" "archive" "--file" "..\..\..\cache\project-1\pages\master\cache.tgz" "--path" "vendor"
IF %errorlevel% NEQ 0 exit /b %errorlevel%
IF !errorlevel! NEQ 0 exit /b !errorlevel!
goto :EOF
```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment