Skip to content

Instantly share code, notes, and snippets.

@lorentzca
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lorentzca/0bd50e42a57acbc25176 to your computer and use it in GitHub Desktop.
Save lorentzca/0bd50e42a57acbc25176 to your computer and use it in GitHub Desktop.
werckerで使うやつ
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:
@lorentzca
Copy link
Author

鍵でログインしてくれないのとspecこの方法じゃまだ無理

@lorentzca
Copy link
Author

鍵ログインはタイポが原因だった…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment