0
votes

I have a laravel project which has already been manually deployed on the remote server (nginx server). Now, since the project has been deployed, I would like to pull the project on the server each time I do git push. another way, when I push the project to gitlab, after I click on run pipeline to pull the project on the server.

1- how can we connect gitlab with the server?

2- I would like the scripts to put them in the gitlab-ci.yml file

1

1 Answers

0
votes

how can we connect gitlab with the server?

One way is to setup an SSH trust relationship so that GitLab Runner can SSH into your server.

Another way is to set up a cron job to check Git repo for updates (which will appear after merge is successful).

I have examples of both in my GitLab CI tutorial at https://gitpitch.com/atsaloli/cicd/master?grs=gitlab#/ (it takes a few seconds to load), starting from https://gitpitch.com/atsaloli/cicd/master?grs=gitlab#/67 ("Setting up Stage and Prod environments" slide)