• 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

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