* Wrap script in functions, add a main function, and call them from it.
* Make environment variables local inside the function scope to avoid
unexpected behaviors by the running environment-supplied variables.
* Fix the typo in the "REPOSITORY" environment variable.
* Rename the input "IMAGE" to "TEST_IMAGE" to avoid clashing with the
environment variable from the Prow infrastructure.
Signed-off-by: Ivan Valdes <ivan@vald.es>