1

My current project consists of three repositories. There is a Java (Spring Boot) application and two Angular web clients.

At the moment I am running a deploy.sh script which clones each repository and then deploys the whole thing.

# Clone all projects
git clone ..
git clone ..
git clone ..

# Build (there is a pom.xml which depends on the cloned projects)
mvn clean package

# Deploy
heroku deploy:jar server/target/server-*.jar --app $HEROKU_APP -v

Not very nice, I know.

So, I'd like to switch to a CI-pipeline and I think travis-ci or gitlab-ci might be some good choices.

My problem is: At this point I don't know how (or if) I can build the whole thing if there is an update on any the master branches.

Maybe it is possible to configure the pipeline in such a way that it simply tracks each repository or maybe it's possible to accomplish this using git submodules.

How can I approach this?

Stefan Falk
  • 23,898
  • 50
  • 191
  • 378

1 Answers1

0

If you need all of the projects to be built and deployed together, you have a big old monolith. In this case, I advise you to use a single repository for all projects and have a single pipeline. This way you wouldn't need to clone anything.

However, if the java app and the angular clients are microservices that can be built and deployed independently, place them in separate repositories and create a pipeline for each one of them. Try not to couple the release process (pipelines) of the different services because you will regret it later. Each service should be built, tested and deployed separately.

If you decide to have a multi-repo monolith (please don't) you can look into Gitlab CI Multi-project Pipelines

Example workflow:

Repo 1 (Java), Repo 2 (Angular 1), Repo 3 (Angular 2)

Repo 1: On push to master, clones Repo 2 and Repo 3, builds, tests, deploys.

Repo 2: On push to master, triggers the Repo 1 pipeline.

Repo 3: On push to master, triggers the Repo 1 pipeline.

cecunami
  • 957
  • 5
  • 12