How can I prevent two Jenkins projects/builds from running concurrently?

前端 未结 3 1685
猫巷女王i
猫巷女王i 2020-12-14 15:18

I have two Jenkins projects that share a database. They must not be run simultaneously. Strictly speaking, there is no particular dependency between them beyond non concurre

3条回答
  •  渐次进展
    2020-12-14 16:07

    The Locks and Latches plugin should resolve your problem. Create a lock and have both jobs use the same lock. That will prevent the jobs from running concurrently.

    1. Install the plugin in "Manage Jenkins: Manage Plugins."
    2. Define (provide a name for) your lock(s) in "Manage Jenkins: Configure System."
    3. For each job you want to participate in the exclusion,
      1. in ": Configure: Build Environment," check "Locks",
      2. and pick your lock name from the drop list.

提交回复
热议问题