Some builds failing, click retry and they always work

Getting intermittent issues with out build scripts. It basically installs phpcs then runs it against our php code with a custom set of rules, every now and then and more often than not it fails with the following error
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
bash: line 1: phpcs: command not found

phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs returned exit code 127

Action failed: phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs

If i click rebuild it will then work properly and pass/fail based on phpcs findings.

Specify the Docker image with the SHA instead of a tag and it will solve this.

Do you mean here?
composer global require wp-coding-standards/wpcs:0.10.*

That heavily depends on your setup but most inconsistencies are related to using the “latest” tag or something similar where a version is cached on our hosts and a newer one exists on other hosts.

The code we use is pretty simple:

export PATH="$HOME/.composer/vendor/bin:$PATH"
composer global require wp-coding-standards/wpcs:0.10.*
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs

Then 50% of builds we get phpcs not found

I’m referring to the Docker container. I doubt it’s an issue with composer.

How do I change that, I wasnt aware we even use docker…

Is this a 2.0 question…?

Ah … no then!

Sorry I clicked the link at the top must have ended up in the worng area, can you move the topic?

1 Like

On 1.0 I’d SSH in and see if find brings up any results. Maybe the $PATH is off sometimes? It’s certainly an odd.

When I rebuild with SSH the build passes, it always works with a rebuild.

How can the PATH be off though, its clearly defined in the line above it.