Commit 27aeb7a5 authored by Remi Perenon's avatar Remi Perenon
Browse files

Using Gitlab env. variables to set commit nb and branch name on Windows

parent 03e9be9a
......@@ -7,21 +7,4 @@ if "%BUILD_TARGET%"=="win32" (
) else (
set BUILD_TARGET=win-amd64
set MSVC_BUILD_TARGET=x64
)
rem Set the source directory
set MDANSE_SOURCE_DIR=%cd%
rem Set th directory where the MDANSE dependencies are stored
set MDANSE_DEPENDENCIES_DIR=C:\\Projects\\mdanse\\resources\\dependencies\\%BUILD_TARGET%
rem Set the location where the temporary Python will be installed
set MDANSE_TEMPORARY_INSTALLATION_DIR=%MDANSE_SOURCE_DIR%\\BuildServer\\Windows\\Build
rem Get revision number from Git
rem To understand this syntax "set cmd=...... for /F %%ii ......", see https://stackoverflow.com/questions/2323292/assign-output-of-a-program-to-a-variable
set cmd="git rev-parse --short HEAD"
for /F %%i in (' %cmd% ') do set MDANSE_GIT_CURRENT_COMMIT=%%i
rem Get commit branch from Gitlab
set MDANSE_GIT_BRANCH_NAME=%CI_COMMIT_REF_NAME%
)
\ No newline at end of file
@echo off
cd "%MDANSE_SOURCE_DIR%"
rem Set the source directory
set MDANSE_SOURCE_DIR=%cd%
rem Set th directory where the MDANSE dependencies are stored
set MDANSE_DEPENDENCIES_DIR=C:\\Projects\\mdanse\\resources\\dependencies\\%BUILD_TARGET%
rem Set the location where the temporary Python will be installed
set MDANSE_TEMPORARY_INSTALLATION_DIR=%MDANSE_SOURCE_DIR%\\BuildServer\\Windows\\Build
rem Get revision number from Git
rem To understand this syntax "set cmd=...... for /F %%ii ......", see https://stackoverflow.com/questions/2323292/assign-output-of-a-program-to-a-variable
rem set cmd="git rev-parse --short HEAD"
rem for /F %%i in (' %cmd% ') do set MDANSE_GIT_CURRENT_COMMIT=%%i
set MDANSE_GIT_CURRENT_COMMIT=%CI_COMMIT_SHORT_SHA%
rem Get commit branch from Gitlab
set MDANSE_GIT_BRANCH_NAME=%CI_COMMIT_REF_NAME%
cd "%MDANSE_SOURCE_DIR%"
rem Update the __pkginfo__ file with the current commit
echo "Commit id %MDANSE_GIT_CURRENT_COMMIT%"
......
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