Jenkins copy artifacts from another project - jenkins

I moved a job that does an update function from one project to another. Under the configure option i used the copy artifacts from another project and updated the tab with the project name from which project it needs to pull files from and hit save. When i run build on the job, it does not pull the files that it needs to from the intended project and the build fails. Am i missing anything on this?

Related

TFS - How to set build definition to build on workspace changes, but NOT download files to workspace?

I have our Solution on CI build. That works.
When dev's check in changes, the solution builds, but only for changes to that solution.
How do I get the build definition to build on changes to OTHER folder changes outside of the solution?
Yes, I can add a workspace in the workspace sources tab. But that means all that code is downloaded on every build.
Our solution has over a dozen dependencies. I would like to trigger a build if any of those dependencies change. We don't need the dependency source code to download into the build workspace at all. That's just pointless.
Yes, we have a folder in TFS for our Nuget Packages. We check them in automatically on build (Thank you TFS).
I could just add the NugetPackage workspace to the solution's workspace list, BUT that would result in every version of every dependency getting downloaded into the build workspace.
How can I trigger a build on a change that I do NOT list in the workspaces list of the build definition?
Btw, we are using TFS 2012
I was hoping the Cloaking feature would allow for this, but if it's cloaked, the automated build does not trigger. The automated build only fires if the workspace folder is set to active. Which also means download every NugetPackage in that same folder!
It's not able to trigger a CI build on a change which not list in the workspaces list of the build definition.
A few other things to know
Make sure the folders you include in your trigger are also included in your mappings on the Repository tab(the same to
workspace mappings).
Source Link
As a workaround you could set clean workspace to false, which will not get other unchanged files every time.
If your build process does not require a clean workspace or
repository, you can significantly reduce the time that is required to
run the build setting this parameter value to False.

Renaming a Jenkins Job

I have renamed a Jenkins Job from the Jenkins GUI. I changed the Project name in the Configure menu and hitting Save afterwards.
However the workspace name for this Jenkins job has not been changed. What I am finding is upon the job execution a new workspace is getting created with this given new name and none of the contents of the old workspace is getting copied.
So the issue is contents of the old workspace is not copied to the new workspace.
What should I do instead?
I know there are several questions in SO in this area. However those do not answer my question.
Renaming job in jenkins/hudson
Rename a job in Jenkins
So please check this before marking this question as a duplicate.
I was able to workaround this is issue using the Use custom workspace option.
To change this location, I need to choose configure job and click on the Advanced button in the Advanced Project Options section.
After opening the settings, you will find some more configuration options for your job. Look for the Use custom workspace option on the right hand side and check the box.
Reference: Jenkins: Change Workspaces and Build Directory Locations
Workspaces are volatile by nature and may reside on a build node which has gone offline, therefore your build job should not rely on files being present in the workspace. However sometimes you will benefit from a speed-up by reusing unchanged files existing in workspace and decide not to clean them.
When you start a build, a new workspace is (as you noted) created, this is the correct behaviour, you should not need to store files in your workspace between builds but set up your system to load all sources from your vcs. This way you will always be able to make a fresh build from source, there are also a few options available to clear the workspace from old files.
If you do not want to populate the workspace from a source code addon you can always use the custom shell script feature to run a few shell commands to copy the needed files.

Load dependencies in Jenkins

I am using Jenkins for building a few Java projects. I've come across a puzzle that I can't quite figure out: I have two projects, Project A and Project B. Project B depends on having A as a library. I don't want to build A before B. I want B to find the latest, promoted Project A.jar and copy it to a folder in the Project B workspace. What's the best way to go about this?
You can configure Jenkins to add a post build step to archive artifacts (your JAR file in this case)
Then use the copy artifact plugin in your second project to fetch the artifact https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin

Jenkins: Testing on every commit AND releasing on click with the same project

1) I want to run my testsuite on every commit, so Jenkins should poll SVN, make an update and run the tests. That's possible without problems, BUT...
2) I also want to be able to create builds, which additionally covers creating zip archives and transferring them via scp to a remote server.
How is this possible within the same project?
Have you checked Jenkins SCP Plugin? You can add an aditional build step in the existing project itself which creates your builds, generates zip archives etc. And at last as a post build action publish the artifacts to a SCP repository. Will that help?

Adding files via the build server to TFS in a deployment area which is in another location on TFS

I have an application which compiles and runs all okay on our TFS build server.
Now I need to place the files in a deployment area in TFS, as part of the build process on our build server, which is not a workspace that is being used by the build.
I have tried using MSBuild.ExtensionPack.VisualStudio.TfsSource and the Working Directory but this does not work and I need an alternative
We've done something similar by adding an msbuild proj to our source control and then after building our solution, we build this proj which then calls a copy task which moves some files to another folder. Think you can do something similar by editing the default template too (which we didn't want to do)

Resources