cancel
Showing results for 
Search instead for 
Did you mean: 

Add pre-commit git hook to magento cloud

Add pre-commit git hook to magento cloud

Hello, I'm trying to add pre-commit git hook and deploy it on magento cloud project. I've tried to do this via composer json

 

"scripts": {
        "post-install-cmd": [
            "git config core.hooksPath .githooks"
        ],
        "post-update-cmd": [
            "git config core.hooksPath .githooks"
        ]
    }

And during building application on the cloud I've got an error 

W: > git config core.hooksPath .githooks
W: fatal: not in a git directory
W: Script git config core.hooksPath .githooks handling the post-install-cmd event returned with error code 128

Seems like git repo is removed during deployment on magento cloud. Is it correct? How can I add that git hook in this case?

Thanks in advance.

 

2 REPLIES 2

Re: Add pre-commit git hook to magento cloud

The core.hooksPath support is new in Git version 2.9, having been put in with commit 867ad08a2610526edb5723804723d371136fc643.

If your Git version is not at least 2.9.0, setting a hooks-path variable will have no effect at all.

LitExtension - #1 Shopping Cart Migration Expert

LitExtension helps store owners and agencies migrate all important data from one eCommerce platform to another accurately, securely and at the highest speed.

Visit website: http://litextension.com/

Re: Add pre-commit git hook to magento cloud

You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up.

LiteBlue USPS