<p>So I have the following in my Composer file:</p>

<pre><code>  "scripts": {
    "post-root-package-install": [
      "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
      "@php craft setup/welcome"
    ],
    "post-update-cmd": [
      "@php craft migrate/all",
      "@php craft project-config/sync",
      "@php craft clear-caches/compiled-templates",
      "@php craft clear-caches/cp-resources",
      "@php craft clear-caches/data",
      "@php craft clear-caches/seomatic-frontendtemplate-caches",
      "@php craft clear-caches/seomatic-metabundle-caches",
      "@php craft clear-caches/seomatic-sitemap-caches",
      "@php craft clear-caches/temp-files",
      "@php craft clear-caches/template-caches"
    ],
    "post-install-cmd": [
      "@php craft migrate/all",
      "@php craft project-config/sync",
      "@php craft clear-caches/compiled-templates",
      "@php craft clear-caches/cp-resources",
      "@php craft clear-caches/data",
      "@php craft clear-caches/seomatic-frontendtemplate-caches",
      "@php craft clear-caches/seomatic-metabundle-caches",
      "@php craft clear-caches/seomatic-sitemap-caches",
      "@php craft clear-caches/temp-files",
      "@php craft clear-caches/template-caches"
    ]
  }
</code></pre>

<p>and on my deployment (deployHQ) I have the following SSH command:</p>

<pre><code>cd %path% 
composer install
</code></pre>

<p>However, sync changes (project-config/sync) doesn't take effect and each time I have to manually click the button.
Any ideas what I am missing in the process?</p>

CC BY-SA 4.0
2019-03-16T00:40:18.663Z
Is there anything in DeployHQ's deployment report/log? Can you see it successfully running the sync command?
Alex Roper
CC BY-SA 4.0
2019-03-16T14:58:14.383Z
Only log I get back from DeployHQ is this;
Assume it won't log these commands as they are via the composer script?
Terry Upton
CC BY-SA 4.0
2019-03-16T15:11:46.217Z
Run these commands when I manually run composer install via SSH. 
I have just updated composer, so I wonder if that has resolved this.
I will test this out on Monday.
Terry Upton
CC BY-SA 4.0
2020-09-03T09:43:47.557Z
@TerryUpton: did you get this solved?
Matthias Redl-Mann
<craft3><deployment><cli>
Auto trigger craft project-config/sync on deployment
# Auto trigger craft project-config/sync on deployment

(Asked by: username_0 on 2019-03-15)

So I have the following in my Composer file:
  "scripts": {
    "post-root-package-install": [
      "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
      "@php craft setup/welcome"
    ],
    "post-update-cmd": [
      "@php craft migrate/all",
      "@php craft project-config/sync",
      "@php craft clear-caches/compiled-templates",
      "@php craft clear-caches/cp-resources",
      "@php craft clear-caches/data",
      "@php craft clear-caches/seomatic-frontendtemplate-caches",
      "@php craft clear-caches/seomatic-metabundle-caches",
      "@php craft clear-caches/seomatic-sitemap-caches",
      "@php craft clear-caches/temp-files",
      "@php craft clear-caches/template-caches"
    ],
    "post-install-cmd": [
      "@php craft migrate/all",
      "@php craft project-config/sync",
      "@php craft clear-caches/compiled-templates",
      "@php craft clear-caches/cp-resources",
      "@php craft clear-caches/data",
      "@php craft clear-caches/seomatic-frontendtemplate-caches",
      "@php craft clear-caches/seomatic-metabundle-caches",
      "@php craft clear-caches/seomatic-sitemap-caches",
      "@php craft clear-caches/temp-files",
      "@php craft clear-caches/template-caches"
    ]
  }

and on my deployment (deployHQ) I have the following SSH command:
cd %path% 
composer install

However, sync changes (project-config/sync) doesn't take effect and each time I have to manually click the button.
Any ideas what I am missing in the process?

**Tags:** craft3, deployment, cli
> **Comments:**
> **username_1**: Is there anything in DeployHQ's deployment report/log? Can you see it successfully running the sync command?  
> **username_0**: Only log I get back from DeployHQ is this; Assume it won't log these commands as they are via the composer script?  
> **username_0**: Run these commands when I manually run composer install via SSH.  I have just updated composer, so I wonder if that has resolved this. I will test this out on Monday.  
> **username_2**: @TerryUpton: did you get this solved?  

---

## 0 answers

