• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Forwarded to devs Git "additional deployment actions" sometimes not working

Martin.H

Regular Pleskian
Username: Martin.H

TITLE

Git "additional deployment actions" sometimes not working

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Debian 10.7

PROBLEM DESCRIPTION

My additional commands (or here called "additional deployment actions") are not always executed after a commit. That breaks my Auto-Deploy setup.

STEPS TO REPRODUCE

  1. Create a application that you place into "httpdocs/www/"
  2. set up Git and set deploy path to "httpdocs/www/"
  3. add additional commands like "yarn all" which you mapped to:
    Code:
    "scripts": {
        "build": "hugo",
        "clearCache": "yarn cfcli -c .cfcli.yml purge",
        "all": "yarn install && yarn grunt && yarn build && yarn clearCache"
    },
  4. now push a testcommit
  5. for debug change "yarn all" to "yarn all 2>&1 > output.log" which will create a log (which is empty..)

ACTUAL RESULT

The testcommit will be successfully captured by Plesks Git extension but no commands will be triggered.

EXPECTED RESULT

Not just capture the testcommit, but also trigger the expected function in the desired folder

ANY ADDITIONAL INFORMATION

Sometimes it works if I set the comand to "yarn install" but as soon as anything else is included it breaks and do not trigger anything.

But if I log into SSH ALL the commands are working fine!

YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
@Martin.H


Hello,

i suggest you to do the following steps for debugging your issue:

1 First of all you should check that deployment actions really work on server.
You can add the following command:
Code:
touch ~/test.txt

2 I'm not aware of the way how you installed node & yarn package to your server & how you made yarn available as alias 'yarn' (Looks like you've exported it to PATH variable)

I've checked your issue using a node.js installed with Node JS Plesk extension.

I used repository with package.json and following command:
Code:
/opt/plesk/node/12/bin/npm run test
Then i exported nodeto PATH by
Code:
export PATH=/opt/plesk/node/12/bin
and specify command like this:
Code:
npm run test

Both variants works fine.

You can make an "test.sh" script where all necessary commands will be execuded, on by one.
Deployment action string will be the following:
Code:
sh ~/test.sh > output.log

This solution should help you to find a root cause.
 
@Martin.H I'm experiencing the exact same issue. Did you mange to solve it?

My additional deployment actions are as follows
/opt/plesk/node/14/bin/npm ci --scripts-prepend-node-path NODE_ENV=production /opt/plesk/node/14/bin/npm run build --scripts-prepend-node-path touch ./tmp/restart.txt

@cepesh84 I followed this blog post. Nothing wrong with that right?

Plesk version:
Product: Plesk Obsidian 18.0.37 Update #2, last updated on Aug 11, 2021 06:26 AM
 
@Martin.H I'm experiencing the exact same issue. Did you mange to solve it?

My additional deployment actions are as follows
/opt/plesk/node/14/bin/npm ci --scripts-prepend-node-path NODE_ENV=production /opt/plesk/node/14/bin/npm run build --scripts-prepend-node-path touch ./tmp/restart.txt

@cepesh84 I followed this blog post. Nothing wrong with that right?

Plesk version:
Product: Plesk Obsidian 18.0.37 Update #2, last updated on Aug 11, 2021 06:26 AM
important, you had to enable ssh access for the user...
 
Back
Top