Category : jenkins-pipeline

I want to run the post part of my declarative pipeline inside a container which needs to execute on a kubernetes pod using a specific docker image. And I don’t know how to set the agent only for post. I’m executing a specific python script which sends an email in the post condition and to ..

Read more

I need to copy a Docker-compose file from my Jenkins workspace to a remote machine using ansible. This is what I have right now — – hosts: […].es tasks: – name: copy Docker Compose files copy: remote_src: ~/docker-compose.yml dest: ./opt/ydilo/ydilo-acalls/ – name: Run container become: True shell: cmd: "docker-compose up" chdir: ./opt/ydilo/ydilo-acalls/ It connects to ..

Read more

In our Jenkinsfile, we’re trying to tag the docker images with the branch name like so: pipeline { agent any stages { stage(‘Build’) { steps { script { def app = docker.build("my_private_server/myapp/myapp-${env.BRANCH_NAME}:${env.BUILD_ID}") withDockerRegistry(credentialsId: ‘my-credentials’, url: ‘https://my_private_server.example.com’) { app.push() } } } } } } We use JIRA, so our branches are named like this PROJ-2454-implement-login-box ..

Read more

Using Jenkins Blue Ocean with the docker plugin, we have this in the Jenkins configuration GUI: Yet many tutorials show to repeat the info in the Jenkinsfile agent { docker { image ‘registry.az1:5043/maven-proto’ registryUrl ‘https://registry.az1’ registryCredentialsId ‘credentials-id’ args ‘-v /var/jenkins_home/.m2:/root/.m2’ How do we use the "Docker registry URL" and "Registry credentials" from the GUI without ..

Read more

Using Jenkins Blue Ocean with the docker plugin, we have this in the Jenkins configuration GUI: Yet many tutorials show to repeat the info in the Jenkinsfile agent { docker { image ‘registry.az1:5043/maven-proto’ registryUrl ‘https://registry.az1’ registryCredentialsId ‘credentials-id’ args ‘-v /var/jenkins_home/.m2:/root/.m2’ How do we use the "Docker registry URL" and "Registry credentials" from the GUI without ..

Read more

I am trying to execute Cypress E2E Tests in Jenkins pipeline. To do that I am trying to build a Docker Image and then execute shell commands in it. This is the code from Dockerfile that I am using: FROM jenkins/ssh-agent:latest USER root RUN apt-get update RUN apt install -y wget libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev ..

Read more

If I run the Docker container like this on my local Mac terminal then it works fine. Here I’m passing an argument IAM Role ARN as arn:aws:iam::182402123491:role/jenkins:- docker run -d -e XDG_CACHE_HOME=/tmp/go/.cache test-image arn:aws:iam::182402123491:role/jenkins How can I pass the same argument when running this container as Jenkins build agent inside the Jenkinsfile? I tried below ..

Read more