How to pass file to downstream job which blocks upstream job?

What I want to accomplish is to checkout code from develop branch, merge it to master branch, build app.war, run tests and if tests succeed push to master branch.

Tests should be run in separate job which needs app.war.

  • Create a git post-receive trigger (should work for Xamarin Studio on Mac OS X)
  • Select branch to build in Jenkins
  • Benefits of Continuous Integration workflow
  • Proper continuous integration and continuous deployment with Git and Heroku
  • Jenkins/Hudson - How to run multiple jobs in parallel more than 1 level deep?
  • Jenkins CI Pipeline Scripts not permitted to use method groovy.lang.GroovyObject
  • My current setup is as follows:

    1. Job Main checks out from develop, merges it to masterand builds app.war
    2. Job Main triggers job Test in Post build step (Test needs app.war previously built)
    3. If Test succeeds, Main pushes to master branch in Post build action

    I tried to use Copy Artifact Plugin but the problem is that with it, I can only archive artifact in Post build action while I am triggering Test in Post build step.

    How to pass app.war to Test job? Is it possible to do with Copy Artifact Plugin?

  • Git: Warn if file larger than a pre-defined size
  • when exactly does a git merge conflict arise
  • Setting up CI with TeamCity with Git & NAnt
  • How to handle a large git repository?
  • Symfony 1.4 best practice production & development configuration
  • How to shallow clone a single branch in git?
  • One Solution collect form web for “How to pass file to downstream job which blocks upstream job?”

    1. Copying artifacts

    You can put a wrapper job around it and have the Build job and the Test job called as build step by using Trigger/call builds on other projects. Since the build is encapsuled in its own job now, you can archive its artifacts and copy them over to the Test job.

    2. Share workspace

    Another way would be to just share a workspace between build and test.

    3. Pass file as parameter

    A neat way to pass a file to a downstream job is, to pass it as parameter with the help of the Parameterized Trigger Plugin.

    You push a file into your downstream job’s workspace simply by selecting the parameter factory For every matching file, invoke one build in a build step Trigger/call builds on other projects.
    There you specify the target file (wildcards allowed) and the name it should get in the child workspace.

    enter image description here

    Note: Your downstream job does not need to have the option This build is parameterized set, the file will be copied either way.

    Git Baby is a git and github fan, let's start git clone.