Git repo access in build time on MAR server
I have the next code in pro file:
GIT_COMMENT=$$system(git log -1 --pretty=%B) INFOS = $$split(GIT_COMMENT, " ") VERSION = $$member(INFOS, 0) BUILD = $$member(INFOS, 1)
But, in console log, I recieved error message, that current folder is not a git repo.
Is it possible to obtain comment from git commit at compile time on MAR server via qmake?
Thank you for attention.
It's not possible because slugbuilder gets only archive package from git repository. This might be possible to do using our new slug api ( https://developer.qtcloudservices.com/mar/deploying/slug ). Basically it allows to build/compile package on your own machine (with help of Docker) and send compiled slug to MAR. Local builder will import environment variables from
.envfile so you could make shell script that first parses git information and saves it to
.envand then starts local build etc..
@jakolehm May be I can set environment variables for MAR server in my git repo files, such as .env file?
In other words, is exist file in mar git repo where I can set mar server environment variables?
In this case I can just read these variables in qmake project file.
You can set environment variables via web console or qtc-cli. These environment variables should be available at build phase automatically.
@jakolehm ok, I will try this, thnak you!