Skip to main content
Associate II
June 6, 2024
Solved

Skip buildsteps during headless build

Hi, 

i create a pipeline to compile a cubeide project with the cubeide in a docker container. on azure.
the docker container is linux based as i found no solution to do a headless cubeide installation on windows(or is there a way?)

in my project settings one of the build steps is to call a batch file for some code generation stuff. (this is needed during development so it does not get forgotten) normal development happens on a windows system.
(it would not be necessary to do the codegeneration step if the project is compiled on the buildserver)

as expected this does not work if i start the batch file in the linux headless build environment and it throws a error code

is there a way to skip this buildstep somehow? because at the moment this steps generates an error exit code which fails my complete build pipeline.
to discard every errorcode is not an option because i cannot distinguish between a compile error and a buildstep error (or am i missing sth?)


regards

This topic has been closed for replies.
unsigned_char_array
Lead III
June 6, 2024

You can make a type of batch file that can run on both windows and Linux. There are some ugly syntax hacks that let you do that. If seen some topics on stack overflow about that.

Alternatively you can make a different build target for on Linux: Debug_Linux and Release_Linux. Then those targets are just copies of the regular targets with only the post build command in STM32CubeIDE differing. In the headless build command you can select the target you want to build.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."

5 replies

unsigned_char_array
Lead III
June 6, 2024

Don't call the batch file in Linux, call the sh file. It works perfectly. I used headless build in both windows and Linux.

I recommend building with --no-indexer since that can take a lot of time for larger projects.

Perhaps you can do docker installation by just copying the files from Program Files to a zip and unzipping. Also save the paths and environment variables.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
funkyAuthor
Associate II
June 6, 2024

no, i did not mean the headleass-build.bat/sh script.

 

in my project i have a build step where a batch file is called and this step only works under windows and on linux it fails

unsigned_char_array
Lead III
June 6, 2024

You can make a type of batch file that can run on both windows and Linux. There are some ugly syntax hacks that let you do that. If seen some topics on stack overflow about that.

Alternatively you can make a different build target for on Linux: Debug_Linux and Release_Linux. Then those targets are just copies of the regular targets with only the post build command in STM32CubeIDE differing. In the headless build command you can select the target you want to build.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
funkyAuthor
Associate II
June 10, 2024

ugly syntax hacks? that sounds promising :D


hmm, yep another build target would be a solution. but i try to avoid this because it is just another target i would have to maintain. 
i will look for the syntax hacks