简体   繁体   中英

Lerna and Jenkins build strategy

first of all sorry if this is the wrong place for the question!

A team I work with have recently adopted lerna as a tool to manage multiple javascript / node packages in one repository. However we are struggling to identify a good way to build these multiple packages with Jenkins. When we push code to the remote (git) a webhook is triggered that causes Jenkins to start building code (typical process). This triggers the job for all of the packages in the repository even if only one package has been changed.

Our current thoughts are man in the middle the webhook and based on calling GitHub API choose what packages to build or find something in Jenkins that lets us do path based checkouts (struggling with this).

I've had a good search and haven't really been able to find anything that works yet. Any advice would be massively appreciated.

It is possible in Jenkins to conditionally run a step when a changeset contains one or more files matching a given pattern (documentation)

Eg,

stage('build project') {
  when { changeset "packages/project-a/**/*" }

  steps {
    echo "Project A changed..."
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM