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:
subprocess
to invoke system commands like scp
to copy files over and ssh <host> <command>
to run remote commands. 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.