jenkins attachments - what is the syntax?
Asked Answered
E

3

12

I'm trying to have Jenkins attach a file or set of files to the email notification that the job has completed. I keep getting an error along the lines of:

Sending email for trigger: Success ERROR: Error accessing files to attach: Expecting Ant GLOB pattern, but saw C:\p\p\etc\\\*\*\\\*.html.

See Fileset syntax

And yes I've looked at that site and tried every variation I could think of:

/ instead of \
../\*\*
../\*\*/\*.html
removing C:

What is the Ant GLOB pattern I'm missing here?

thanks, Scott

Encomiast answered 30/7, 2012 at 23:54 Comment(0)
P
16

The base directory for attachments is the workspace directory. Generally it means that you can't attach files that are higher in the directory hierarchy than the workspace (well, you can use ../, but you have to be very sure about your workspace location). A workaround to this kind of problems is to copy your files into the workspace first in a build step.

Pax answered 31/7, 2012 at 15:51 Comment(2)
I'm facing a same problem i need to attached the apk in target folder. how do i give a path to apk , is this correct (../trunk/target/myapp-1.0.0-SNAPSHOT.apk)Ashelman
../ wont work if you want to refer to a file in different job. I made it work by copying the artifact to the job workspace and then deleting it after the job is done.Openfaced
D
2

Read the issue was reported in https://issues.jenkins-ci.org/browse/JENKINS-23329. Maybe, Hockeyapp plugin or jenkins has been updated, so, files should be under WORKSPACE; don't need the $WORKSPACE in the path and only need add path/to/apk or path/to/ipa.

Hence, change:

C:\p\p\etc***.html'

to

**\*.html'

Durbin answered 25/7, 2014 at 8:35 Comment(0)
T
0

This might have occurred because of the attachment mentioned in the job (project) configuration is in the local directory

Check with attachment available in

"c:/users/username/.jenkins/workspace/Currentproject/"

Tenebrific answered 14/11, 2018 at 6:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.