jenkinsci / plasticscm-plugin

A plugin for Jenkins to be able to use Plastic SCM
MIT License
16 stars 31 forks source link

Changeset, branch and commit history not being set #20

Closed oddgames-david closed 5 years ago

oddgames-david commented 5 years ago

I'm using blueocean and I've never been able to get commit history, changeset number or branch to show in either standard jenkins or blue ocean.

I'm using 'checkout scm' in a step and that works fine, and printing out the result of 'checkout scm' shows the plastic variables with the branch/changeset information

pipeline.txt

image

image

oddgames-david commented 5 years ago

I've tried with a declarative pipeline which doesn't need the 'checkout scm' step, but still doesn't give me changeset info.

declarative.txt

mig42 commented 5 years ago

Hi @oddgames-david !

Thanks for your feedback. Unfortunately, the current plugin version doesn't support displaying changes on Blue Ocean.

However, we're about to release plugin version 3.0 that will improve how Plastic SCM is configured in Jenkins jobs and how SCM info is displayed. This includes Blue Ocean: Plastic SCM pipelines will now display the list of changes (Plastic SCM changesets) under the "Changes" tab in the build page. Branch and Commit info won't be available at that point, but we intend to fix that in the following 3.0 releases.

This is how it will look like: Blue Ocean - Changes preview

We'll keep track of this issue!

oddgames-david commented 5 years ago

If anyone wants to use the changeset during building here's how we do it (we use the changeset to supply to our unity version before building)

script 
{
    env.CHANGESET = sh (

        script: "cm status --cset | grep -o -E '[0-9]+' | head -1 | sed -e 's/^0\\+//'",
        returnStdout: true,
        label: "Retrieving changeset id"
    )
}
mig42 commented 5 years ago

The environment variables aren't working for you? The checkout should set PLASTICSCM_CHANGESET_ID among others. See more here: https://wiki.jenkins.io/display/JENKINS/PlasticSCM+plugin#PlasticSCMPlugin-Environmentvariables

oddgames-david commented 5 years ago

The environment variables aren't working for you? The checkout should set PLASTICSCM_CHANGESET_ID among others. See more here: https://wiki.jenkins.io/display/JENKINS/PlasticSCM+plugin#PlasticSCMPlugin-Environmentvariables

That's working for me now, the older version wasn't giving me the correct changeset id.

mig42 commented 5 years ago

I'm glad to hear that, please let us know if you bump into any issues in the future.

Tommigun1980 commented 2 years ago

I am running the latest version of everything and don't get any of the PLASTICSCM_ environment variables injected into my declarative pipeline job.

A mere echo "${PLASTICSCM_CHANGESET_ID}" fails with 'groovy.lang.MissingPropertyException: No such property: PLASTICSCM_CHANGESET_ID for class: groovy.lang.Binding'. I am checking out the files via the 'cm' command in the first stage.

Thank you for any help.

mig42 commented 2 years ago

Hi @Tommigun1980,

Could you provide an example pipeline that reproduces your issue?

Thanks!