New answers tagged

0

The default behavior of Jenkins is to use the same node over and over unless it's unavailable. If you use labels you can target resources. Take a look at plugins like Least Load and Scoring Load Balancer to help distribute the load. CloudBees also provides an Even Scheduler plugin as a commercial offering. Kubernetes (e.g. Kubernetes Plugin) to schedule ...


1

A Scripted Pipeline is literally a Groovy script, so you can just use if/else conditionals like you would in a normal Groovy script. if (env.BRANCH_NAME == 'master') { // do steps here } else { // do other steps here }


0

I have sometimes used the pattern where all pipeline things go in a .pipeline/ directory of the app, including the Jenkinsfile. I would, in your case, add several pipelines (ie, Jenkinsfiles) - one per microservice as you propose, and one for the web app. Then, you define independent multibranch pipeline jobs, based on the location of the pipelines. In ...


0

Running Jenkins on EC2 is the better option. It's better to keep the functions that manage your containers separate from the containers themselves. I know this is different than Kubernetes, but this isn't Kubernetes. Build an ELK Stack on EC2 as well and send your build logs to that instance so you can go through them when troubleshooting. It sounds like ...


0

As implied by the links in comments, for better or for worse, this behavior is an unavoidable consequence of how Pipeline is designed. Pipeline configuration changes in your Jenkinsfile cannot be picked up by Jenkins without executing your Pipeline. This includes things such as adding parameters. My personal advice is to ensure that your Pipeline jobs are ...


0

You can use the Jenkins provided step dir() which changes the directory to one relative to the Jenkins env.WORKSPACE (/var/lib/jenkins/workspace/JOB_NAME by default). stage('Build') { steps { dir('path/to/dir') { // do stuff } dir('path/to/other/dir') { // do other stuff } } }


3

Use the Groovy trim() method. For instance, def myTrimmedParam = params.myParam.trim().


Top 50 recent answers are included