Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate native support for downstream builds #11

Closed
ghost opened this issue Jun 3, 2014 · 8 comments
Closed

Integrate native support for downstream builds #11

ghost opened this issue Jun 3, 2014 · 8 comments

Comments

@ghost
Copy link

ghost commented Jun 3, 2014

Currently the only way for DotCi to initiate a downstream build is inconvenient.
It involves remotely trigger via url by passing a bunch of build parameters ...

Use the following URL to trigger build remotely: 
JENKINS_URL/job/xxx/build?token=TOKEN_NAME or /buildWithParameters?token=TOKEN_NAME 
Optionally append &cause=Cause+Text to provide text that will be included in the recorded build cause.

It would be nice if there was a new DotCi syntax for initiating downstream build(s).
This would resolve cases where the code repository does not contain the deployment procedures, browser testing framework, etc.

build:
  [ before | run | after ]: 
    ...
    <% if( DOTCI_BRANCH =~ /deploy_request*/) { %>
    - downstream:
        deploy_foo:
           wait: true
           params:
             sha: $SHA
             branch: $DOTCI_BRANCH 
             repo: $GIT_URL
             environment: load_testing
        test_bar:
           wait: false
           params:
             environment: load_testing
             service: foo
    <% } %>
    ...  

I'm not sure how the syntax should be structured for sequential downstream builds versus parallel downstream builds.

Also since the above settings imply that not every branch would not invoke a downstream build.
Then its representation should only appear when viewing that build number job. It would be nice to if some downstream build status icon would also appear in the left side bar by that build number.

@tomdz
Copy link

tomdz commented Sep 8, 2014

Please also for upstream builds.

@tomdz
Copy link

tomdz commented Sep 8, 2014

This would be a very desirable feature for us. We have four repositories, let's call them A, B, C, D, that depend on each other in a chain (D -> C -> B -> A) via Maven dependencies. We would like a pull request in, say, project C to first build current master of A, then of B, then the pull request itself, and then current master of D. And we would like all of this to happen on the same node so we can leverage maven's local repository and don't have to push to a central server (where it could conflict with another build happening at the same time).

@ghost
Copy link
Author

ghost commented Nov 12, 2014

Current state is you can have a DotCi job call a non-DotCi job using https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Build

e.g.

  after:
  <% if( DOTCI_BRANCH =~ /^somebranch$/ ) { %>
    - curl --data-urlencode BRANCH=\$DOTCI_BRANCH --data param1=\$BUILD_NUMBER --data paramN=\$DOTCI_SHA_SHORT http://jenkins/job/someJob/buildWithParameters?token=someToken
  <% } %>

But you can't have the vice versa.
Where a non-DotCi trigger DotCi job passing some additional param because of #69

This request to have native support of downstream/upstream builds would have to also support the ability to handle additional parameters being passed.

@jeffbyrnes
Copy link

👍 for upstream/downstream build support.

@ghost ghost closed this as completed Aug 5, 2015
@ghost
Copy link
Author

ghost commented Aug 5, 2015

This feature is now available

plugins:
  - downstream_job:
      on_result: 'success'
      <org>/<repo>:
        BRANCH: "master"
        FQDN: "${FQDN}"

the only issue is FQDN needs to be a parameter in DotCi configuration for FQDN to be passable

@jeffbyrnes
Copy link

@vvitayau are there also upstream builds?

@suryagaddipati
Copy link
Contributor

@jeffbyrnes there are no upstream builds. I am not quite sure how that would work in practice .

How do you imagine that would work?

@jeffbyrnes
Copy link

@suryagaddipati I believe I was a bit mislead by one of my teammates on how our projects are built, and was lead to believe that building a project with upstream dependencies would first do a fresh build of said deps (i.e., an upstream build), before building itself.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants