0

I have very many small projects(~100) which I wish to use bamboo to build and deploy to nexus. Rather than creating 100+ build plans in bamboo is there a way for one build plan to monitor our single source repository(say git) detect changes in one of these projects(generally just one file), checkout this one file and run a generic script on this project?

If this is not possible is there a means of programmatically generating these build plans rather than using the bamboo gui

First Zero
  • 21,586
  • 6
  • 46
  • 45
jshe857
  • 63
  • 5

1 Answers1

0

One way is to use either or to run all your tests and upload the archives for you. Assuming your child programs are Foo, Bar

In - Example - http://www.gradle.org/docs/current/userguide/multi_project_builds.html

======== GRADLE

At the root define build.gradle which holds your dependencies, define settings.gradle and just have the following line

include 'Foo', 'Bar'

For your child projects - they can optionally have their own build.gradle scripts

======== MAVEN

In - Example - http://books.sonatype.com/mvnex-book/reference/multimodule.html

You declare a simple parent at the root and then define modules like so

<modules>
    <module>Foo</module>
    <module>Bar</module>
</modules>

For each of your program you define your pom and identify using <artifactId>Foo</artifactId>

First Zero
  • 21,586
  • 6
  • 46
  • 45
  • I'm more looking for some tool that will only publish those artifacts which have changed. So some script or program that gets information about which modules have changed from git/bamboo in this one repository and deploy those files with some generic deploy script – jshe857 Jan 31 '14 at 02:15
  • Aah in which case you will need to have separate script for each of the build which only runs when things have changed. Its difficult to just have 1 build which "knows" what has changed and only uploads that. Theoretically you can maybe run a `cksum` against all artifacts, check against a stored txt document and then upload, I am just going cross-eyed thinking about it :) – First Zero Jan 31 '14 at 02:30
  • Reading this doco: https://confluence.atlassian.com/display/BAMBOO/Repository+Triggers+the+Build+when+Changes+are+Committed makes me think that bamboo can and is passed information about repository changes and if it could somehow forward this information to a build script this could be possible – jshe857 Jan 31 '14 at 04:26
  • The way BAMBOO and other CIs work, is they put a post-receive hook on the code server. When you publish code to the CI server, all BAMBOO knows is a change has occurred and a build will be triggered. What has changed will not be known. Or the other other way is the CI server will poll the code server to find out if anything has changed in the last 5 mins, if something has changed a build will triggered, again the CI server will not know what has changed. – First Zero Jan 31 '14 at 06:56
  • If you are using git, then in the post-receive hook you can add get the old and new rev - cf http://stackoverflow.com/questions/3762084/git-empty-arguments-in-post-receive-hook , http://www.janosgyerik.com/deploying-new-releases-using-git-and-the-post-receive-hook/. You can then get a list of files changed `git diff --name-only $oldrev $newrev` and then your bash script can figure which module it is from and only upload that – First Zero Jan 31 '14 at 07:01