OSDN Git Service

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