Stack Exchange Network

Stack Exchange network consists of 175 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

New answers tagged

0

Maybe cost is a factor? And it's open-source? I would think those two factors alone make it popular amongst startups. I work in an enterprise environment and we use AWS a lot but still use Jenkins as our main build tool. Sure there are better, more polished options, but like I said... cost and open-source, and also many people are used to it already.


0

If you use the Self-Organizing Swarm Plug-in to connect your build agents to your master, you can spin agents up/down without having to make any changes on your master. Agents will automatically register themselves with the master. You will have to supply credentials to the agents to self-register. I would suggest using SSM Parameter Store to store them and ...


1

Installing it as a tool allows Jenkins to manage the binary and ensure it's available for your build while also providing supporting pipeline syntax withEnv(). Having an agent with the binary allows you to shell out and run your commands using sh without withEnv(). It also allows you to decide where these binaries come from depending on your agent type (...


0

Some credential types cannot be bound directly in an environment section. From the docs : If you need to set credentials in a Pipeline for anything other than secret text, usernames and passwords, or secret files - i.e SSH keys or certificates, then use Jenkins' Snippet Generator feature, which you can access through Jenkins' classic UI. So the ...


0

The variable must be defined in a script section. pipeline { agent none stages { stage("first") { script { foo = "bar" } sh "echo ${foo}" } } }


0

apparently docker needs to be installed on jenkins master in order for jenkins to be able to launch the docker on the server. After installation of docker (even without the docker daemon running on jenkins master); jenkins was able to launch the docker on my-server.


0

While I don't know Bitbucket-specific solution, when it comes to triggering Jenkins builds, I prefer using a simple post-receive Git hook. In Jenkins select Trigger this build remotely (or something similar, it's usually the very first option in Build triggers section), then set up the post-recevie hook to something like: #!/bin/bash username=user token=...


0

I recommend using the Bitbucket Branch Source Plugin which gives much better control over push build triggers than the default Pipeline job type. The problem with your current setup is that the "branch to build" setting only configures the branch of the repository that Jenkins checks out, not necessarily which branches will trigger a build.


2

This seems to be the right idea: https://stackoverflow.com/questions/29328278/installing-jenkins-plugins-to-docker-jenkins/29328489#29328489 so in the Dockerfile you'd just use: COPY plugins.txt /usr/share/jenkins/plugins.txt RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/plugins.txt I tried it and it worked for me.


0

I figured it out. I was cloning directly into the workspace and then setting my environment variables to point to the workspace as well. I modified both those things. I now create a dir in my workspace and clone into it and I also set my environment variables to directories inside my workspace. Like so: node('build-01') { withEnv(["CMAKE_INSTALL_DIR=${...


0

I usually set the credential NAME into an environment variable environment { CERT = 'mycert' } Then I can use that name where ever I need it withCredentials([usernamePassword(credentialsId: "${env.CERT}", passwordVariable: 'CERT_PASSWORD', usernameVariable: 'CERT_USER')]) { // Do ...


0

There is a good practice called multistage build, in which you have one Dockerfile containing various image definitions that depend from one another, this helps you keep all your images updated with the latest changes and copy artifacts from one to another; this also helps reducing the image size if done right. A simple example is like the following: FROM ...


0

But storeing your password in a command is not the best way - it should be better to remove the password for this case - so you do not reveal your key password $ ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]


1

First you need to install sshpass. Ubuntu/Debian: apt-get install sshpass Fedora/CentOS: yum install sshpass Example: sshpass -p "YOUR_PASSWORD" ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SOME_SITE.COM Custom port example: sshpass -p "YOUR_PASSWORD" ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SOME_SITE.COM:2400 Notes: sshpass can also read a ...


0

We have moved onto using Jenkins templates and I have a workaround to keep the individual approver names list in one place. Sharing the sample code for your reference. #!/usr/bin/env groovy import com.mm.Constants def call(String teamName = 'LOGIN') { // team name of null means UI teamName = teamName ?: 'UI' timeout(time:2, unit:'DAYS') { ...


Top 50 recent answers are included