OSDN Git Service

c9aab82da20674c9852f2528bf509660fa1b198e
[metasearch/grid-chef-repo.git] / cookbooks / docker-grid / concourse.yml
1 ---
2 # $ fly -t target sp -p docker-grid-cookbook -c concourse.yml -l fly-vars.yml -l ~/sec/credentials-prod.yml
3 resources:
4 - name: src-git
5   type: git
6   source:
7     uri: ((git-id-osdn))@git.osdn.net:/gitroot/metasearch/grid-chef-repo.git
8     branch: master
9     paths:
10     - cookbooks/((cookbook-name))
11     private_key: ((git-private-key))
12     git_user: ((git-user-osdn))
13   #check_every: 1h  # default: 1m
14 - name: chefdk-cache
15   type: docker-image
16   source:
17     repository: chef/chefdk
18     tag: ((chefdk-version))
19     # ((param)) style: fly >= 3.2.0
20     registry_mirror: https://((registry-mirror-domain))  # e.g. https://registry.docker.example.com:5000
21     ca_certs:
22     - domain: ((registry-mirror-domain))  # e.g. registry.docker.example.com:5000
23       cert: ((docker-reg-ca-cert))
24   check_every: 12h  # default: 1m
25
26 jobs:
27 - name: test-cookbook
28   plan:
29   - aggregate:
30     - get: src-git
31       params:
32         depth: 5
33       trigger: true
34     - get: chefdk-cache
35   - task: ci-build
36     image: chefdk-cache
37     params:
38       http_proxy: ((http-proxy))  # e.g. http://proxy.example.com:3128
39       #HTTP_PROXY: ((http-proxy))
40     config:
41       platform: linux
42       #image_resource:
43       #  type: docker-image
44       #  source:
45       #    repository: chef/chefdk
46       #    tag: ((chefdk-version))
47           # NG, setting disable
48           #registry_mirror: https://((registry-mirror-domain))
49           #ca_certs:
50           #- domain: ((registry-mirror-domain))
51           #  cert: ((docker-reg-ca-cert))
52       inputs:
53       - name: src-git
54       run:
55         #dir: ./src-git/cookbooks/((cookbook-name))
56         #path: rake
57         path: /bin/bash
58         args:
59         - -c
60         - |
61           cd ./src-git/cookbooks/((cookbook-name))
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 install
93           rake publish
94   - put: src-git
95     params:
96       repository: src-git
97       tag_prefix: ((cookbook-name))-
98       tag: src-git/cookbooks/((cookbook-name))/version
99       only_tag: true
100       annotate: ../src-git/cookbooks/((cookbook-name))/version