failed archiving ipa files jenkins - ios

I have a extrange problem,
when building the ios app with jenkins the ipa file is generated, and signed correctly but when I try to archive the ipa file it fails
the jenkins log says
Results at '/Users/Shared/Jenkins/Home/jobs/iosHelp/workspace/build/ipa/Verion.ipa'
[Debug-iphoneos] $ ditto -c -k --keepParent -rsrc /Users/Shared/Jenkins/Home/jobs/iosHelp/workspace/build/Debug-iphoneos/FormSlider.app.dSYM /Users/Shared/Jenkins/Home/jobs/iosHelp/workspace/build/ipa/Verion-dSYM.zip
Archiving artifacts
ERROR: No artifacts found that match the file pattern "/Users/Shared/Jenkins/Home/jobs/iosHelp/workspace/build/ipa/Verion.ipa". Configuration error?
ERROR: ‘/Users/Shared/Jenkins/Home/jobs/iosHelp/workspace/build/ipa/Verion.ipa’ doesn’t match anything: ‘’ exists but not ‘/Users/Shared/Jenkins/Home/jobs/iosHelp/workspace/build/ipa/Verion.ipa’
Build step 'Archive the artifacts' changed build result to FAILURE
Finished: FAILURE
clearly it states that jenkins couldn't find the ipa but in the statement before shows that the ipa was generated also using the terminal to go to the build/ipa directory I cheked that the file currently exists and is generated,
any help would be appreciated

What do you use in your "Archive Artifacts" configuration? It should be relative to $workspace, so in your case just build/ipa/Verion.ipa.
Make sure there are no extra quotes either

When you navigate to this job folder is there a file there? If you are using Ant blob syntax try adding a "*" at the end in case the file extension you wrote in is incorrect or instead of "build/ipa/Verion.ipa" use "build/ipa/Verion*" to try and locate the file, as #Slav mentioned use a path relative to the $workspace

Related

jenkins doesn't find path **/* when Archiving artifacts

i want to archive the artifacts in the path '**/*' but i'm getting the error:
‘**/*’ doesn’t match anything: ‘**’ exists but not ‘**/*’
under workspace i have a folder named 'build' and that folder contains the file that should be archived
from what i understand '**' should go to the build folder and the '*' should get the file
i tried use backslash('\') instead or **/. or **//* none of these worked, also when i try build/* it says build doesn't exist
console output:
Archiving artifacts
‘**/*’ doesn’t match anything: ‘**’ exists but not ‘**/*’
No artifacts found that match the file pattern "**/*". Configuration error?
update:
i found out that the workspace that it's trying to access isn't on the Jenkins server but on another server that the test is connecting using 'SSH site'.
how do i fix this?
assuming that you said the folder name under you project called build that you want all files under it to archive it use:
build/*.*

TFS build error: Web deployment task failed. Package file does not have a .zip file name extension

I am getting the following error when I am queuing a build in TFS 2017.
"Microsoft.Web.Publishing.targets 3009,5): Error : Web deployment task failed. (Package file 'C:\agent_work\3\s\TestApp\TestApp\release' does not have a .zip file name extension.)"
I am not sure why I am getting this error. I have hosted agent on the TFS server. I created the build definition according to this video:
www.youtube.com/watch?v=HjD4A-yeFTE
Does somebody have any idea? Appreciate your help!
Test at my side and everything works correctly.
Please try below items to narrow down the issue:
Please check the drop folder, if the .zip file actually being in the
place that you expected.
Try to specify the output path, eg:
/p:PackageLocation="$(build.artifactstagingdirectory)\\" , then
specify the Copy Root path as $(build.artifactstagingdirectory)
in Copy and Publish Build Artifacts task.
Explicitly specifying .zip extension in MSBuild Argument in the
Build Definition.
p:PackageLocation="$(BuildConfiguration)\package.zip
Check the build log, check if MSbuild works correctly. Also you can try the Msbuild command line locally to check if the .zip package can be generated.
Deploy a new agent on your Develop machine, create a new build
definition, then build with the new agent.
If still can not resolve the issue, just share the build logs here for further troubleshoot.

FirebaseCrash error TARGET_BUILD_DIR: Value missing

I'm trying to follow the steps listed here to upload dSYMs to Firebase.
I'm using Jenkins as a build server. This is my script:
GOOGLE_APP_ID=1:my:app:id
Pods/FirebaseCrash/upload-sym "/Path/To/Service_Account/file.json"
I'm getting this error:
Pods/FirebaseCrash/upload-sym:113: error: TARGET_BUILD_DIR: Value missing
How do I specify the target build directory?
As per Eric Shieh's comment, the reason why the script was not working in Jenkins' build script was that certain environment variables that Xcode supplies are missing when running through Jenkins.
So, I added a run script phase as the documentation suggests and then marked the "Run script only when installing" option.
This option will only run the script when archiving occurs.

Jenkins - failed: No test report files were found. Configuration error?

I'm beginner for "Jenkins" and following this tutorial.
At the Sixth step I got below error.
xcodebuild: error: Scheme JenkinsTest is not currently configured for the test action.
Build step 'Xcode' marked build as failure
Recording test results
ERROR: Step ‘Publish JUnit test result report’ failed: No test report files were found. Configuration error?
Finished: FAILURE
In the Test report XMLs I did set "test-reports/.*xml"
I tried to find my solution and also many questions are founded on SO like same issue I have too but did not get solution.
I have some confusion, Is .xml file automatically generated by "Jenkins" or First we manually need to add .xml file ?
In short guide me on right direction based on above error.
You can also enable the 'allowEmptyResults' option so that the junit plugin won't throw an exception when it doesn't find test results.
This way it doesn't matter if the 'test-results' directory exists.
junit allowEmptyResults: true, testResults: '**/test-results/*.xml'
First make sure junit.xml is getting generated after the test run.
Jenkins job at times cannot see past the current workspace. so it is always a good idea to copy the reports back to the current workspace before using it.
cd <path to report>
cp *.xml $WORKSPACE
Now the jenkins should pick-up the report.
Note: The config may show error first(since it cannot find the xml file in workspace) but after a build this should go away and also the result should get recorded
I'm using nosetest (python) to generate an xUnit compatible file and I was getting:
ERROR: No test report files were found. Configuration error?
I was using junit plugin as:
junit "test-results-unit.xml"
junit seems to add WORKSPACE directory by default so using the full PATH to the file wouldn't work either. I created symlink from the resulting file to the WORKSPACE directory to make it work:
sh 'ln -s tests/test-results-unit.xml $WORKSPACE'
junit "test-results-unit.xml"
Other answers suggest copying the files to the workspace directory, but for me simply changing the path to start with '**' seemed to solve the issue
junit '**/test-reports/*.xml'
The Jenkins junit plugin page says that you need to "specify the path to JUnit XML files in the Ant glob syntax". I've not dug into the full details of what this means, but starting the path with '**' was enough to get it working for me.
Thanks #Acid, it really helped me.
First, copy the module/build/test-results to workspace directory
cp -r app/build/test-results $WORKSPACE/test-results
And then I used this wildcard path
**/test-results/**/*.xml
I had the same problem and my test report file name got changed due to an upgrade in scala version,
Hence I have to change from,
junit '/myworkspace/target/myreport.xml'
to
junit '/myworkspace/target/TEST-myreport.xml'
How about:
junit allowEmptyResults: true, testResults: "${WORKSPACE}/test-results/*.xml"
or just:
junit "${WORKSPACE}/test-results/*.xml"
You have to find the path where your test reports are saved in your .jenkins workspace:
/Users/<USERNAME/>/.jenkins/workspace/<PROJECT/>/target/surefire-reports/*.xml
to find the folder type in your terminal:
.jenkins
then
open .

Bamboo will not create .IPA files using either xbuild or mdtool

I am trying to create an IPA file from Bamboo by doing this: Firstly I will checkout the default repository, then clone a devops repository, then have a nuget restore task. All of these tasks work perfectly fine but it is the Build for iOS task which is where I create my .IPA file is were I am having the problems. Firstly I am using a command task and the files are being build on a mac-agent(needed to create the .IPA file).
I have tried this two different ways, both ways have different outcomes but basically it is not what I expect to happen. The first way I tried was to use mdtool as the executable which worked like this:
-v build -t:build -p:CustomerApp.iOS *-c:Release|iPhone* CustomerApp.sln
This task will build but the .IPA file will not be created and the log file just says Build for iOS succeeded so I do not know what the problem is for that. The second way that I tried was to use xbuild as the executable which I did it like this:
xbuild /p:Configuration=AppStore /p:Platform=iPhone /p:BuildIpa=true /target:Build CustomerApp.sln
And also tried changing the /p:Configuration=AppStore to /p:Configuration=Release
But both of these responses will return the error
MSBUILD: error MSBUILD0004: Too many project files specified
Note that I know it says error MSBUILD0004 but I am not calling the error the xbuild executable is called with the path: /usr/local/bin/xbuild likewise the mdtool is being called successfully through the path: /Applications/Xamarin Studio.app/Conents/MacOS/mdtool and I have checked that the files exist through the terminal.
What is the reason that the mdtool and xbuild will not create the .IPA file? From what I have seen online it was mainly to do with applications that were not up to date but mine are as shown by the log here:
Already up-to-date.
MSBuild auto-detection: using msbuild version '4.0' from '/usr/local/Cellar/mono/4.6.2.7/lib/mono/4.5'.
All packages listed in packages.config are already installed.
Bamboo is creating a folder which is called MOB-CUSAPP9-JOB1. This is where I want to generate the IPA file from but using that still gives me the error above when using the xbuild way, inside the folder when it is generated it has a file called the CustomerApp.sln which I also tried but got the error as well. Inside the MOB-CUSAPP9-JOB1 files that get created are Mobile.Core.iOS and CustomerApp.iOS I have tried to use all of these and get the same error, I have even tried the whole directory to this but /users/dev/bamboo/etc/MOB-CUSAPP9-JOB1 but got the same result.
Here is an image of the folder that bamboo builds:

Resources