name 'jenkins'
description 'Jenkins'

run_list(
  'role[docker]',
  'recipe[jenkins-grid::docker-compose]',
)

#env_run_lists()

#default_attributes()

override_attributes(
  'jenkins-grid' => {
    #'with_ssl_cert_cookbook' => false,
    #'ssl_cert' => {
    #  'common_name' => 'jenkins.io.example.com',
    #},
    'docker-compose' => {
      'config' => {
        # Version 2 docker-compose format
        'version' => '2',
        'services' => {
          'jenkins' => {
            'restart' => 'always',
            'image' => 'jenkins:2.19.4',
            'ports' => [
              '8080:8080',
              '50000:50000',
            ],
            #'environment' => {
            #},
            #'volumes' => [
            #  "#{node['jenkins-grid']['docker-compose']['jenkins_home']['path']}:/var/jenkins_home",
            #],
          },
        },
      },
    },
  },
  'ssl_cert' => {
    'ca_names' => [
      'grid_ca',
    ],
    'common_names' => [
      'jenkins.io.example.com',
    ],
  }
)
