OSDN Git Service

improves Concourse pipeline configurations.
[metasearch/grid-chef-repo.git] / cookbooks / 00cookbook / concourse.yml
1 ---
2 # $ fly -t target sp -p 00cookbook-cookbook -c concourse.yml -l fly-vars.yml -l ~/sec/credentials-prod.yml
3 resource_types:
4 - name: ya-git
5   type: docker-image
6   source:
7     repository: whitestar/git-resource
8     registry_mirror: https://((registry-mirror-domain))
9     ca_certs:
10     - domain: ((registry-mirror-domain))
11       cert: ((docker-reg-ca-cert))
12
13 resources:
14 - name: src-git
15   type: ya-git
16   #type: git
17   source:
18     uri: ((git-id-osdn))@git.osdn.net:/gitroot/metasearch/grid-chef-repo.git
19     branch: master
20     paths:
21     - cookbooks/((cookbook-name))
22     private_key: ((git-private-key))
23     git_user: ((git-user-osdn))
24   #check_every: 1h  # default: 1m
25 - name: chefdk-cache
26   type: docker-image
27   source:
28     repository: chef/chefdk
29     tag: ((chefdk-version))
30     # ((param)) style: fly >= 3.2.0
31     registry_mirror: https://((registry-mirror-domain))  # e.g. https://registry.docker.example.com:5000
32     ca_certs:
33     - domain: ((registry-mirror-domain))  # e.g. registry.docker.example.com:5000
34       cert: ((docker-reg-ca-cert))
35   check_every: 12h  # default: 1m
36
37 jobs:
38 - name: test-cookbook
39   plan:
40   - aggregate:
41     - get: src-git
42       params:
43         depth: 5
44       trigger: true
45     - get: chefdk-cache
46   - task: ci-build
47     image: chefdk-cache
48     params:
49       http_proxy: ((http-proxy))  # e.g. http://proxy.example.com:3128
50       #HTTP_PROXY: ((http-proxy))
51     config:
52       platform: linux
53       #image_resource:
54       #  type: docker-image
55       #  source:
56       #    repository: chef/chefdk
57       #    tag: ((chefdk-version))
58           # NG, setting disable
59           #registry_mirror: https://((registry-mirror-domain))
60           #ca_certs:
61           #- domain: ((registry-mirror-domain))
62           #  cert: ((docker-reg-ca-cert))
63       inputs:
64       - name: src-git
65       run:
66         #dir: ./src-git/cookbooks/((cookbook-name))
67         #path: rake
68         path: /bin/bash
69         args:
70         - -c
71         - |
72           cd ./src-git/cookbooks/((cookbook-name))
73           bundle install
74           rake
75 - name: publish-cookbook
76   plan:
77   - aggregate:
78     - get: src-git
79       params:
80         depth: 5
81       trigger: false
82     - get: chefdk-cache
83   - task: publish
84     image: chefdk-cache
85     params:
86       http_proxy: ((http-proxy))
87       chef_username: ((chef-username))
88       chef_client_key: ((chef-client-key))
89     config:
90       platform: linux
91       inputs:
92       - name: src-git
93       run:
94         path: /bin/bash
95         args:
96         - -c
97         - |
98           echo '{"username":"((chef-username))","key":"/root/chef-client-key.pem"}' > /root/.stove
99           echo "$chef_client_key"  > /root/chef-client-key.pem
100           cd ./src-git/cookbooks/((cookbook-name))
101           bundle install
102           rake publish
103   - put: src-git
104     params:
105       repository: src-git
106       tag_prefix: ((cookbook-name))-
107       tag: src-git/cookbooks/((cookbook-name))/version
108       only_tag: true
109       annotate: src-git/cookbooks/((cookbook-name))/version
110       #annotate:   # path to a file containing the annotation message.