-
-
Save jdtoy/7704087 to your computer and use it in GitHub Desktop.
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
#!/bin/bash -eux | |
# pkgs | |
apt-get update | |
apt-get upgrade -y | |
apt-get install -y curl git-core | |
# chef | |
which chef-solo >/dev/null || \ | |
curl -L http://www.opscode.com/chef/install.sh | bash | |
[[ ! -d /var/chef/cookbooks ]] && \ | |
mkdir -p /var/chef/cookbooks | |
cd /var/chef/cookbooks | |
# apt, java, runit & jenkins are needed to setup jenkins | |
[[ ! -d /var/chef/cookbooks/apt ]] && \ | |
git clone https://github.com/opscode-cookbooks/apt.git apt | |
[[ ! -d /var/chef/cookbooks/java ]] && \ | |
git clone https://github.com/opscode-cookbooks/java.git java | |
[[ ! -d /var/chef/cookbooks/runit ]] && \ | |
git clone https://github.com/opscode-cookbooks/runit.git runit | |
[[ ! -d /var/chef/cookbooks/chef-jenkins ]] && \ | |
git clone https://github.com/fnichol/chef-jenkins.git jenkins | |
# ark, llvm & ghc cookbooks are needed for my projects to build on the slave | |
[[ ! -d /var/chef/cookbooks/ark ]] && \ | |
git clone https://github.com/opscode-cookbooks/ark.git ark | |
[[ ! -d /var/chef/cookbooks/llvm ]] && \ | |
git clone https://github.com/dysinger/chef-llvm.git llvm | |
[[ ! -d /var/chef/cookbooks/ghc ]] && \ | |
git clone https://github.com/dysinger/chef-ghc.git ghc | |
# configure & run chef-solo | |
[[ ! -d /etc/chef ]] && \ | |
mkdir -p /etc/chef | |
echo '# default config #' >/etc/chef/solo.rb | |
cat > /etc/chef/node.json <<\JSON | |
{ | |
"java" : { | |
"install_flavor" : "oracle", | |
"jdk_version" : "6", | |
"oracle" : { "accept_oracle_download_terms" : true } | |
}, | |
"run_list": [ "recipe[apt]", | |
"recipe[jenkins::node_jnlp]", | |
"recipe[ghc]" ] | |
} | |
JSON | |
chef-solo -j /etc/chef/node.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment