Skip to content

Commit

Permalink
Working deployment deployment and deployment
Browse files Browse the repository at this point in the history
I put some deployment in your deployment so you could deploy while
deploying
  • Loading branch information
jeichorn committed Jul 22, 2014
1 parent 982fb61 commit 56963e4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ vendor
DigitalOcean/config.php
DigitalOcean/vendor
composer.phar
.release-config.php
deploy-config.php
15 changes: 9 additions & 6 deletions DigitalOcean/create-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,22 @@
echo "image: {$droplet->image->name} - {$droplet->image->slug}\n";
echo "size: {$droplet->size->slug} cpu({$droplet->size->vcpus}) memory({$droplet->size->memory}) disk({$droplet->size->disk})\n";

if (!empty($argv[1]))
if (!empty($argv[1]) && $argv[1] == 'go')
{
$baseDir = realpath(__DIR__.'/../');

// if we are in a real shell we could do this in one pipe, or maybe use rsync
// but lets use a temp file instead so we work in the shell that github ships
echo "Bootstrapping server\n";
echo "Bootstrapping server\n";

chdir($baseDir);
runCommand("scp ./DigitalOcean/setup.sh root@$serverIp:");
runCommand("scp ./DigitalOcean/run-puppet.sh root@$serverIp:");

// if we are in a real shell we could do this in one pipe, or maybe use rsync
// but lets use a temp file instead so we work in the shell that github ships
runCommand("tar cf puphpet.tar puphpet");
runCommand("scp puphpet.tar root@$serverIp:/tmp/puphpet.tar");
runCommand("tar cf puphpet-user.tar puphpet-user");
runCommand("scp puphpet-user.tar root@$serverIp:/tmp/puphpet-user.tar");

runCommand("scp ./DigitalOcean/setup.sh root@$serverIp:");
runCommand("ssh root@$serverIp 'sh -c /root/setup.sh'");
}

Expand Down
4 changes: 0 additions & 4 deletions DigitalOcean/run-puppet.sh

This file was deleted.

4 changes: 4 additions & 0 deletions DigitalOcean/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
mkdir /vagrant/
cd /vagrant/
tar xvf /tmp/puphpet.tar
tar xvf /tmp/puphpet-user.tar
cd /vagrant/puphpet
./shell/initial-setup.sh /vagrant/puphpet
./shell/install-ruby.sh /vagrant/puphpet
Expand All @@ -11,3 +12,6 @@ mkdir -p /etc/facter/facts.d
echo '{"vm_target_key":"digital_ocean"}' > /etc/facter/facts.d/info.json
cd /vagrant/puphpet/puppet
puppet apply manifest.pp --verbose --hiera_config /vagrant/puphpet/puppet/hiera.yaml --parser future --modulepath=/vagrant/puphpet/puppet/modules
cd /vagrant/puphpet
rsync -ra /vagrant/puphpet-user/exec-always/. /vagrant/puphpet/files/exec-always/
./shell/execute-files.sh exec-once exec-always
1 change: 0 additions & 1 deletion deploy.php

This file was deleted.

0 comments on commit 56963e4

Please sign in to comment.