final update of stuff on old machine

This commit is contained in:
Jeff Carr 2018-06-07 16:15:14 -07:00
parent a944be1b44
commit f591d8e2f1
2 changed files with 32 additions and 20 deletions

View File

@ -39,3 +39,10 @@ git@git.wit.com:jcarr/witcoredns.git witcoredns
git@git.wit.com:jcarr/old.db.wit.com old.db.wit.com git@git.wit.com:jcarr/old.db.wit.com old.db.wit.com
git@git.wit.com:jcarr/benchmarks benchmarks git@git.wit.com:jcarr/benchmarks benchmarks
git@git.wit.com:jcarr/jcarrbox jcarrbox git@git.wit.com:jcarr/jcarrbox jcarrbox
git@git.wit.com:jcarr/old-debcore old-debcore
git@git.wit.com:jcarr/old-group-chat old-group-chat
git@git.wit.com:jcarr/old-www.wit.com old-www.wit.com
git@git.wit.com:harisrafiq/Web-Based-Proxy Web-Based-Proxy
git@git.wit.com:harisrafiq/LiveBlock LiveBlock
git@git.wit.com:harisrafiq/HTTP-HTTPS-TUNNEL HTTP-HTTPS-TUNNEL

View File

@ -8,13 +8,18 @@ chomp $STAMP;
# kubectl -n cloud-wit describe pod gogs-7596dddd7-7j6zb # the old one? now it's: # kubectl -n cloud-wit describe pod gogs-7596dddd7-7j6zb # the old one? now it's:
# kubectl -n cloud-wit describe pod gogs-fbf5fd88f-9v45z # kubectl -n cloud-wit describe pod gogs-fbf5fd88f-9v45z
# kubectl -n cloud-wit get pv |grep gogs # kubectl -n cloud-wit get pv |grep gogs
#
if ($ARGV[0] eq "--dry-run") {
$dry = 'TRUE';
shift @ARGV;
}
sub my_system { sub my_system {
my $cmd = join " ", @_; my $cmd = join " ", @_;
chomp $cmd; chomp $cmd;
print "$cmd\n"; print "$cmd\n";
if ($ARGV[0] ne "--dry-run") { if ($dry ne "TRUE") {
$return = system $cmd; $return = system $cmd;
if ($return eq 2) { if ($return eq 2) {
print "SYSTEM RETURNED $return\n"; print "SYSTEM RETURNED $return\n";
@ -34,7 +39,7 @@ sub gitrepo {
} else { } else {
my_system "cd $base; git clone $repo $name\n"; my_system "cd $base; git clone $repo $name\n";
} }
if ($ARGV[0] ne "--dry-run") { if ($dry ne "TRUE") {
if (! -d "$base/$name/.git") { if (! -d "$base/$name/.git") {
print "GIT FAILED for $repo\n"; print "GIT FAILED for $repo\n";
my_system "rmdir $base/$name" if -d "$base/$name"; my_system "rmdir $base/$name" if -d "$base/$name";
@ -47,7 +52,6 @@ chomp $basedir;
if ($ARGV[0] eq "rsync") { if ($ARGV[0] eq "rsync") {
my_system("tar -c --use-compress-program=pigz -f archive.gogs.$STAMP.tgz mirrored-gogs/git/gogs-repositories/"); my_system("tar -c --use-compress-program=pigz -f archive.gogs.$STAMP.tgz mirrored-gogs/git/gogs-repositories/");
my_system("tar -c --use-compress-program=pigz -f archive.ping.$STAMP.tgz mirrored-ping/");
my_system("rsync -av --progress --delete vm10:/var/lib/kubelet/plugins/kubernetes.io/rbd/mounts/kube-pool-image-kubernetes-dynamic-pvc-7a6428c8-376e-11e8-85ad-0a580af40662/ mirrored-gogs/"); my_system("rsync -av --progress --delete vm10:/var/lib/kubelet/plugins/kubernetes.io/rbd/mounts/kube-pool-image-kubernetes-dynamic-pvc-7a6428c8-376e-11e8-85ad-0a580af40662/ mirrored-gogs/");
my_system("rsync -av --progress --delete mirrored-gogs/git/gogs-repositories/ gitweb:/var/lib/git/gogs/"); my_system("rsync -av --progress --delete mirrored-gogs/git/gogs-repositories/ gitweb:/var/lib/git/gogs/");
@ -55,23 +59,24 @@ if ($ARGV[0] eq "rsync") {
exit; exit;
} }
@lines = split "\n", `cat MANIFEST`; if ($ARGV[0] eq "manifest") {
foreach $line (@lines) { @lines = split "\n", `cat MANIFEST`;
my ($repo, $tmp) = split / +/, $line; foreach $line (@lines) {
next if $repo eq ""; my ($repo, $tmp) = split / +/, $line;
my @dirs = split /\//, $tmp; next if $repo eq "";
my $name = pop @dirs; my @dirs = split /\//, $tmp;
my $dir = join '/', @dirs; my $name = pop @dirs;
if ( 'git/' eq substr $repo, 0, 4 ) { my $dir = join '/', @dirs;
gitrepo ("cloned-ping/$dir", $name, "ssh://root\@ping.wit.com/var/lib/$repo"); if ( 'git/' eq substr $repo, 0, 4 ) {
# } elsif ( 'git@github.com:witst' eq substr $repo, 0, 20 ) { gitrepo ("cloned-ping/$dir", $name, "ssh://root\@ping.wit.com/var/lib/$repo");
# gitrepo ("cloned-github/$dir", $name, $repo); # } elsif ( 'git@github.com:witst' eq substr $repo, 0, 20 ) {
} elsif ( 'git@git.wit.com' eq substr $repo, 0, 15 ) { # gitrepo ("cloned-github/$dir", $name, $repo);
gitrepo ("cloned-jcarr/$dir", $name, $repo); } elsif ( 'git@git.wit.com' eq substr $repo, 0, 15 ) {
} else { gitrepo ("cloned-jcarr/$dir", $name, $repo);
# print "$path, $dir\n"; } else {
# print "$path, $dir\n";
}
} }
} }
if ($ARGV[0] eq "gogs") { if ($ARGV[0] eq "gogs") {