-
Notifications
You must be signed in to change notification settings - Fork 175
Add support for multi module/project built applications #109
Comments
Let's take an example of 3 repos.
In Jenkins we would have the following seed job // a single seed job (generates other jobs)
REPOS = 'http://github.com/foo/multi-projects.git$foo,http://github.com/foo/multi-projects.git$bar,http://github.com/foo/multi-module.git$baz,http://github.com/foo/a-very-stupid-name.git$greeting' The value after We will then assert if the folder called e.g. If there's no such folder then we assume that the root folder is SINGLE REPOA single pipeline for a repo E.g. TODO: consider being less strict and check if The location of the pipeline descriptor: Pseudo code# build everything
PROJECT_ROOT="."
cd ${PROJECT_ROOT}
./mvnw clean install
# upload the artifact from the root
./mvnw clean deploy
# deploy using sc pipelines from root project
useScPipelinesFromRootFolder MULTI-MODULEA single pipeline for a repo E.g. TODO: consider being less strict and check if In the build:
coordinates: impl:core:foo:bar
# force that the coordinates are the same as folders
# impl/core/foo/bar The location of the pipeline descriptor: Pseudo code# build everything
# retrieve group id from the root module `/pom.xml`
# retrieve artifact id from the child module `impl/core/foo/bar/pom.xml`
PROJECT_ROOT="."
cd ${PROJECT_ROOT}
./mvnw clean install
# upload only the artifact from my specific module
moduleCoordinate="impl:core:foo:bar" #parsed from sc-pipelines
./mvnw clean deploy
# deploy using sc-pipelines from root project
useScPipelinesFromRootFolder MULTI-PROJECT (LEGACY)One pipeline for each sub project (in case we can reuse credentials we will have 1 seed job) IMPORTANT the presented approach in this section is an antipattern and shouldn't be used in your projects. It's here since it's treated as a legacy system to be refactored. E.g. Pseudo codefoo pipeline # move to the folder with your application
PROJECT_ROOT="foo"
cd ${PROJECT_ROOT}
# build everything
./mvnw clean install
# upload only the artifact
./mvnw clean deploy
# deploy
useScPipelinesFromRootFolder bar pipeline # build everything
PROJECT_ROOT="bar"
cd ${PROJECT_ROOT}
./mvnw clean install
# upload only the artifact from my specific module
./mvnw clean deploy
# deploy
useScPipelinesFromRootFolder The location of the pipeline descriptor: SC-Pipelines structureIn order to provide information about which module builds the fat jar, we will verify the Breaking changes
|
Looks like you've put a lot of thought into this... I don't see any issues with this approach. 👍 |
When a project is comprised of multiple Maven modules or Gradle subprojects, then I want a way to tell sc-pipelines which artifact of these is the deployable. I've already configured github-analytics as a multi subproject Gradle build here. I plan to do the same for github-webhook. Currently, when
./gradlew artifactId -q | tail -1
is called from the root of the project it returns the artifactId of the last subproject in the list. However, if I explicitly call./gradlew :api:artifactId
or./gradlew -p api artifactId
then I get the result I expect. So this may just be as simple as passing in another parameter toretrieveAppName
function with an optional subproject/module name.The text was updated successfully, but these errors were encountered: