TLPORTAL-23: make robust build script