Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

docker scheme: working-directory and stdin passing (reroll of #5974)#6057

Merged
swissspidy merged 2 commits into
wp-cli:mainwp-cli/wp-cli:mainfrom
drzraf:4972-docker-stdindrzraf/wp-cli:4972-docker-stdinCopy head branch name to clipboard
Mar 4, 2025
Merged

docker scheme: working-directory and stdin passing (reroll of #5974)#6057
swissspidy merged 2 commits into
wp-cli:mainwp-cli/wp-cli:mainfrom
drzraf:4972-docker-stdindrzraf/wp-cli:4972-docker-stdinCopy head branch name to clipboard

Conversation

@drzraf

@drzraf drzraf commented Mar 1, 2025

Copy link
Copy Markdown

#5974 reroll

  1. docker exec and docker-compose exec provide an option to cleanly set the working directory before running a command
    => Use it instead and use cd <...> ; command-prefixing in vagrant/ssh cases

  2. Using docker scheme, wp post update 1 - <<<foo didn't worked (issue passing stdin to command for docker-based WP instances #4972)

  • Because STDOUT being a tty, -t is passed with no ability to inhibit this
  • Because docker -i flag is necessary

=> As such:

  • docker -i (--interactive) is introduced (with sensible autodetection)
  • WP_CLI_DOCKER_NO_TTY and WP_CLI_DOCKER_NO_INTERACTIVE environment variables are introduced to optionally inhibit these respective flags

Special case to handle behat runs (see #5974)

   cleanly set the working directory before running a command
=> Use it instead and use `cd <...> ;` command-prefixing in vagrant/ssh cases

2. Using `docker` scheme, `wp post update 1 - <<<foo` didn't worked (issue wp-cli#4972)
* Because STDOUT being a tty, `-t` is passed with no ability to inhibit this
* Because docker `-i` flag is necessary

=> As such:
* docker `-i` (`--interactive`) is introduced (with sensible autodetection)
* `WP_CLI_DOCKER_NO_TTY` and `WP_CLI_DOCKER_NO_INTERACTIVE` environment variables
  are introduced to optionally inhibit these respective flags
@drzraf drzraf requested a review from a team as a code owner March 1, 2025 19:44
@codecov-commenter

codecov-commenter commented Mar 1, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
php/WP_CLI/Runner.php 0.00% 16 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread php/WP_CLI/Runner.php Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.