Factor out method build_and_upload_locally for use by dx-build-app.