OSDN Git Service

adds the Concourse pipeline configuration. chef_utils-0.8.2
authorwhitestar <whitestar@users.osdn.me>
Mon, 17 Jul 2017 01:14:23 +0000 (10:14 +0900)
committerwhitestar <whitestar@users.osdn.me>
Mon, 17 Jul 2017 01:14:23 +0000 (10:14 +0900)
cookbooks/chef_utils/CHANGELOG.md
cookbooks/chef_utils/concourse.yml
cookbooks/chef_utils/recipes/chef-client.rb

index 54ecb24..24bc3b8 100644 (file)
@@ -1,6 +1,11 @@
 CHANGELOG for chef_utils
 =========================
 
+0.8.2
+-----
+- adds the Concourse pipeline configuration.
+- adds the Chef version pinning feature for the Debian family.
+
 0.8.1
 -----
 - adds the SSL server key pair's deployment feature for a Chef Server.
index 0803818..bece15c 100644 (file)
@@ -1,11 +1,27 @@
 ---
-# $ fly -t target sp -p chef_utils-cookbook -c concourse.yml -l fly-vars.yml -l ~/credentials.yml
+# $ fly -t target sp -p chef_utils-cookbook -c concourse.yml -l fly-vars.yml -l ~/sec/credentials-prod.yml
+resource_types:
+- name: ya-git
+  type: docker-image
+  source:
+    repository: whitestar/git-resource
+    registry_mirror: https://((registry-mirror-domain))
+    ca_certs:
+    - domain: ((registry-mirror-domain))
+      cert: ((docker-reg-ca-cert))
+
 resources:
 - name: src-git
-  type: git
+  type: ya-git
+  #type: git
   source:
-    uri: git://git.osdn.net/gitroot/metasearch/grid-chef-repo.git
+    uri: ((git-id-osdn))@git.osdn.net:/gitroot/metasearch/grid-chef-repo.git
     branch: master
+    paths:
+    - cookbooks/((cookbook-name))
+    git_user: ((git-user-osdn))
+    private_key: ((git-private-key))
+  #check_every: 1h  # default: 1m
 - name: chefdk-cache
   type: docker-image
   source:
@@ -16,18 +32,24 @@ resources:
     ca_certs:
     - domain: ((registry-mirror-domain))  # e.g. registry.docker.example.com:5000
       cert: ((docker-reg-ca-cert))
+  check_every: 12h  # default: 1m
 
 jobs:
-- name: build-cookbook
+- name: test-cookbook
   plan:
-  - get: src-git
-    trigger: false
-  - get: chefdk-cache
+  - aggregate:
+    - get: src-git
+      params:
+        depth: 5
+      trigger: true
+    - get: chefdk-cache
   - task: ci-build
     image: chefdk-cache
+    params:
+      http_proxy: ((http-proxy))  # e.g. http://proxy.example.com:3128
+      #HTTP_PROXY: ((http-proxy))
     config:
       platform: linux
-
       #image_resource:
       #  type: docker-image
       #  source:
@@ -38,10 +60,8 @@ jobs:
           #ca_certs:
           #- domain: ((registry-mirror-domain))
           #  cert: ((docker-reg-ca-cert))
-
       inputs:
       - name: src-git
-
       run:
         #dir: ./src-git/cookbooks/((cookbook-name))
         #path: rake
@@ -52,3 +72,39 @@ jobs:
           cd ./src-git/cookbooks/((cookbook-name))
           bundle install
           rake
+- name: publish-cookbook
+  plan:
+  - aggregate:
+    - get: src-git
+      params:
+        depth: 5
+      trigger: false
+    - get: chefdk-cache
+  - task: publish
+    image: chefdk-cache
+    params:
+      http_proxy: ((http-proxy))
+      chef_username: ((chef-username))
+      chef_client_key: ((chef-client-key))
+    config:
+      platform: linux
+      inputs:
+      - name: src-git
+      run:
+        path: /bin/bash
+        args:
+        - -c
+        - |
+          echo '{"username":"((chef-username))","key":"/root/chef-client-key.pem"}' > /root/.stove
+          echo "$chef_client_key"  > /root/chef-client-key.pem
+          cd ./src-git/cookbooks/((cookbook-name))
+          bundle install
+          rake publish
+  - put: src-git
+    params:
+      repository: src-git
+      tag_prefix: ((cookbook-name))-
+      tag: src-git/cookbooks/((cookbook-name))/version
+      only_tag: true
+      annotate: src-git/cookbooks/((cookbook-name))/version
+      #annotate:   # path to a file containing the annotation message.
index 081a429..62e485c 100644 (file)
@@ -2,7 +2,7 @@
 # Cookbook Name:: chef_utils
 # Recipe:: chef-client
 #
-# 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.