Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [jenkins-pipeline]

For questions specifically about Jenkins 2.0's pipeline architecture. This includes both declarative and scripted pipelines.

0
votes
1answer
23 views

packge.json not found while executing on Jenkins

My Dockerfile looks something like this. FROM mhart/alpine-node:8.11.3 RUN mkdir -p /app COPY ./ /app WORKDIR /app/build RUN yarn global add serve CMD ["serve", "-l", "3000"] EXPOSE 3000 And ...
0
votes
2answers
66 views

Jenkins pipeline pass upstream build number to downstream job using Pipeline script

How to pass upstream build number to downstream job in Pipeline job using (Trigger parameter build on other projects) ? Agenda: To pass upstream job build number to downstream job to download ...
1
vote
0answers
23 views

Pass Variable in pipeline script

I am trying to pass a variable input to "credentialsId: $creds" from SiteID but unable to. I tried multiple expressions in pipeline script with quotes etc and none worked. I am learning and need ...
3
votes
1answer
104 views

Jenkins Groovy to parse console output and mark build failure

What would be a Groovy or pipeline step to parse Jenkins console output, identify a string and mark the build as failure if the string is matched?
0
votes
0answers
12 views

trigger a build on a specific branch when a branch is deleted?

Using multibranch pipelines with webhooks. When I delete a branch my jenkins projects immediately update and prune the branch. This is great but could I trigger a build of master branch when another ...
0
votes
0answers
24 views

Jenkins Pipeline project can't when on branch

I want to use when on branch condition. The Jenkinsfile is like this stages{ stage('Checkout project branch master'){ steps{ withCredentials([...
0
votes
0answers
9 views

Jenkins VCS Plug in Snapshot

I have an issue where i make a snapshot of a slave VM after is completed the slave is connected but the workspace is not refreshed in the VM. pipeline{ agent none stages { stage('Pre-...
2
votes
1answer
154 views

Jenkins-Ansible: executing ansible playbook using jenkins pipeline script

We developed declarative pipeline code to execute an Ansible playbook. We tested the playbook from CLI and it is working properly. My playbook actually performs some shell commands on remote server. ...
1
vote
1answer
111 views

jenkins pipeline nested parallel

Jenkins pipeline, declarative. simple question, how do I create a parallel stages inside stage which is parallel by itself? pipeline { agent { label 'master' } options { timestamps() timeout(...
1
vote
1answer
89 views

Passing variables between scripts in a Jenkins pipeline

I have a declarative Jenkins pipeline that looks like the following: pipeline{ agent { ... } stages { stage("Provision EC2 Instance and Set ENV Variable"){ ...
3
votes
2answers
51 views

Jenkins Retrigger When build fails

I am using declarative pipeline syntax. I want to re trigger my build for 3 times if it fails. I want to add this step in my pipeline may be in post step: Something like below: post { ...
1
vote
1answer
43 views

Manage Docker images and their child images in a pipeline

I have various Jenkins agents images and I am trying to add automation to it. I have a base java image called agent-base and those who inherit from that one. Eg: agent-ansible, agent-terraform and so ...
0
votes
1answer
182 views

Parallel stages running on same agent in Jenkins declarative pipeline

I've been using a Jenkins pipeline with a parallel step for testing like this: pipeline { agent { label 'php' } stages { stage('build') { steps { ... ...
1
vote
1answer
30 views

Always execute post statement in a jenkins pipeline when a conditional statement is met

Although it seems counterintuitive, I would like to execute an always statement when a conditional is met. In my pipeline, my post statement should always destroy my AWS CloudFormation Stack if a ...
0
votes
2answers
67 views

Jenkins pipelines vs matrix vs multiple jobs for multiple branches across multiple platforms

I've never done any CI work before, so I'm struggling to decide how to set up Jenkins as my first project at my new job. From what I (sort of) understand: Jobs are the generic work unit Pipelines ...
0
votes
0answers
48 views

Best alternative to deploy/update docker using Jenkins for CI/CD

I'm running Jenkins as a docker image, and I'm looking for the optimal way to deploy new (or update existing) docker images (example staging and prod environment). I've founded this example : https://...
2
votes
1answer
655 views

Jenkins Pipeline “Build when a change is pushed to GitLab”

I have a Jenkins declarative pipeline that is ran via a webhook from GitLab whenever a change is pushed to my repo. In Jenkins, I have the following trigger option selected: Is there a way for me to ...
1
vote
1answer
137 views

Jenkins Pipeline GitLab API Credentials Management

I have a Jenkins pipeline that executes a build whenever a change is pushed to the appropriate branch. Jenkins uses an API token to authenticate with the GitLab server and checkout the repository. ...
3
votes
1answer
42 views

In Jenkins, how can parameters that contain spaces be referenced?

Google has failed to even lead me to a proper answer as to why spaces are permitted in names of Jenkins parameters, let alone how to reference them. Assuming it's not just a major oversight, how does ...
1
vote
1answer
209 views

Jenkins Pipeline Kubernetes Agent shared Volumes

I have a Jenkins Pipeline using Kubernetes Agent. I schedule multiple containers in my pod template. I recently wanted to add volumes that would be shared some of the containers and am having ...
2
votes
3answers
128 views

Jenkins UUIDs … oh the humanity

I have an environment block environment { SUITE_RUN_ID = UUID.randomUUID().toString() SMOKE_CMD = "runtests.sh SUITE_RUN_ID=${SUITE_RUN_ID}" FAILED_TESTS = "output_rerun_info.rb SUITE_RUN_ID=${...
3
votes
1answer
203 views

Jenkins Job vs Jenkins Pipeline

BACKGROUND : We have one Selenium automation project which is shared in BitBucket repository. Project is maven project. we have 10 testng.xml files for all modules OVERVIEW: Now we want to trigger ...
1
vote
1answer
108 views

Jenkins Pipeline job - remember previous values

I have a Jenkins Pipeline which uses Terraform and create a compute environment in GCP. There are like 5 questions in the build i.e. 1) GCP Project Name 2) Number of RHEL Servers 3) RHEL Server names ...
2
votes
1answer
178 views

Should I run CI on merge state or HEAD of branch in a PR?

I'm using Jenkins Pipeline with Github for our CI purposes and I'm trying to think what the strategy should be for what is checked out to run. Jenkins provides three options when discovering pull ...
5
votes
0answers
110 views

Force Jenkins to reschedule parallel pipeline step as soon as node goes offline

Exactly this. In our environment, we're using GCE preemptible nodes and the Jenkins GCE plugin. As a consequence of this, it's highly likely (even expected) that a node will go away during the course ...
0
votes
1answer
60 views

Jenkins “internal” pipeline script producing errors when running sh steps

I've been experimenting with creating a new pipeline, using the built-in pipeline editor (i.e. not from SCM). The strange bit is that, when I run any sh step, I receive the following error: sh: 1: ...
2
votes
1answer
1k views

Triggering specific pipeline builds for monorepos in Jenkins

I'm in the process of converting multiple repositories into a single repository, our CI tool of choice is Jenkins due to the conversion of multiple repository structures into a single one 2 main ...
1
vote
1answer
85 views

Trigger a job and get the job log on the same page in Jenkins

I would like to trigger the job in Jenkins and also get the log on the same page. E.g. Kind of IDE where we can run the code in one side and get the output on the other side. Are there any tools ...
0
votes
0answers
69 views

How to supress the error got from httpRequest in Jenkins pipeline

I have custom pipeline file in Jenkins and I am experiencing some kind of problem with httpRequest. I am making HTTP request to some external system just to notify about the build. This request is ...
3
votes
1answer
786 views

How not to break Jenkins Pipeline when adding new parameters (declarative pipeline)

An Issue I have been struggling with is whenever I add a new parameter to a Jenkins Pipeline, the next job will not correctly get this parameter. This is especially an issue if those parameters are ...
3
votes
0answers
87 views

How to properly automate CM based on log events?

Let's say I have a number of tools like Docker bench security, some static security scanners, etc. Now I have let's say free Ansible edition (no expenses are considered). I have lots of logs, but not ...
2
votes
1answer
528 views

How to test whether a variable exists in the declarative pipeline

I am using the Build User Vars Plugin which sets various variables in the pipeline. Here is what I am currently trying: wrap([$class: 'BuildUser']) { def safeBuildUser = binding.hasVariable('...
1
vote
2answers
881 views

Where should we keep application properties file while doing build promotion using Jenkins?

We are using spring boot to develop Java backend services. application.properties file has the database configurations. We are deploying in 4 different environments (dev, test, UAT, and production). ...
0
votes
0answers
58 views

A way to convert between bamboo and jenkins pipeline codes

Is there any format, and/or converter to move pipelines between these two CI systems?
0
votes
1answer
111 views

Issue with parametrized pipelines during deployment by seed job

I use "seed plugin" for automatic deployment pipeline changes into Jenkins. Most of my pipelines which are being deployed by seed plugin job have build parameters (parametrized jobs). When seed job ...
2
votes
1answer
1k views

Trigger downstream pipeline job via generated variable in upstream freestyle job

I have an upstream freestyle job and a downstream pipeline job. The freestyle job is triggered via a Bitbucket hook to run whenever code is pushed to Bitbucket. The freestyle job should capture ...
3
votes
2answers
2k views

Trigger jenkins pipeline job with Bitbucket hook

I'm missing something obvious here. Is there no way to trigger a Jenkins scripted pipeline job via Bitbucket hook? There's a bug out about it but it's been around for years with apparently no fix. ...
3
votes
1answer
2k views

Jenkins Pipeline - input only if branch matches

I want to ask for input but only if we are on a certain branch. But the input is run before the when. Can this be done with declarative syntax? For example this will always prompt even when the ...
1
vote
3answers
693 views

Jenkins declarative pipeline: use branch if it exist

I'm currently trying to atopt my declarative pipeline in the following way: I have multiple stages, some apply for all branches, some only for specific names. What I'm now searching for is a way to ...
0
votes
0answers
96 views

Is it possible to connect Jenkins Groovy Pipelines with Artifactory?

I have a Groovy Pipeline with Jenkins 2.32.1 I can read Pipeline definition from Pipeline script Pipeline script from SCM (Git, Mercurial or Subversion) Is there any method or plugin to read from ...
6
votes
3answers
579 views

Determine the URL for a SCM trigger from inside the build

My Jenkins is affected by a known Jenkins bug where it will trigger jobs that have an SCM poll set if a change to the shared library happens. I can't have this, so I thought I would get the trigger ...
3
votes
1answer
1k views

How can I push multiple containers, created with docker-compose, to a registry

I am using Jenkins pipeline and run a shell command to bring up my linked containers for testing. Once the testing is complete, I want to push the containers to a registry (I would prefer AWS ERC, but ...
0
votes
2answers
919 views

How to use Jenkins Pipeline and choose triggers for email notifications?

Before Pipeline, I used Email-ext plugin to define triggers for sending emails (on first failure, and when back to success). But in the Pipeline version, I can't control the triggers, I can only "...
0
votes
1answer
56 views

Jenkins, Jenkins SSH Plug-In, EC2, “ubuntu” user and “www-data”

I am trying to install Jenkins to achieve a Github -> EC2 instance folder pipeline. So far everything works well when I target an empty folder... however, when I target my production folder owned by ...
5
votes
1answer
5k views

sshagent and jenkinsfile

I am new to Jenkinsfile. I have previously configured my Jenkins job from GUI, and we are now upgrading our server to use Jenkinsfile. My job contains a section which needs to SSH to another server. ...
7
votes
2answers
692 views

Is there a way to run the Jenkinsfile from command line?

I don't want to use Jenkins UI, instead I would like to use the command line, from command line I want to execute Jenkinsfile to the Jenkins server. Is this possible? Let's say I have a Jenkinsfile, ...
1
vote
1answer
1k views

How set and get var with Path?

I write script for deploy files by ssh via Jenkins #!groovy node('superhost01'){ String HOSTNAME="host01" String USERNAME="tech_user" withEnv(['PATH=/data/jdbc_connector']) stage('...
0
votes
0answers
303 views

Jenkins Kubernetes Plugin - How to keep containers for n minutes in Declarative Pipeline

Currently trying agent { kubernetes { cloud 'jenkins-jenkins' label 'node' inheritFrom 'default' containerTemplate { idleMinutes '60' name 'node' ...
3
votes
1answer
1k views

Get changes of the parameterized pipeline on the fly in Jenkins

Is it possible to get changes of the parameterized pipeline on the fly after making changes there? For example I have a pipeline code: properties([ parameters([ string(name:...
4
votes
3answers
591 views

How to restore default Jenkins plugins?

I do a lot of testing in my Jenkins VM which I have on my local laptop. I found this time-consuming to remove Jenkins and installing again from scratch. It would be better if I have a simple way to ...