tarmak icon indicating copy to clipboard operation
tarmak copied to clipboard

Add capability to orchestrate a running Jenkins installation

Open charlieegan3 opened this issue 7 years ago • 6 comments

Is this a BUG REPORT or FEATURE REQUEST?:

/kind feature

What happened:

In the future, Tarmak will provision a Jenkins instance to the hub to manage the cluster lifecycle.

What you expected to happen:

Tarmak needs a means of controlling and configuring this Jenkins instance programmatically.

Anything else? Use this rakefile for reference: https://gitlab.jetstack.net/tarmak/terraform/blob/master/Rakefile#L20-251

It has the following functionality:

  def create_split_path(in_path)
  def create_job(job, opts={})
  def create_folder(folder)
  def create_ssh_credential(name, username, private_key)
  def create_file_credential(name, private_key)
  def install_plugins(*plugins)
  def safe_restart

charlieegan3 avatar Apr 10 '18 11:04 charlieegan3

It would be great if we could have a idempotent behaviour of that API

simonswine avatar Apr 10 '18 12:04 simonswine

/assign

charlieegan3 avatar Apr 10 '18 18:04 charlieegan3

I've made some minor progress with this yesterday.

I've created forks of the gojenkins and terraform-provider-jenkins and have made some changes that represent the start of some integration tests. https://github.com/charlieegan3/terraform-provider-jenkins/commit/c5040b2a41551b9ca2b14491e1f6ee01f92dae26

Both libraries need extending so I'm using my own forks of them for now.

charlieegan3 avatar Apr 12 '18 08:04 charlieegan3

This morning I've made the "integration test suite" a little more usable.

https://github.com/charlieegan3/terraform-provider-jenkins/blob/master/test/test_integration.sh

This script runs through each of the directories in the test directory and applies the terraform config defined in each. The first creates a job, second updates it, third deletes it.

So jobs are, dare I say it, working in the Terraform provider.

I think I'm going to work on Folders next. It looks like gojenkins has a starting point here: https://github.com/bndr/gojenkins/blob/master/folder.go but can't do deletes. So I suspect that's what I'll be doing next with this.

charlieegan3 avatar Apr 12 '18 12:04 charlieegan3

I've added folder.Delete to my fork of gojenkins - planning to build this into a Terraform resource definition when I next work on this.

charlieegan3 avatar Apr 13 '18 08:04 charlieegan3

/unassign @charlieegan3

charlieegan3 avatar Apr 16 '19 16:04 charlieegan3