Editing
Add new server to GitLab AutoDeploy
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Linux servers: ==== * Install Git AutoDeploy ** apt-get install software-properties-common ** add-apt-repository ppa:olipo186/git-auto-deploy ** apt-get update ** apt-get install git-auto-deploy * copy the settings file from Dev: /etc/git-auto-deploy.conf.json * amend the file contents: url to access (GitLab project), active branch required * open the /etc/init.d/git-auto-deploy file and make the daemon running as www-data: ** DAEMON_UID="www-data" ** DAEMON_GID="www-data" * Run systemctl daemon-reload after you’ve made the changes above * A reboot may be required here * Make sure the Deploy Bot account has access to the project and is made a Master * Backup the current website contents: cp -R /var/www/html/ /home/neal/backup/ * Delete the website contents, including the git part (if present): ** cd /var/www/html ** rm –rf * ** rm –rf .git .gitignore .htaccess * Before you do the below process, you may need to check the owner of the /var/log/git-auto-deploy.log file. It should be www-data. Also check the /var/run/git-auto-deploy/git-auto-deploy.pid If not, change them: ** chown www-data:www-data /var/log/git-auto-deploy.log ** chown www-data:www-data /var/run/git-auto-deploy/git-auto-deploy.pid * Start the daemon in foreground, but as the user www-data: sudo -H -u www-data bash -c 'git-auto-deploy --pid-file /var/run/git-auto-deploy/git-auto-deploy.pid --log-file /var/log/git-auto-deploy.log --config /etc/git-auto-deploy.conf.json' * Once static, Ctrl-C the process * It should create the tree * Check the contents of the /var/www/html/.gitignore file * If not present, create one, own it by www-data and push back to the server. If present, leave out the 3 next steps ** vi .gitignore ** chown www-data:www-data .gitignore ** git push origin dev-server * Copy the ignored files listed above from backup * Clear the cache and push changes to GitLab: ** cd /var/www/html ** git rm –rf –cached . ** git add . ** git status ** if the above command says nothing to commit, you can leave out the 2 next steps ** git commit ** git push origin dev-server * Make sure all objects in the .git/objects folder are owned by www-data: chown –R www-data:www-data * * Change the Deploy Bot to be a Reporter in GitLab * Start the service: service git-auto-deploy start * Observe the log file: tail –f /var/log/git-auto-deploy.log * If you don’t see anything in the log and the foreground app runs fine, reboot the server * Add the <nowiki>http://hostname:8001</nowiki> as webhook to GitLab project in question: <nowiki>https://gitlab.apoyar.eu/root/bleckmann/settings/integrations</nowiki> * Reboot the server and check whether it’s listening on port 8001: netstat -anp
Summary:
Please note that all contributions to Apoyar Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Apoyar Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
British English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Apoyar Infrastructure
Active Directory
Recent changes
Random page
Upload file
Tools
What links here
Related changes
Special pages
Page information