Web-hooks play a vital role if you are in Continuous Integration(CI). Higher Level organizations follow GitLab for CI purposes if they operate on open source solutions and at times every developer needs to check his code integrity. At times like that, web hooks can help us.
Webhooks calls URL if any push, merge, issue events are created.
The process involves:
Make sure that your webhook ip follows this format
PHP code to call when URL hits are
You have to make sure that Bash script location is different from that of PHP script for safe usage.
Now your PHP calling Bash script should have the following code:
In terminal edit sudoer's file in safe mode and append the line below.
If you're confused which user should be given permission, it will depend on the web server. It can be www-data for apache2 & Nginx or nobody for Nginx. If you don't know which user to grant permissions for or have any issues running script, Don't forget the PHP script works till the last line but fails to execute exec function . so you need to push your changes to GitLab and wait in the terminal of the server(use top command) for the script to be called. Wait for the script to be called and then make note of user and give that user permissions in visudo file.
One final push and you can see your changes successfully applied automatically.
If you have any trouble executing the bash script without password after editing sudoer's file
2.restart so that changes in sudoer's file may take effect
Micropyramid is a software development and cloud consulting partner for enterprise businesses across the world. We work on python, Django, Salesforce, Angular, Reactjs, React Native, MySQL, PostgreSQL, Docker, Linux, Ansible, git, amazon web services. We are Amazon and salesforce consulting partner with 5 years of cloud architect experience. We develop e-commerce, retail, banking, machine learning, CMS, CRM web and mobile applications.
Django-CRM :Customer relationship management based on Django
Django-blog-it : django blog with complete customization and ready to use with one click installer Edit
Django-webpacker : A django compressor tool
Django-MFA : Multi Factor Authentication
Docker-box : Web Interface to manage full blown docker containers and imagesMore...