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/benchmarks benchmarks
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-fbf5fd88f-9v45z
# kubectl -n cloud-wit get pv |grep gogs
#
if ($ARGV[0] eq "--dry-run") {
$dry = 'TRUE';
shift @ARGV;
}
sub my_system {
my $cmd = join " ", @_;
chomp $cmd;
print "$cmd\n";
if ($ARGV[0] ne "--dry-run") {
if ($dry ne "TRUE") {
$return = system $cmd;
if ($return eq 2) {
print "SYSTEM RETURNED $return\n";
@ -34,7 +39,7 @@ sub gitrepo {
} else {
my_system "cd $base; git clone $repo $name\n";
}
if ($ARGV[0] ne "--dry-run") {
if ($dry ne "TRUE") {
if (! -d "$base/$name/.git") {
print "GIT FAILED for $repo\n";
my_system "rmdir $base/$name" if -d "$base/$name";
@ -47,7 +52,6 @@ chomp $basedir;
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.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 mirrored-gogs/git/gogs-repositories/ gitweb:/var/lib/git/gogs/");
@ -55,23 +59,24 @@ if ($ARGV[0] eq "rsync") {
exit;
}
@lines = split "\n", `cat MANIFEST`;
foreach $line (@lines) {
my ($repo, $tmp) = split / +/, $line;
next if $repo eq "";
my @dirs = split /\//, $tmp;
my $name = pop @dirs;
my $dir = join '/', @dirs;
if ( 'git/' eq substr $repo, 0, 4 ) {
gitrepo ("cloned-ping/$dir", $name, "ssh://root\@ping.wit.com/var/lib/$repo");
# } elsif ( 'git@github.com:witst' eq substr $repo, 0, 20 ) {
# gitrepo ("cloned-github/$dir", $name, $repo);
} elsif ( 'git@git.wit.com' eq substr $repo, 0, 15 ) {
gitrepo ("cloned-jcarr/$dir", $name, $repo);
} else {
# print "$path, $dir\n";
if ($ARGV[0] eq "manifest") {
@lines = split "\n", `cat MANIFEST`;
foreach $line (@lines) {
my ($repo, $tmp) = split / +/, $line;
next if $repo eq "";
my @dirs = split /\//, $tmp;
my $name = pop @dirs;
my $dir = join '/', @dirs;
if ( 'git/' eq substr $repo, 0, 4 ) {
gitrepo ("cloned-ping/$dir", $name, "ssh://root\@ping.wit.com/var/lib/$repo");
# } elsif ( 'git@github.com:witst' eq substr $repo, 0, 20 ) {
# gitrepo ("cloned-github/$dir", $name, $repo);
} elsif ( 'git@git.wit.com' eq substr $repo, 0, 15 ) {
gitrepo ("cloned-jcarr/$dir", $name, $repo);
} else {
# print "$path, $dir\n";
}
}
}
if ($ARGV[0] eq "gogs") {