Skip to content

Instantly share code, notes, and snippets.

@hiroy
Created February 4, 2013 08:01
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 hiroy/4705514 to your computer and use it in GitHub Desktop.
Save hiroy/4705514 to your computer and use it in GitHub Desktop.
Cinnamonを使ってみるサンプル
use strict;
use warnings;
use Cinnamon::DSL;
set application => 'myapp';
set repository => 'git@github.com:yourname/myapp.git';
role devel => ['aws-myapp-01'], {
deploy_to => '/home/ec2-user/apps/myapp-devel',
branch => 'master',
};
task deploy => {
update => sub {
my ($host, @args) = @_;
my $deploy_to = get('deploy_to');
my $branch = 'origin/' . get('branch');
remote {
run "cd $deploy_to && git fetch origin && git checkout -q $branch";
} $host;
},
};
task composer => {
update => sub {
my ($host, @args) = @_;
my $deploy_to = get('deploy_to');
remote {
run "cd $deploy_to && composer update";
} $host;
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment