Answers.Body: <p>You can run most of Craft's console commands using the <code>--interactive=0</code> flag which will disable interactive prompts for the command. More details in the docs here: <a href="https://craftcms.com/docs/4.x/console-commands.html#global-options" rel="nofollow noreferrer">https://craftcms.com/docs/4.x/console-commands.html#global-options</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-24T11:53:35.263Z
Answers.Text: To add to Steve's answer, here's a good set of commands to run in the pipeline: `php craft up --interactive=0`, `clear-caches/compiled-templates --interactive=0`, `clear-caches/cp-resources --interactive=0`, `clear-caches/data --interactive=0`
Answers.UserDisplayName: Max Strebel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-24T12:06:01.807Z
Answers.Text: Awesome!
  @MaxStrebel Nice addition
Answers.UserDisplayName: Matthias
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-24T11:36:32.723Z
Answers.LastActivityDate: 2023-08-24T11:36:32.723Z
Answers.UserDisplayName: Steve Rowling
Body: <p>I am deploying a Craft website with Bitbucket Pipelines.
  Basically what it does is spinning up a container that runs composer install and builds my CSS and JS with webpack. The vendor folder and js/css builds are kept as artefacts to be deployed to the server.
  So far so good.</p>
  <p>However when I am doing some updates locally (updating craft version or plugins) and push these to my repository, deploy them and run <code>php craft up</code> I get the following message:</p>
  <pre><code>Total 4 new Craft migrations to be applied:
      - m230531_123004_add_entry_type_show_status_field
      - m230607_102049_add_entrytype_slug_translation_columns
      - m230710_162700_element_activity
      - m230820_162023_fix_cache_id_type```
  </code></pre>
  <p>This is actually prompting me to answer yes or no.
  But since this is a automatic pipeline there won't be any input from me.</p>
  <p>Is there an option I can add to the <code>php craft up</code> command which will always choose yes so that the pipeline will complete successfully?</p>
  <p>For example with <code>composer install</code> I added the <code>--no-interaction</code> flag.</p>
  
Tags: <craft4><deployment><cli>
Title: Run craft up command in deployment pipeline without prompts
ThreadText: # Run craft up command in deployment pipeline without prompts
  
  (Asked by: username_0 on 2023-08-24)
  
  I am deploying a Craft website with Bitbucket Pipelines.
  Basically what it does is spinning up a container that runs composer install and builds my CSS and JS with webpack. The vendor folder and js/css builds are kept as artefacts to be deployed to the server.
  So far so good.
  
  However when I am doing some updates locally (updating craft version or plugins) and push these to my repository, deploy them and run `php craft up` I get the following message:
  
  ```
  Total 4 new Craft migrations to be applied:
      - m230531_123004_add_entry_type_show_status_field
      - m230607_102049_add_entrytype_slug_translation_columns
      - m230710_162700_element_activity
      - m230820_162023_fix_cache_id_type```
  
  ```
  
  This is actually prompting me to answer yes or no.
  But since this is a automatic pipeline there won't be any input from me.
  
  Is there an option I can add to the `php craft up` command which will always choose yes so that the pipeline will complete successfully?
  
  For example with `composer install` I added the `--no-interaction` flag.
  
  **Tags:** craft4, deployment, cli
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-08-24. Score: 3 | Accepted answer
  
  You can run most of Craft's console commands using the `--interactive=0` flag which will disable interactive prompts for the command. More details in the docs here: <https://craftcms.com/docs/4.x/console-commands.html#global-options>
  
  > **Comments:**
  > **username_2**: To add to username_1's answer, here's a good set of commands to run in the pipeline: `php craft up --interactive=0`, `clear-caches/compiled-templates --interactive=0`, `clear-caches/cp-resources --interactive=0`, `clear-caches/data --interactive=0`  
  > **username_0**: Awesome! @username_2 Nice addition  
  
  ---
  
  