简体   繁体   中英

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

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM