OSDN Git Service

adds the Concourse pipeline configuration.
authorwhitestar <whitestar@gaea.test>
Sun, 25 Jun 2017 07:02:17 +0000 (16:02 +0900)
committerwhitestar <whitestar@gaea.test>
Sun, 25 Jun 2017 07:02:17 +0000 (16:02 +0900)
cookbooks/chef_utils/Gemfile
cookbooks/chef_utils/Rakefile
cookbooks/chef_utils/concourse.yml [new file with mode: 0644]
cookbooks/chef_utils/fly-vars.yml [new file with mode: 0644]

index 907b097..ad84be7 100644 (file)
@@ -1,3 +1,4 @@
 source 'https://rubygems.org'
 
-#gem 'foodcritic'
+# with Chef DK
+gem 'stove'
index 513cecc..d60d1e4 100644 (file)
@@ -1,6 +1,7 @@
 require 'rspec/core/rake_task'
 require 'rubocop/rake_task'
 require 'foodcritic'
+require 'stove/rake_task'
 
 namespace :style do
   desc 'Run Ruby style checks'
@@ -20,4 +21,16 @@ 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',
+  ]
+end
+
 task default: ['style', 'spec']
diff --git a/cookbooks/chef_utils/concourse.yml b/cookbooks/chef_utils/concourse.yml
new file mode 100644 (file)
index 0000000..0803818
--- /dev/null
@@ -0,0 +1,54 @@
+---
+# $ fly -t target sp -p chef_utils-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
+- 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: false
+  - 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/chef_utils/fly-vars.yml b/cookbooks/chef_utils/fly-vars.yml
new file mode 100644 (file)
index 0000000..1f855f5
--- /dev/null
@@ -0,0 +1,3 @@
+---
+cookbook-name: chef_utils
+chefdk-version: 0.17.17