WIP: Converted the post build scripts to grunt/node

# Do Not Merge

Fixes #6135
Maybe `deployBranch = process.env.build_branch || "v4.0-dist"` to keep the existing behaviour