• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

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