Jump to content

Jenkins PlasticSCM compatibility with Pipelines (workflows)


Misieq

Recommended Posts

Hi Codice team

 

Do you plan to support in PlasticSCM Jenkins plugin Pipelines workflow?

It looks that with current version of plugin (2.5) checkout procces hangs if I add PlasticSCM as checkout step in workflow.

 

Jenkins 2.x looks to promote workflow approach, so it would be really great to have it supported also by Plastic.

I have feeling that it's not very high effort.

 

I have found following information about "adjusting" SCM plugins to work with workflow:

https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md

https://github.com/jenkinsci/pipeline-plugin/blob/master/DEVGUIDE.md (SCM chapter)

https://github.com/jenkinsci/workflow-scm-step-plugin/blob/master/README.md (Generic SCM chapter)

Regards

PS. I know that possible workaround would be to use GitServer feature. But for that moment it is not available for me :)

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 8 months later...
  • 3 months later...

Hello

Recently we have started to use Jenkins Pipelines in more excesive way.

I have currently two observations regarding PlasticSCM:
1) If Pipeline script is taken from repository (e.g. Jenkinsfile) than workspace always gots delated and re-created (probably because at first Jenkins is recreating workspace to "script" folder - to checkout Jenkinsfile and later on back to regular one)

2) It is possible to configure Pipeline to checkout Jenkins file from PlasticSCM repository (PlasticSCM appears on dropdown list). However when job is already configured and you want to reconfigure it only Git and Subversion are seen at job configuration page (current configuration with PlasticSCM is not displayed but is preserved if you do not press Save/Apply).

 

Link to comment
Share on other sites

  • 4 months later...
  • 2 months later...

Hi,

we are successfully using Jenkins directly against Plastic Cloud (no GitServer intermediary involved). We are running into the same problem that @Misieq has reported:

Quote

2) It is possible to configure Pipeline to checkout Jenkins file from PlasticSCM repository (PlasticSCM appears on dropdown list). However when job is already configured and you want to reconfigure it only Git and Subversion are seen at job configuration page (current configuration with PlasticSCM is not displayed but is preserved if you do not press Save/Apply).

This bug is logged in Jenkins' issue database since some time back.

Now it sounds as though this is something which Codice software is aware of, and has fixed, according to release notes for 7.0.16.1902:

Quote

 

Jenkins plugin: There was an issue configuring existing pipeline projects. The PlasticSCM entry didn't appear in the SCM dropdown list if the pipeline was set to get the script from SCM. Fixed.

However, I have upgraded to Plastic SCM 7.0.16.1912 on my Jenkins master, and the problem remains. Same symptoms as in the Jenkins JIRA ticket.

(I think it is odd that the latest Ubuntu package is version 7.0.16.1912, when the latest readme on the Plastic site is for 7.0.16.1902. Not sure if that has any implication.)

If someone from Codice software is interested in doing more troubleshooting, feel free to reach out to me.

 

Link to comment
Share on other sites

  • 2 months later...

Another question related to pipeline usage.

I'm trying to add a log of changes (currentBuild.changeSets) to an email.

Unfortunately, when using the pipeline, I can get only the "auther" and the "msg" properties from changeSets object.

 

When using the Ext-email plugin with freestyle project I define the email Content as follows: 

$PROJECT_DEFAULT_CONTENT${CHANGES_SINCE_LAST_SUCCESS, format="Changes from build %n:\n%c"}

and the log of changes is included in the mail. 

 

Any idea how to get more details (cs, date, repo-name, ...)  as appear in the /jenkins/job/<job name>/builds/<xx>/changeLog0.xml file generated by the plugin 

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

I'm testing the Lightweight checkout feature. I have created a new Pipeline project (it is more or less a duplicate of an existing project) with "Pipeline from SCM". When I try to build with Lightweight checkout off, it works, but with Lightweight checkout on, I get the following error messages in the Jenkins log:

/var/lib/jenkins$ tail -n 12 /var/log/jenkins/jenkins.log

Apr 20, 2018 8:24:29 PM com.codicesoftware.plugins.hudson.PlasticTool execute
WARNING: The cm command 'checkselectorsyntax' failed. Retrying after 500 ms... (1)
Apr 20, 2018 8:24:30 PM com.codicesoftware.plugins.hudson.PlasticTool execute
WARNING: The cm command 'checkselectorsyntax' failed. Retrying after 500 ms... (2)
Apr 20, 2018 8:24:31 PM com.codicesoftware.plugins.hudson.PlasticTool execute
WARNING: The cm command 'checkselectorsyntax' failed. Retrying after 500 ms... (3)
Apr 20, 2018 8:24:31 PM com.codicesoftware.plugins.jenkins.PlasticSCMFile getRepObjectSpecFromSelector
SEVERE: null
Apr 20, 2018 8:24:31 PM org.jenkinsci.plugins.workflow.job.WorkflowRun finish
INFO: Tests/TestLightWeightCheckout #4 completed: FAILURE
Apr 20, 2018 8:24:31 PM org.jenkinsci.plugins.workflow.flow.FlowExecutionList unregister
WARNING: Owner[Tests/TestLightWeightCheckout/4:Tests/TestLightWeightCheckout #4] was not in the list to begin with: []

The Plastic SCM plugin then throws this error: https://github.com/jenkinsci/plasticscm-plugin/blob/931952b1b7903dc3fce22bc7cb392317d90e8e2d/src/main/java/com/codicesoftware/plugins/jenkins/PlasticSCMFile.java#L111

And the 'cm' version:

/var/lib/jenkins$ cm version
7.0.16.2143

Now, I don't know how to intercept and capture the exact CM command and its result. Enabling debugging at level 'debug' for cm.exe according to the article only gives me these corresponding messages for one of those 'cm checkselectorsyntax' invocations:

2018-04-20 20:35:00,772 INFO  1 cm - STARTING CLIENT
2018-04-20 20:35:00,971 DEBUG 1 ClientConfig - Time l2018-04-20 20:35:01,046 DEBUG 1 ClientConfig - Time loading client.conf (/var/lib/jenkins/.plastic4/client.conf) 238 ms
2018-04-20 20:35:01,086 DEBUG 1 cm - IsOutputRedirected: [Redirected]

 

Here is what the configuration looks like in the Jenkins project configuration page:

Selector:
repository "PongSP@<organization>@Cloud"
  path "/"
    smartbranch "/main"

Use update:
yes
  
Workspace name:
PongSP

Script Path:
PongSP/Jenkinsfile.Windows

 

OS version:

/var/lib/jenkins$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial

 

Link to comment
Share on other sites

This may or may not be relevant:

Some source code comparison yields that in the Plastic SCM plugin, the older code in Workspaces.java uses the Hudson API function FilePath.createTextTempFile(). It places files in locations like "/var/lib/jenkins/workspace/Tests/TestLightWeightCheckout@script/PongSP/selector7941601814195684624.txt". However the newer code in PlasticSCMFile.java uses the native Java API function File.createTempFile() which will place files in the system's default temp folder.

There might be permissions problems with accessing the system-default temp folder when Jenkins runs things. In any case, it would be cleaner if the PlasticSCMFile code also kept its temp files in the Jenkins-designated temp file area.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...