Skip to content

Commit cde9f74

Browse files
committed
[multi-user CI] scabot conf
Needs a `knife vault update master scabot --file /tmp/scabot.json`, with `/tmp/scabot.json`: ``` { "github": { "scala": {"token": "..."} } } ```
1 parent 18068b5 commit cde9f74

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,15 @@ knife vault create master scabot-keypair \
280280
--admins adriaan
281281
282282
knife vault create master scabot \
283-
--json $PWD/.chef/scabot.json \
283+
{
284+
"jenkins": {
285+
"token": "..."
286+
},
287+
"github": {
288+
"scala": {"token": "..."}
289+
"lampepfl": {"token": "..."}
290+
}
291+
}
284292
--search 'name:jenkins-master' \
285293
--admins adriaan
286294

attributes/default.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,5 @@
121121
default['master']['ec2-start-stop']['url'] = 'https://dl.dropboxusercontent.com/u/12862572/ec2-start-stop.hpi'
122122

123123
# SCABOT
124-
default['scabot']['jenkins']['user'] = "scala-jenkins"
125-
default['scabot']['github']['repo_user'] = "scala"
124+
default['scabot']['jenkins']['user'] = "scala-jenkins"
126125
end

recipes/_master-config-scabot.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,15 @@
5959
revision "master"
6060
end
6161

62-
# TODO: do not use node.set for sensitive stuff!!
63-
node.set['scabot']['github']['token'] = chef_vault_item("master", "scabot")['github']['token']
64-
node.set['scabot']['jenkins']['token'] = chef_vault_item("master", "scabot")['jenkins']['token']
65-
6662
template "#{scabotHome}/scabot.conf" do
6763
source 'scabot.conf.erb'
6864
user scabotUser
6965
sensitive true
66+
67+
variables({
68+
:scabotVault => chef_vault_item("master", "scabot")
69+
})
70+
7071
end
7172

7273
bash 'build scabot' do

templates/default/scabot.conf.erb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
scala: {
22
jenkins: {
3-
job: "scala-2.11.x-validate-main"
4-
jobPrefix: "scala-2.11.x-" // this will be stripped when reporting to github TODO: remove once it's computed as s"${github.repo}-${pull.base.ref}-"
3+
jobSuffix: "validate-main"
54
host: "<%=node['master']['jenkinsHost']%>"
65
user: "<%=node['scabot']['jenkins']['user']%>"
7-
token: "<%=node['scabot']['jenkins']['token']%>"
6+
token: "<%=@scabotVault['jenkins']['token']%>"
87
}
98
github: {
10-
user: "<%=node['scabot']['github']['repo_user']%>"
119
repo: "scala"
10+
branches: ["2.11.x", "2.12.x"]
1211
host: "api.github.com"
13-
token: "<%=node['scabot']['github']['token']%>"
12+
user: "scala"
13+
token: "<%=@scabotVault['github']['scala']['token']%>"
1414
}
1515
}

0 commit comments

Comments
 (0)