1

I have one repository on git which having two project (folders) Spring Boot,Angular 8 In different folders

So how can I differ a build configuration in Jenkins Eg angular having 'npm build' And spring having its own.

  • Possible duplicate of https://stackoverflow.com/questions/52372589/jenkins-pipeline-how-to-change-to-another-folder – Ahmed HENTETI Nov 27 '19 at 17:58
  • I'd suggest creating a Jenkinsfile for each project folder. In one Angular one you'd build it with npm like you said. In the spring folder the Jenkinsfile uses maven. So you'd basically have 2 Jenkinsfiles in total, one for each project. – J-me Nov 28 '19 at 07:54

1 Answers1

0

You can define multiple stages in your Jenkins pipeline:

node{
stage('Spring project'){
    dir('spring'){
        git branch: 'master', changelog: false, poll: false, url: '/url/git/repo'
        sh 'mvn clean install'
    }
}
stage('Angular project'){
    dir('Angular'){
        git branch: 'master', changelog: false, poll: false, url: '/url/git/repo'
        sh 'build command'
    }
  }
}
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250