Skip to content

Instantly share code, notes, and snippets.

@cflynn07
Last active December 25, 2015 16:29
Show Gist options
  • Save cflynn07/7006678 to your computer and use it in GitHub Desktop.
Save cflynn07/7006678 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
apt-get install git -y
apt-get install curl -y
# install RVM
curl -o rvm.sh -L https://get.rvm.io
chmod +x rvm.sh
./rvm.sh stable
source /etc/profile.d/rvm.sh
echo "source /etc/profile.d/rvm.sh" >> ~/.bash_rc
rvm requirements
# install ruby
rvm install ruby
rvm use ruby --default
# install rubygems
rvm rubygems current
# install chef
gem install chef
ssh-keygen -N '' -f id_rsa
sshkeyvalue="$(<~/.ssh/id_rsa.pub)"
cookbooks=("apt"
"build-essential"
"ohai"
"openssl"
"aws"
"xfs"
"mysql"
"php-fpm"
"nginx"
"redis"
"nodejs")
#add ssh key to bitbucket
curl -v \
-X POST \
-H "X-HostCommonName: bitbucket.org" \
-H "Host: bitbucket.org" \
-H "X-Target-URI: https://bitbucket.org" \
--no-keepalive \
--user $1:$2 \
--data-urlencode "key=$sshkeyvalue" \
--data "label=DOKEY" \
https://bitbucket.org/api/1.0/users/$1/ssh-keys?format=json
cd ~
git clone --recurse-submodules git@bitbucket.org:cflynn_us/samurai.git
cd ./samurai
chef-solo -c config.rb -j all.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment