Hello all,
I've scenario as follow.
1. Push Local Git repo to Github.
2. Github action runs deployment to cPanel via uAPI.
3. cPanel pull repo from Github
4. cPanel run .cpanel.yml which is :
unfortunately :
1. Task on .cpanel.yml is running before cPanel pull repo from github? I assume this because if the task failed, repo on cPanel is not updated.
2. kill command is mark as Illegal command by cPanel.
What I've try :
- remove task on .cpanel.yml (It's deploy successfully) but still repo on cPanel still didn't updated.
.cpanel.yml
Any suggestion to achieve my scenario?
I've scenario as follow.
1. Push Local Git repo to Github.
2. Github action runs deployment to cPanel via uAPI.
3. cPanel pull repo from Github
4. cPanel run .cpanel.yml which is :
- find PID of current running node apps.
- kill by its PID
- run npm start
unfortunately :
1. Task on .cpanel.yml is running before cPanel pull repo from github? I assume this because if the task failed, repo on cPanel is not updated.
2. kill command is mark as Illegal command by cPanel.
What I've try :
- remove task on .cpanel.yml (It's deploy successfully) but still repo on cPanel still didn't updated.
.cpanel.yml
Code:
deployment:
tasks:
- /bin/kill -9 $(ps -ef | egrep -i api.sayap.co.id | egrep -i server.js |awk {'print'}) 2> /dev/null