Ansible’s system module restarts the jenkins service. If you call this to restart during the install process or during the boot process you cause Jenkins to be unavailable. At one point (because of errant Nessus scan configs) the instances at boot were so loaded that the restart could take 4+ minutes. This caused a cascading…
Continue ReadingCICD
Jenkins Shared Global Library
Github sends the full branch and committed information with the notifyCommit it sends to Jenkins. Jenkins passes just the repo url through to the git plugin. The plugin then does calculations to find the correct commit id to build. If Jenkins has state, and has built this job in the past, and there’s a commit…
Continue ReadingStateless Jenkins and “checkout scm” Behavior
When you manage to make Jenkins stateless, it exposes internal assumptions throughout Jenkins, all assuming there is a past, a history, a state. In Jenkins pipeline jobs the basic checkout statement is “checkout scm”. This in my experience does the right thing consistently, on a Jenkins controller that has been up for awhile and has…
Continue ReadingAgent Verify Itself Before Reporting “READY”
As part of building a Jenkins agent AMI in Amazon Web Services, the last plays strip any private keys or authentication tokens off the image. Once it is saved and at rest, no secrets are stored on the image. At boot I have extensive scripting that pulls in the secrets and places them, verifies and…
Continue ReadingPulling in Ansible Variables Explicitly
…, or Templating GitHub Branch Source Org config.xml I created a yaml file ghe_config.yml to provide the values for a jinja template which created the GitHub Branch Source Organization config.xml for a Github organization on Jenkins. These were brought together by an ansible play that explicitly pulled in the ghe_config.yml values and then pushes those…
Continue Reading…Rethinking git submodule
I constructed five of our jenkins agent AMI builds into an ansible_role-jenkins-[function]-agent piece, and then an aggregation jenkins pipeline build repo. The idea is – code from the role(s) are layered in the jenkins pipeline build repo. For example the base agent build (all the basic stuff we want on all of our agent AMIs)…
Continue Readinggit submodule…
ADD SUBMODULE in the directory in which you want the repo to be linked into, run git submodule add to remove or update at present using these commands you will get the default branch HEAD commit —- RESET OR DELETE edit .gitmudules and remove the entry edit .git/config and remove the submodule entry run git…
Continue ReadingTroubleshoot Hashicorp packer AWS Instance Directly
I use GitHub to send a notifyCommit to Jenkins to kick off a pipeline job that spins up packer, calling ansible as a provisioner (along with some preliminary shell) to configure and install, which then tests (ansible properly formatted cover unit testing) integration using a temporary cloud formation using Hashicorp consul service discovery and a…
Continue ReadingJenkins | Seems Like You Really Need SCM Polling
I tested notifyCommit messages sent to the git plugin in Jenkins – what happens when you commit several different branches in the same repo and rely on the git plugin to catch and schedule. The results were – odd. Some branches committed never made it. The limit for certainty seems to be the first commit,…
Continue ReadingnotifyCommit messages to Same Repo
I started off from scratch with our CicdDiscover Jenkins plugin. I created and kicked off a job in Jenkins by committing to branch “test-cicddiscover-branch”. This as expected created the job. It then started building – not the test-cicddiscover-branch change, but an earlier change to origin/rc. I went ahead and committed another two changes, to branch…
Continue Reading