start deploy cmd, move some functions to lib, add build info to cmd