Skip to content

how to use gitlab ci to deploy project to multiple server respectively

/etc/gitlab-runner/config.toml:

concurrent = 1

[[runners]]
  url = "http://192.168.1.240/ci"
  token = "fb8b064e53e31159e268853af6f8ea"
  name = "production162"
  executor = "ssh"
  [runners.ssh]
    user = "root"
    host = "192.168.1.162"
    port = "22"
    identity_file = "/home/user/.ssh/id_rsa"

[[runners]]
  url = "http://192.168.1.240/ci"
  token = "18795ba96cfe74478ee63ff7decedd"
  name = "production163"
  executor = "ssh"
  [runners.ssh]
    user = "root"
    host = "192.168.1.250"
    port = "22"
    identity_file = "/home/user/.ssh/id_rsa"

.gitlab-ci.yml:

job1:
    stage: deploy
    script:
        - "make install"
        - "./ci.sh"

How can I make job1 run on production163 and production162 respectively?