Last active
August 29, 2015 13:58
-
-
Save kazu69/9957302 to your computer and use it in GitHub Desktop.
dokku + vagrant deploy app
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 | |
# 公開鍵を登録 | |
cat ~/.ssh/github/id_rsa.pub | ssh vagrant@192.168.33.10 "sudo sshcommand acl-add dokku vagrant" | |
git clone https://github.com/heroku/node-js-sample.git | |
cd node-js-sample && git remote add my-heroku dokku@deploy.192.168.33.10.xip.io:node-js-sample | |
# pushして実行環境構築とアプリケーション実行 | |
git push my-heroku master |
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
# vagrant環境の構築 | |
vagrant up | |
# deploy | |
/bin/bash initial.sh | |
Counting objects: 319, done. | |
Delta compression using up to 4 threads. | |
Compressing objects: 100% (273/273), done. | |
Writing objects: 100% (319/319), 201.78 KiB | 0 bytes/s, done. | |
Total 319 (delta 18), reused 319 (delta 18) | |
-----> Building node-js-sample ... | |
Node.js app detected | |
-----> Requested node range: 0.10.x | |
-----> Resolved node version: 0.10.26 | |
-----> Downloading and installing node | |
-----> Writing a custom .npmrc to circumvent npm bugs | |
-----> Installing dependencies | |
‥‥‥‥‥‥‥ | |
-----> Caching node_modules directory for future builds | |
-----> Cleaning up node-gyp and npm artifacts | |
-----> Building runtime environment | |
-----> Discovering process types | |
Procfile declares types -> web | |
-----> Releasing node-js-sample ... | |
-----> Deploying node-js-sample ... | |
-----> Cleaning up ... | |
=====> Application deployed: | |
http://node-js-sample.192.168.33.10.xip.io | |
To dokku@deploy.192.168.33.10.xip.io:node-js-sample | |
* [new branch] master -> master | |
# http://node-js-sample.deploy.192.168.33.10.xip.io/ | |
open http://node-js-sample.deploy.192.168.33.10.xip.io/ |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "Ubuntu12_04" | |
config.vm.box_url = "http://download.appscale.com/download/AppScale%201.12.0%20VirtualBox%20Image" | |
config.vm.network :private_network, ip: "192.168.33.10" | |
config.vm.provision :shell, :inline => <<-EOT | |
sudo apt-get -y update | |
sudo apt-get install -y python-software-properties | |
wget -qO- https://raw.github.com/progrium/dokku/v0.2.2/bootstrap.sh | sudo DOKKU_TAG=v0.2.2 bash | |
# 192.168.33.10.xip.io resolves to 192.168.33.10 | |
echo deploy.192.168.33.10.xip.io | sudo tee /home/dokku/VHOST | |
EOT | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment