• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Display log of commands in Deploy actions

topkat2

New Pleskian
Server operating system version
debian 20
Plesk version and microupdate number
18.0.43
Hi, is there a way to see the real time output of deploy actions please ?
In my case I need to run a sequence of npm commands on my nodejs project and it will be way easier to see output of the cli.

Thanks for your lights
 
My solution was to write it to a txt file and read that file (very hacky by the way XD). Here is my full deploy command:
Bash:
# BACKEND DEPLOY
export PATH=$PATH:/opt/plesk/node/16/bin && cd ./folder1 && rm -f  deploy.log &&  npm i >> deploy.log 2>> deploy.log && npm run build >> deploy.log 2>> deploy.log && npx pm2 stop ../pm2.preprod.config.js >> deploy.log 2>> deploy.log ; npx pm2 start ../pm2.preprod.config.js >> deploy.log 2>> deploy.log

# FRONTEND DEPLOY
export PATH=$PATH:/opt/plesk/node/16/bin && cd ./folder2 && rm -f  deploy.log && npm i >> deploy.log 2>> deploy.log && REACT_APP_NODE_ENV=preprod REACT_APP_PUBLIC_URL=https://XXX.com/ /opt/plesk/node/16/bin/npm run build:prod >> deploy.log 2>> deploy.log

The main bit here being `command >> deploy.log 2>> deploy.log`which write output on success or error command in a file.
Take me aware if you find anything cleaner. That's all I have for now..
 
i have written a small bash script that lives in the repro - and in the actions i just call it -
this way i get a live update if i reload the *log-file-page* in another browser tab...
(works only with *.txt files.....)

Bash:
# call from git additional deployment actions
# deployit.sh &>> ../app_deploy.txt

MYLOG="../app_deploy.txt"

# clear file..
echo "git deploy start" > $MYLOG
date --iso-8601='seconds' >> $MYLOG

echo "do your things:" &>> $MYLOG

echo "git deploy done." >> $MYLOG
date --iso-8601='seconds' >> $MYLOG

sunny greetings
stefan
 
Back
Top