webhook deploy fix
This commit is contained in:
		| @@ -56,6 +56,8 @@ if [ "$_domain" != "" ]; then | |||||||
| fi | fi | ||||||
| done | done | ||||||
|  |  | ||||||
|  | _id=echo "$_domain" | sed "s/./_/g" | ||||||
|  |  | ||||||
| _remote="" | _remote="" | ||||||
| while [ "$_remote" = "" ] | while [ "$_remote" = "" ] | ||||||
| do | do | ||||||
| @@ -88,9 +90,9 @@ apt-get install webhook | |||||||
| git --git-dir=/home/"$user"/git-repositories/"$_domain.git" remote add origin "$_remote" | git --git-dir=/home/"$user"/git-repositories/"$_domain.git" remote add origin "$_remote" | ||||||
|  |  | ||||||
| # hook deploy script | # hook deploy script | ||||||
| cp -f "$_assets"/webhook-deploy.sh /home/"$user"/webhook-deploy-"$_domain".sh | cp -f "$_assets"/webhook-deploy.sh /home/"$user"/webhook-deploy-"$_id".sh | ||||||
| sed -i -r "s/DOMAIN/$_domain/g" /home/"$user"/webhook-deploy-"$_domain".sh | sed -i -r "s/DOMAIN/$_id/g" /home/"$user"/webhook-deploy-"$_id".sh | ||||||
| chmod +x /home/"$user"/webhook-deploy-"$_domain".sh | chmod +x /home/"$user"/webhook-deploy-"$_id".sh | ||||||
|  |  | ||||||
| # remove git bare repos hook | # remove git bare repos hook | ||||||
| mv /home/"$user"/git-repositories/"$_domain".git/hooks/post-receive /home/"$user"/git-repositories/"$_domain".git/hooks/post-receive.back | mv /home/"$user"/git-repositories/"$_domain".git/hooks/post-receive /home/"$user"/git-repositories/"$_domain".git/hooks/post-receive.back | ||||||
| @@ -98,8 +100,8 @@ mv /home/"$user"/git-repositories/"$_domain".git/hooks/post-receive /home/"$user | |||||||
| # webhook conf | # webhook conf | ||||||
| touch /etc/webhook.conf | touch /etc/webhook.conf | ||||||
| echo " | echo " | ||||||
| - id: deploy-app-$_domain | - id: deploy_app_$_id | ||||||
|   execute-command: /$user/webhook-deploy-$_domain.sh |   execute-command: /home/$user/webhook-deploy-$_id.sh | ||||||
|   command-working-directory: /home/$user/ |   command-working-directory: /home/$user/ | ||||||
| " >> /etc/webhook.conf | " >> /etc/webhook.conf | ||||||
|  |  | ||||||
| @@ -113,4 +115,4 @@ systemctl restart webhook | |||||||
|  |  | ||||||
| ufw allow 9000 | ufw allow 9000 | ||||||
|  |  | ||||||
| echo "http://$_domain:9000/hooks/deploy-app-$_domain" | echo "http://$_domain:9000/hooks/deploy_app_$_id" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user