legacy-cli icon indicating copy to clipboard operation
legacy-cli copied to clipboard

Consider displaying the hooks failed if any of the commands failed during deployment

Open skorasaurus opened this issue 8 years ago • 1 comments

Hi,

I'm running a D8 environment, drush 8.1.15 on platform. My config yamls were not being implemented on my platform environment after committing these changes to the environment.

After a couple hours of troubleshooting, I ssh'ed into the environment and I decided to run the hooks in my D8 environment's .platform.app.yaml. While running drush -y config-import while ssh'ed into the environment (one of the same commands that is run as a hook in platform.app.yaml, I received an error that the configuration import had failed because there was configuration yaml present for a module that was no longer installed.

Perhaps I'm naive, but I reasoned that because no error output displayed in the console following git push platform nameenvironment, the problem wasn't immediately with the configuration-import (or with any of the hooks/drush commands that are run). I assumed that if any of those commands failed and would return an error, the output would be included.

I would really appreciate that you would include any error output of the drush commands or any other hooks, in the output to the terminal after issuing git push platform nameofenvironment.

I did read https://docs.platform.sh/configuration/app/build.html#hooks but that has by default, that only returns an error if the last hook fails.

skorasaurus avatar Dec 19 '17 21:12 skorasaurus

That sounds good, but it's not something the CLI can do directly; it's a feature request for the platform.sh Git component.

The full output of the deploy hook is logged to /var/log/deploy.log, which can be read via platform log deploy (for a running environment).

Just to explain the "last hook" issue: treat each of the "build hook" and "deploy hook" as single shell scripts. Like any shell script, all the commands in the script will be run, and the exit code of the final command determines the exit code of the script. Unless you switch on the errexit flag using the command set -e, which means any failing command will cause the script to exit immediately. More reading via https://stackoverflow.com/a/19622569

pjcdawkins avatar Dec 19 '17 23:12 pjcdawkins