jetstack / tarmak

A toolkit for Kubernetes cluster provisioning and lifecycle management
Apache License 2.0
269 stars 49 forks source link

Add capability to orchestrate a running Jenkins installation #163

Open charlieegan3 opened 6 years ago

charlieegan3 commented 6 years ago

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
simonswine commented 6 years ago

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

charlieegan3 commented 6 years ago

/assign

charlieegan3 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

/unassign @charlieegan3