jira-importer / jira-github-issues-cifs

0 stars 0 forks source link

[JENKINS-50989] The sourceFiles property is ignored. This causes an error when uses in combination of removePrefix #57

Open jira-importer opened 6 years ago

jira-importer commented 6 years ago

When I execute a publish to a CIFS share with the following command in the Jenkinsfile (in the root of the project in Subversion):

 

cifsPublisher(publishers: [[configName: 'Published_prerelease', transfers: [[cleanRemote: false, excludes: '', flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '', remoteDirectory: '$\{BUILD_TAG}/pls', remoteDirectorySDF: false, removePrefix: 'output/pls', sourceFiles: 'output/pls/'],

 [cleanRemote: false, excludes: '', flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '', remoteDirectory: '$\{BUILD_TAG}/src', remoteDirectorySDF: false, removePrefix: 'sources/progress', sourceFiles: 'sources/progress/bmp*/**'],

 [cleanRemote: false, excludes: '', flatten: true, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '', remoteDirectory: '$\{BUILD_TAG}/wrx', remoteDirectorySDF: false, removePrefix: 'sources/progress', sourceFiles: 'sources/progress/src*/**.wrx']],

usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false]])

 

Then I get the following error on execute:

 ERROR: Exception when publishing, exception message [Failed to remove prefix from file named [Jenkinsfile]. Prefix [output/pls/] must be present in all file paths]


Originally reported by bctrdw, imported from: The sourceFiles property is ignored. This causes an error when uses in combination of removePrefix
  • status: Open
  • priority: Major
  • resolution: Unresolved
  • imported: 2022/01/10
jira-importer commented 6 years ago

slide_o_mix:

I think your problem is the patternSeparator actually. Please remove that parameter. Also, you don't need the \ in front of the { in BUILD_TAG. the single quotes will stop groovy from replacing the value. I think you also need output/pls/** if you want all of the files. Please try those things.

jira-importer commented 6 years ago

bctrdw:

I have tested without the patternSeparator and now it works so this is the main cause of the trouble. This empty parameter was added by the snippet generator without being filled in the userinterface of Jenkins. So I will be careful to use the example that is being generated again without a good review.

Thanks

jira-importer commented 6 years ago

slide_o_mix:

I need to fix the @DataBoundConstructor so that it doesn't generate bad snippets. I'll do that in the next release.

jira-importer commented 6 years ago

it3xl:

Jenkins Freestyle jobs workaround: 

  1. Under "Send build artifacts to a windows share" click "Advanced".
  2. Insert the comma
    , 

    into the "Pattern separator" field.

(tested on Jenkins 2.138.2, Publish Over CIFS 0.11, Windows)

I'll say more. You can't even use Publish Over CIFS plugin without this workaround, at all. Even with the empty "Remove prefix" field.

jira-importer commented 6 years ago

slide_o_mix:

I believe I have a fix for this so that the "workaround" isn't needed, but I need to do more testing to be sure.

jira-importer commented 6 years ago

it3xl:

Alex Earl, contact me if you need any testing. I just updated my Jenkins and installed the plugin. Newer used it before.

jira-importer commented 6 years ago

slide_o_mix:

Ilya Tretyakov it3xl You can try the HPI file from here: https://ci.jenkins.io/job/Plugins/job/publish-over-cifs-plugin/job/master/lastSuccessfulBuild/artifact/target/publish-over-cifs.hpi

jira-importer commented 6 years ago

it3xl:

I've changed META-INF and WEB-INF by those from .hpi and have restarted my Jenkins.
I've removed the comma from the "Pattern separator" field.

CIFS: Connecting from host [myServer]
CIFS: Connecting with configuration [MyShare] ...
CIFS: Disconnecting configuration [MyShare] ...
ERROR: Exception when publishing, exception message [Failed to remove prefix from file named [a/b/c]. Prefix [a/d/e] must be present in all file paths]
Build step 'Send build artifacts to a windows share' changed build result to UNSTABLE
Finished: UNSTABLE
jira-importer commented 6 years ago

slide_o_mix:

You can install hpi files via the advanced option in the plugin manager

jira-importer commented 6 years ago

it3xl:

Ready. I got the same result for

About Publish Over CIFS 0.12-SNAPSHOT (private-blaBla-jenkins)
jira-importer commented 6 years ago

it3xl:

I got something interesting.
After all this manipulations I've went to my another job and added there "Send build artifacts to a windows share" again. And now the "Pattern separator" field isn't empty and contains

[, ]+

Everything is working now for

Publish Over CIFS 0.11