Last active
August 29, 2015 14:02
-
-
Save lorentzca/0bd50e42a57acbc25176 to your computer and use it in GitHub Desktop.
werckerで使うやつ
This file contains hidden or 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
box: wercker/ruby | |
build: | |
steps: | |
- script: | |
name: make .ssh directory | |
code: mkdir -p $HOME/.ssh | |
- create-file: | |
name: put ssh public key | |
filename: $HOME/.ssh/id_rsa.pub | |
overwrite: true | |
hide-from-log: true | |
content: $DIGITALOCEAN_SSH_KEY_PUBLIC | |
- create-file: | |
name: put ssh private key | |
filename: $HOME/.ssh/id_rsa | |
overwrite: true | |
hide-from-log: true | |
content: $DIGITALOCEAN_SSH_KEY_PRIVATE | |
- script: | |
name: run chmod 0400 $HOME/.ssh/id_rsa* | |
code: | | |
chmod 0400 $HOME/.ssh/id_rsa* | |
chmod 0700 $HOME/.ssh | |
- bundle-install | |
- script: | |
name: create digitalocean droplets | |
code: DROPLET_IP_ADDRESS=$(ruby ./control-droplet.rb create) | |
- script: | |
name: create ssh config | |
code: | | |
echo "Host digio" >> $HOME/.ssh/config | |
echo " User root" >> $HOME/.ssh/config | |
echo " HostName $DROPLET_IP_ADDRESS" >> $HOME/.ssh/config | |
echo " StrictHostKeyChecking no" >> $HOME/.ssh/config | |
echo " IdentityFile ~/.ssh/id_rsa" >> $HOME/.ssh/config | |
- script: | |
name: run cook | |
code: | | |
bundle exec knife solo prepare root@digio -i $HOME/.ssh/id_rsa | |
bundle exec knife solo cook root@digio -i $HOME/.ssh/id_rsa | |
- script: | |
name: run spec | |
code: bundle exec rake spec:digio | |
after-steps: | |
- script: | |
name: wipe the droplets | |
code: ruby control-droplet.rb destroy | |
# deploy: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
鍵でログインしてくれないのとspecこの方法じゃまだ無理