acquia/orca

assert_env_vars does nothing

Closed this issue · 1 comments

The assert_env_vars() function in _includes.sh would be helpful... if it were called earlier :)

Unfortunately, if ORCA_SUT_NAME or ORCA_SUT_BRANCH is not set, the Travis CI before_install.sh script will fail with the following cryptic error:

fatal: '' is not a valid branch name.

Note that this error is from before_install.sh, while assert_env_vars() is called in install.sh, so assert_env_vars() will practically never run and you don't get the much more user-friendly assertions.

Example: https://travis-ci.com/github/acquia/drupal-recommended-project/jobs/336300583

Ah, good catch, @danepowell; you're right. I originally asserted environment variables selectively so that scripts that didn't use them could be run without them. But as you demonstrate, that's proved to be a maintenance risk. I've move the assertion into _includes.sh where it will be applied across the board.