Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proof of concept for generic mkcamp_command. #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion bin/mkcamp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ process_copy_paths();
# Substitute tokens in config files
install_templates();

# Run commands after installing templates
# (e.g. to install Perl modules with carton)
run_mkcamp_command('after_templates');

# Prepare appserver(s)
prepare_ic();
prepare_rails();
Expand Down Expand Up @@ -158,7 +162,7 @@ however is appropriate.
END
}

run_post_mkcamp_command();
run_mkcamp_command('post');

=pod

Expand Down
14 changes: 10 additions & 4 deletions lib/Camp/Master.pm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ our $VERSION = '3.03';
roles
roles_path
role_sql
run_post_mkcamp_command
run_mkcamp_command
server_control
set_camp_comment
set_camp_user
Expand Down Expand Up @@ -3057,10 +3057,16 @@ sub camp_list {
return @result;
}

sub run_post_mkcamp_command {
sub run_mkcamp_command {
my $token = shift;
my $conf = config_hash();
my $cmd = $conf->{post_mkcamp_command};
$cmd and return do_system_soft($cmd) == 0;
my $camp = $conf->{path};

if (my $cmd = $conf->{"${token}_mkcamp_command"}) {
chdir($camp) or die "Can not change directory to $camp: $!";
return do_system_soft($cmd) == 0;
}

return;
}

Expand Down