Home > Blockchain >  How can i auto deploy with gitlab-ci.yml on a remote server without GitLab Runner?
How can i auto deploy with gitlab-ci.yml on a remote server without GitLab Runner?

Time:09-16

I want to auto deploy a simple docker-compose.yml file with database and api from gitlab-ci.yml. I have a ubuntu server running on a specific ip where i can pull the gitlab project and run it manualy with docker-compose up -d, but how can I achieve this automatically through gitlab-ci.yml, without using gitlab runner?

CodePudding user response:

Gitlab CI ("Continuous Integration") inherently involves Gitlab Runners.

You can't use one without the other.

Whether you use a Gitlab Runner or not, you can achieve what you ask in a number of different ways, such as:

  • Use subprocess to invoke system commands like scp to copy files over and ssh <host> <command> to run remote commands.
  • Use paramiko to do the same thing in a more Pythonic way.
  • Use a provisioning tool such as Ansible

If you're not using a Gitlab Runner, your code would invoke these directly. For someone using a Gitlab Runner, their .gitlab-ci.yml would contain these scripts / script calls instead.

  • Related