-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logs are in `~scabot/logs/current` simply restart by `su scabot -c 'killall -1 java'` (the scabot user runs only one java process, which will is supervised by runit) push to deploy using git-deploy (see scabot repo)
- Loading branch information
Showing
8 changed files
with
146 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# | ||
# Cookbook Name:: scala-jenkins-infra | ||
# Recipe:: _master-init-scabot | ||
# | ||
# Copyright 2014, Typesafe, Inc. | ||
# | ||
# All rights reserved - Do Not Redistribute | ||
# | ||
|
||
include_recipe "git" | ||
include_recipe "chef-sbt" | ||
|
||
scabotHome = "/home/scabot" | ||
scabotCheckout = "/home/scabot/scabot" | ||
scabotUser = "scabot" | ||
|
||
user scabotUser | ||
|
||
directory scabotHome do | ||
owner scabotUser | ||
mode 00755 | ||
action :create | ||
end | ||
|
||
directory scabotCheckout do | ||
owner scabotUser | ||
mode 00755 | ||
action :create | ||
end | ||
|
||
directory "#{scabotHome}/logs" do | ||
owner scabotUser | ||
mode 00755 | ||
action :create | ||
end | ||
|
||
directory "#{scabotHome}/.ssh" do | ||
owner scabotUser | ||
end | ||
|
||
file "#{scabotHome}/.ssh/authorized_keys" do | ||
owner scabotUser | ||
mode '644' | ||
content ChefVault::Item.load("master", "scabot-keypair")['public_key'] | ||
end | ||
|
||
node.set['scabot']['github']['token'] = ChefVault::Item.load("master", "scabot")['github']['token'] | ||
node.set['scabot']['jenkins']['token'] = ChefVault::Item.load("master", "scabot")['jenkins']['token'] | ||
|
||
git_user scabotUser do | ||
home scabotHome | ||
# owner scabotUser | ||
full_name 'Scabot' | ||
email 'adriaan@typesafe.com' | ||
end | ||
|
||
# scabotCheckout must be an empty dir | ||
git scabotCheckout do | ||
user scabotUser | ||
repository "https://github.com/adriaanm/scabot.git" | ||
revision "master" | ||
end | ||
|
||
template "#{scabotCheckout}/scabot.conf" do | ||
source 'scabot.conf.erb' | ||
user scabotUser | ||
sensitive true | ||
end | ||
|
||
bash 'build scabot' do | ||
cwd scabotCheckout | ||
user scabotUser | ||
code "sbt update && sbt stage" | ||
end | ||
|
||
# Include runit to setup the service | ||
include_recipe 'runit::default' | ||
|
||
# Create runit service | ||
runit_service 'scabot' # see templates/default/sv-scabot-run.erb | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
scala: { | ||
jenkins: { | ||
job: "scala-2.11.x-validate-main" | ||
host: "scala-ci.typesafe.com" | ||
user: "<%=node['scabot']['jenkins']['user']%>" | ||
token: "<%=node['scabot']['jenkins']['token']%>" | ||
} | ||
github: { | ||
user: "<%=node['scabot']['github']['repo_user']%>" | ||
repo: "scala" | ||
host: "api.github.com" | ||
token: "<%=node['scabot']['github']['token']%>" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
# | ||
# This file was generated by Chef for <%= node['fqdn'] %>. | ||
# Do NOT modify this file by hand. | ||
# | ||
|
||
exec svlogd /home/scabot/logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
# | ||
# This file was generated by Chef for <%= node['fqdn'] %>. | ||
# Do NOT modify this file by hand. | ||
# | ||
|
||
|
||
exec 2>&1 | ||
cd /home/scabot | ||
touch scabot.start | ||
exec chpst -u scabot -U scabot \ | ||
env HOME=/home/scabot \ | ||
/home/scabot/scabot/target/universal/stage/bin/scabot |