OSDN Git Service

adds the Debian 9 (stretch) support. samba-grid-0.1.2
authorwhitestar <whitestar@gaea.test>
Sat, 1 Jul 2017 11:26:14 +0000 (20:26 +0900)
committerwhitestar <whitestar@gaea.test>
Sat, 1 Jul 2017 11:26:14 +0000 (20:26 +0900)
cookbooks/samba-grid/.rubocop.yml
cookbooks/samba-grid/CHANGELOG.md
cookbooks/samba-grid/Gemfile
cookbooks/samba-grid/README.md
cookbooks/samba-grid/Rakefile
cookbooks/samba-grid/concourse.yml [new file with mode: 0644]
cookbooks/samba-grid/fly-vars.yml [new file with mode: 0644]
cookbooks/samba-grid/metadata.rb
cookbooks/samba-grid/recipes/server.rb

index 385f1bb..ea75259 100644 (file)
@@ -25,7 +25,7 @@ Style/RescueModifier:
 Style/SpaceBeforeFirstArg:
   Enabled: false
 Style/TrailingCommaInLiteral:
-  EnforcedStyleForMultiline: comma
+  EnforcedStyleForMultiline: consistent_comma
 Style/WordArray:
   Enabled: false
   
index 0cfbb56..6304d16 100644 (file)
@@ -1,5 +1,10 @@
 # samba-grid CHANGELOG
 
+0.1.2
+-----
+- adds the Debian 9 (stretch) support.
+- adds the Concourse pipeline configuration.
+
 0.1.1
 -----
 - adds the `samba-grid::smbldap-tools` recipe.
index 907b097..ad84be7 100644 (file)
@@ -1,3 +1,4 @@
 source 'https://rubygems.org'
 
-#gem 'foodcritic'
+# with Chef DK
+gem 'stove'
index 5d59c95..9272d59 100644 (file)
@@ -179,7 +179,7 @@ override_attributes(
 - Author:: whitestar at osdn.jp
 
 ```text
-Copyright 2016, whitestar
+Copyright 2016-2017, whitestar
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
index 513cecc..64191a5 100644 (file)
@@ -1,10 +1,15 @@
 require 'rspec/core/rake_task'
 require 'rubocop/rake_task'
 require 'foodcritic'
+require 'stove/rake_task'
 
 namespace :style do
   desc 'Run Ruby style checks'
-  RuboCop::RakeTask.new(:ruby)
+  RuboCop::RakeTask.new(:ruby) do |t|
+    t.options = [
+      '--auto-gen-config',  # creates .rubocop_todo.yml
+    ]
+  end
 
   desc 'Run Chef style checks'
   FoodCritic::Rake::LintTask.new(:chef) do |t|
@@ -20,4 +25,17 @@ task style: ['style:chef', 'style:ruby']
 desc 'Run ChefSpec examples'
 RSpec::Core::RakeTask.new(:spec)
 
+desc 'Publish cookbook'
+Stove::RakeTask.new(:publish) do |t|
+  t.stove_opts = [
+    # `--username` and `--key` are set in ~/.stove typically.
+    #'--username', 'somebody',
+    #'--key', '~/chef/chef.io.example.com/somebody.pem',
+    #'--endpoint', 'https://supermarket.io.example.com/api/v1',  # default: supermarket.chef.io
+    #'--no-ssl-verify',
+    '--no-git',
+    '--log-level', 'info',
+  ]
+end
+
 task default: ['style', 'spec']
diff --git a/cookbooks/samba-grid/concourse.yml b/cookbooks/samba-grid/concourse.yml
new file mode 100644 (file)
index 0000000..7ca6a84
--- /dev/null
@@ -0,0 +1,56 @@
+---
+# $ fly -t target sp -p samba-grid-cookbook -c concourse.yml -l fly-vars.yml -l ~/credentials.yml
+resources:
+- name: src-git
+  type: git
+  source:
+    uri: git://git.osdn.net/gitroot/metasearch/grid-chef-repo.git
+    branch: master
+    paths:
+    - cookbooks/((cookbook-name))
+- name: chefdk-cache
+  type: docker-image
+  source:
+    repository: chef/chefdk
+    tag: ((chefdk-version))
+    # ((param)) style: fly >= 3.2.0
+    registry_mirror: https://((registry-mirror-domain))  # e.g. https://registry.docker.example.com:5000
+    ca_certs:
+    - domain: ((registry-mirror-domain))  # e.g. registry.docker.example.com:5000
+      cert: ((docker-reg-ca-cert))
+
+jobs:
+- name: build-cookbook
+  plan:
+  - get: src-git
+    trigger: true
+  - get: chefdk-cache
+  - task: ci-build
+    image: chefdk-cache
+    config:
+      platform: linux
+
+      #image_resource:
+      #  type: docker-image
+      #  source:
+      #    repository: chef/chefdk
+      #    tag: ((chefdk-version))
+          # NG, setting disable
+          #registry_mirror: https://((registry-mirror-domain))
+          #ca_certs:
+          #- domain: ((registry-mirror-domain))
+          #  cert: ((docker-reg-ca-cert))
+
+      inputs:
+      - name: src-git
+
+      run:
+        #dir: ./src-git/cookbooks/((cookbook-name))
+        #path: rake
+        path: /bin/bash
+        args:
+        - -c
+        - |
+          cd ./src-git/cookbooks/((cookbook-name))
+          bundle install
+          rake
diff --git a/cookbooks/samba-grid/fly-vars.yml b/cookbooks/samba-grid/fly-vars.yml
new file mode 100644 (file)
index 0000000..d3d14aa
--- /dev/null
@@ -0,0 +1,3 @@
+---
+cookbook-name: samba-grid
+chefdk-version: 0.17.17
index ec76dbb..7daeffa 100644 (file)
@@ -5,7 +5,7 @@ maintainer_email ''
 license          'Apache 2.0'
 description      'Installs/Configures Samba'
 long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version          '0.1.1'
+version          '0.1.2'
 source_url       'http://scm.osdn.jp/gitroot/metasearch/grid-chef-repo.git'
 issues_url       'https://osdn.jp/projects/metasearch/ticket'
 
index 0eb47ac..2ca1802 100644 (file)
@@ -2,7 +2,7 @@
 # Cookbook Name:: samba-grid
 # Recipe:: server
 #
-# Copyright 2016, whitestar
+# Copyright 2016-2017, whitestar
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -17,6 +17,9 @@
 # limitations under the License.
 #
 
+platform = node['platform']
+platform_version = node['platform_version']
+
 %w(
   samba
   smbclient
@@ -40,7 +43,7 @@ services = [
   'nmbd',
   'smbd',
 ]
-services.push('samba-ad-dc') if node['platform'] == 'debian'
+services.push('samba-ad-dc') if platform == 'debian' && platform_version < '9.0'
 #'samba-ad-dc',  # masked on latest Ubuntu.
 #'samba',        # masked on latest Debian and Ubuntu.
 
@@ -61,6 +64,6 @@ template '/etc/samba/smb.conf' do
   mode '0644'
   notifies :reload, 'service[nmbd]'
   notifies :reload, 'service[smbd]'
-  notifies :reload, 'service[samba-ad-dc]' if node['platform'] == 'debian'
+  notifies :reload, 'service[samba-ad-dc]' if platform == 'debian' && platform_version < '9.0'
   #notifies :reload, 'service[samba]'
 end