So far git submodules are working for centralized code that repeats in use across repos and even organizations, and doesn’t change much. But one thing I run into constantly is where the code is for a repo I’ve just cloned that has a submodule, and even new repos as we re-architect some of our builds….
Continue ReadingGitHub
Ship Inside of a Bottle, Repeat
…in other words, DevOps. Github sends a notifyCommit message to Jenkins. That message passes through the Jenkins git plugin, which triggers a job if (1) there is a job configured with a git url matching the notifyCommit git url, and (2) there is a change to the code. If the job does not already exist…
Continue ReadingOrion – Default Values in Ansible Plays
I wanted modular code – edit in one place, use in many. I started trying out git submodules. They were cool, but static. Changing code bases would be a pain to keep track of and manipulate. But the separation of ansible role and builds. allows us to immediately reuse code. I’m building a single instance…
Continue ReadingJenkins 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 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 ReadingCreating a duplicate GitHub org (script)
I had an existing GitHub organization. It had working code on it, but I needed to duplicate the repos on a separate organization, not through forking off or any connection to the first organization. bash it is… #! /bin/bash # arg is list file # directory to work in DIR=”/Users/dsm/construct” # GitHub server address…
Continue Reading