Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-23157

Syncing workspace to most recently created label

    XMLWordPrintable

Details

    Description

      I have a job that creates a Perforce label after a successful build. I want Jenkins to sync my workspace to the most current label before successive builds. I saw the P4 label option under the advanced tab that looks promising but I don't know what parameter to use or how. Any suggestions? After a successful build is it possible to set the newly created label as a parameter for the next build?

      Attachments

        Activity

          rpetti Rob Petti added a comment -

          I don't think what you are asking for is possible. You will need to write your own sync script. When you specify a label in the plugin it syncs to that and immediately starts building. You can't configure it to skip changes, and that's not how perforce works in general.

          rpetti Rob Petti added a comment - I don't think what you are asking for is possible. You will need to write your own sync script. When you specify a label in the plugin it syncs to that and immediately starts building. You can't configure it to skip changes, and that's not how perforce works in general.

          Or am I just going to have to rollback any changesets that cause the build to fail before proceeding with submitting new changesets?

          sgardner Steven Gardner added a comment - Or am I just going to have to rollback any changesets that cause the build to fail before proceeding with submitting new changesets?

          I want it to grab the changeset from the last successful build and then grab any SCM changes. That way if build passes with changeset 3 but fails with changeset 4, on the build with changeset 5 it will grab everything up to changeset 3, skip 4, and add changes from changeset 5

          sgardner Steven Gardner added a comment - I want it to grab the changeset from the last successful build and then grab any SCM changes. That way if build passes with changeset 3 but fails with changeset 4, on the build with changeset 5 it will grab everything up to changeset 3, skip 4, and add changes from changeset 5
          rpetti Rob Petti added a comment -

          Why run a build again with the exact same changeset?

          rpetti Rob Petti added a comment - Why run a build again with the exact same changeset?

          Do I do that using the 'Use Upstream Project Revision'? I tried to set that option as the name of the current project and it wasn't working correctly (I'm guessing because its supposed to work between two different jobs, not the same one passing the revision to itself).

          sgardner Steven Gardner added a comment - Do I do that using the 'Use Upstream Project Revision'? I tried to set that option as the name of the current project and it wasn't working correctly (I'm guessing because its supposed to work between two different jobs, not the same one passing the revision to itself).
          rpetti Rob Petti added a comment -

          Not really. The name of the label simply isn't available to downsteam build trigger actions. Just pass the changeset number downstream instead of using the label.

          rpetti Rob Petti added a comment - Not really. The name of the label simply isn't available to downsteam build trigger actions. Just pass the changeset number downstream instead of using the label.

          People

            Unassigned Unassigned
            sgardner Steven Gardner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: