Blob


1 #!/usr/bin/perl
3 use strict;
4 use warnings;
5 use lib qw(./lib);
6 use IRCNOW::ConfigNow;
8 use File::Basename;
9 use File::Path qw(make_path);
11 my $account = shift || die "Usage: $0 <account> <user1> <user2> <user3> <...>\n";
12 my $users = \@ARGV;
13 # Temporary hack to support custom Domains
14 my $custDomain;
15 $custDomain = 'bnsnet.ca' if ($account eq 'blacklock');
17 my $domain = 'user.planetofnix.com';
18 my %config=(
19 type=>'shell',
20 account => $account,
21 users => $users,
22 gitAuthor => $account,
23 gitEmail => $account . "@" . $domain,
24 gitWorkDir => "./configNow/$account",
25 ipv4 => '38.87.162.191',
26 ipv6 => '2602:fccf:1:1191::',
27 domain => $domain,
28 custDomain => $custDomain,
29 StageDir => './stageNow',
30 DeployDir => './deployNow/',
31 Accounts => [ $account ], # List of accounts to deploy
32 );
34 my $shellConfig = new IRCNOW::ConfigNow( %config );
35 #use Data::Dumper;
36 #die Dumper($shellConfig->{lists});
38 if ($shellConfig->repo_ready()) {
39 $shellConfig->write_config();
40 $shellConfig->repo_commit();
41 } else {
42 print "Your ConfigNow git repo is not ready. Please review and commit the pending changes.\n"
43 . $shellConfig->repo_status()
44 . "\n";
45 }
47 print "\n" . $shellConfig->repo_log();
50 if ($shellConfig->stage_ready()) { # Verify stage repo is ready
51 }
52 print "Deploying config Change.\n";
53 $shellConfig->stage_pull($account => "../configNow/$account");
54 $shellConfig->stage_merge();
55 $shellConfig->stage_commit();
56 $shellConfig->deploy_system();
61 # Get list of files changed in a diff
62 #$r->run(qw(git diff 0cd562e --name-only));