I think your script is broken, that strange condition and default value cause it will set cpuCore to 1 no matter what
I just don't understand why a building process needs cpu core num = memory size in GB
And I don't see any initialtion for the variable cpuCore it will always set to 1, and if you want to meet the condition you have to make cpuCore = MEM_INFO(which is memory size in GB), but since cpuCore is set to 1, the whole condition is a waste of resource and will always leads to cpuCore=1