Changeset 1216 in ProjectBuilder


Ignore:
Timestamp:
Feb 24, 2011, 1:51:30 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • rmntpcmd, vmhost, vmmem, vmntpcmd and vmsize have OS keys and not project keys. Fixed in doc and code.
  • Document [web]sshdir|port|login|host
  • pb_date2v needs the pbos as param to deal with *ntpcmd correctly. $v param removed as a consequence.
Location:
devel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/etc/pb.conf.pod

    r1215 r1216  
    450450
    451451 Nature: Mandatory
    452  Key: project (as defined in the -p option or PBPROJ environment variable)
     452 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
    453453 Value: NTP command to use to perform time synchronization with the B<rmntp> server. Use full path name, as this command will be used in the sudoers file to allow its launch by root.
    454454 Conffile: rm
     
    466466
    467467 Nature: Mandatory
    468  Key: project (as defined in the -p option or PBPROJ environment variable)
     468 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
    469469 Value: port number to use to communicate with the RM using the SSH protocol. This localport is redirected to the port 22 of the RM.
    470470 Conffile: rm
     
    487487 Example: rmrtype default = ssh
    488488
     489=item B<sshdir>
     490
     491 Nature: Mandatory
     492 Key: project (as defined in the -p option or PBPROJ environment variable)
     493 Value: dirname into which packages are uploaded on the B<sshhost> machine.
     494 Conffile: project
     495 Example: sshdir mondorescue = /pub/mondorescue
     496
     497=item B<sshhost>
     498
     499 Nature: Mandatory
     500 Key: project (as defined in the -p option or PBPROJ environment variable)
     501 Value: hostname to connect to in order to deliver packages to the repository server.
     502 Conffile: project
     503 Example: sshhost mondorescue = ftp.mondorescue.org
     504
     505=item B<sshlogin>
     506
     507 Nature: Mandatory
     508 Key: project (as defined in the -p option or PBPROJ environment variable)
     509 Value: login to use when connecting to the repository server B<sshhost> for package delivery.
     510 Conffile: project
     511 Example: sshlogin mondorescue = mylogin
     512
     513=item B<sshport>
     514
     515 Nature: Mandatory
     516 Key: project (as defined in the -p option or PBPROJ environment variable)
     517 Value: port to use when connecting to the repository server B<sshhost> for package delivery.
     518 Conffile: project
     519 Example: sshport mondorescue = 22
    489520
    490521=item B<supfiles>
     
    596627 Example: vmcmd default = /usr/bin/kvm
    597628
    598 
    599629=item B<vmhost>
    600630
    601631 Nature: Mandatory
    602  Key: project (as defined in the -p option or PBPROJ environment variable)
     632 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
    603633 Value: hostname to connect to in order to reach the VM through ssh. Generally redirected from a port on localhost.
    604634 Conffile: vm
     
    624654
    625655 Nature: Optional
    626  Key: project (as defined in the -p option or PBPROJ environment variable)
     656 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
    627657 Value: Memory size in MB to allocate to the VM.
    628658 Conffile: vm
     
    648678
    649679 Nature: Mandatory
    650  Key: project (as defined in the -p option or PBPROJ environment variable)
     680 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
    651681 Value: NTP command to use to perform time synchronization with the B<vmntp> server. Use full path name, as this command will be used in the sudoers file to allow its launch by root.
    652682 Conffile: vm
     
    680710
    681711 Nature: Mandatory
    682  Key: project (as defined in the -p option or PBPROJ environment variable)
     712 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
    683713 Value: Size of the VM to create when using the newvm command of pb.
    684714 Conffile: vm
     
    716746 Conffile: project
    717747 Example: webdir mondorescue = website
     748
     749=item B<websshdir>
     750
     751 Nature: Optional (when not using *2webssh commands)
     752 Key: project (as defined in the -p option or PBPROJ environment variable)
     753 Value: dirname into which content is uploaded on the B<websshhost> machine.
     754 Conffile: project
     755 Example: websshdir mondorescue = /var/www/html
     756
     757=item B<websshhost>
     758
     759 Nature: Optional (when not using *2webssh commands)
     760 Key: project (as defined in the -p option or PBPROJ environment variable)
     761 Value: hostname to connect to in order to deliver content to the Web server.
     762 Conffile: project
     763 Example: websshhost mondorescue = www.mondorescue.org
     764
     765=item B<websshlogin>
     766
     767 Nature: Optional (when not using *2webssh commands)
     768 Key: project (as defined in the -p option or PBPROJ environment variable)
     769 Value: login to use when connecting to the Web server B<websshhost> for content delivery.
     770 Conffile: project
     771 Example: websshlogin mondorescue = mylogin
     772
     773=item B<websshport>
     774
     775 Nature: Optional (when not using *2webssh commands)
     776 Key: project (as defined in the -p option or PBPROJ environment variable)
     777 Value: port to use when connecting to the Web server B<websshhost> for content delivery.
     778 Conffile: project
     779 Example: websshport mondorescue = 22
    718780
    719781=back
  • devel/pb/bin/pb

    r1215 r1216  
    16171617        ($vtmout) = pb_conf_get($tmout);
    16181618    }
    1619     my $sshmachine = $sshhost->{$ENV{'PBPROJ'}};
    1620     if ($cmt =~ /^RM/) {
    1621         # In that case our real host is in the rmhost with the OS as key, not project as above
    1622         $sshmachine = pb_distro_get_param($pbos,$sshhost);
    1623     }
    1624     pb_log(2,"ssh: ".Dumper(($sshhost,$sshlogin,$sshdir,$sshport,$vtmout,$vepath,$rbsconf))."\n");
     1619    my $remhost = $sshhost->{$ENV{'PBPROJ'}};
     1620    my $remdir = $sshdir->{$ENV{'PBPROJ'}};
     1621    if ($cmt =~ /^V[EM]|RM/) {
     1622        # In that case our real host is in the xxhost with the OS as key, not project as above
     1623        $remhost = pb_distro_get_param($pbos,$sshhost);
     1624    }
     1625    pb_log(2,"ssh: ".Dumper(($remhost,$sshlogin,$remdir,$sshport,$vtmout,$vepath,$rbsconf))."\n");
    16251626
    16261627    my $mac;
    16271628    if ($cmt !~ /^VE/) {
    1628         $mac = "$sshlogin->{$ENV{'PBPROJ'}}\@$sshmachine";
     1629        $mac = "$sshlogin->{$ENV{'PBPROJ'}}\@$remhost";
    16291630        # Overwrite account value if passed as parameter
    1630         $mac = "$pbaccount\@$sshmachine" if (defined $pbaccount);
     1631        $mac = "$pbaccount\@$remhost" if (defined $pbaccount);
    16311632        pb_log(2, "DEBUG: pbaccount: $pbaccount => mac: $mac\n") if (defined $pbaccount);
    16321633    } else {
     
    16401641    my $bdir;
    16411642    if (($cmt eq "Sources") || ($cmt =~ /(V[EM]|RM)Script/)) {
    1642         $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}/src";
     1643        $tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}/src";
    16431644    } elsif ($cmt =~ /(V[EM]|RM)(build|test)/) {
    1644         $tdir = $sshdir->{$ENV{'PBPROJ'}}."/$ENV{'PBPROJ'}/delivery";
    1645         $bdir = $sshdir->{$ENV{'PBPROJ'}}."/$ENV{'PBPROJ'}/build";
     1645        $tdir = $remdir."/$ENV{'PBPROJ'}/delivery";
     1646        $bdir = $remdir."/$ENV{'PBPROJ'}/build";
    16461647        # Remove a potential $ENV{'HOME'} as bdir should be relative to pb's home
    16471648        $bdir =~ s|\$ENV.+\}/||;
    16481649    } elsif ($cmt eq "Announce") {
    1649         $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}";
     1650        $tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}";
    16501651    } elsif ($cmt eq "Web") {
    1651         $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}";
     1652        $tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}";
    16521653    } elsif ($cmt eq "Packages") {
    16531654        if (($pbos->{'type'} eq "rpm") || ($pbos->{'type'} eq "pkg") || ($pbos->{'type'} eq "hpux") || ($pbos->{'type'} eq "tgz")) {
    16541655            # put packages under an arch subdir
    1655             $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}";
     1656            $tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}";
    16561657        } elsif (($pbos->{'type'} eq "deb") || ($pbos->{'type'} eq "ebuild")) {
    16571658            # No need for an arch subdir
    1658             $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}";
     1659            $tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}";
    16591660        } else {
    16601661            die "Please teach the dev team where to deliver ($pbos->{'type'} type of packages\n";
     
    16621663
    16631664        my $repodir = $tdir;
    1664         $repodir =~ s|^$sshdir->{$ENV{'PBPROJ'}}/||;
     1665        $repodir =~ s|^$remdir/||;
    16651666
    16661667        my ($pbrepo) = pb_conf_get("pbrepo");
     
    18451846    my $tm = undef;
    18461847    if ($cmt =~ /^(V|R)M/) {
    1847         $tm = $vtmout->{$ENV{'PBPROJ'}};
     1848        $tm = $vtmout->{$v};
    18481849    }
    18491850
     
    21682169                if (($vmtype eq "qemu") || ($vmtype eq "xen") || ($vmtype eq "kvm")) {
    21692170                    my $command = pb_check_req("qemu-img",0);
    2170                     pb_system("$command create -f qcow2 $vmm $vmsize->{$ENV{'PBPROJ'}}","Creating the QEMU VM");
     2171                    pb_system("$command create -f qcow2 $vmm $vmsize->{$v}","Creating the QEMU VM");
    21712172                } elsif ($vmtype eq "vmware") {
    21722173                } else {
     
    23882389
    23892390my $vtype = shift;
    2390 my $v = shift;
     2391my $pbos = shift;
    23912392
    23922393my ($ntp) = pb_conf_get_if($vtype."ntp");
     
    23952396
    23962397if (defined $vntp) {
    2397     my ($ntpcmd) = pb_conf_get($vtype."ntpcmd");
     2398    my ($ntpcmd) = pb_distro_get_param($pbos,pb_conf_get($vtype."ntpcmd"));
    23982399    my $vntpcmd;
    2399     if (defined $ntpcmd->{$v}) {
    2400         $vntpcmd = $ntpcmd->{$v};
     2400    if (defined $ntpcmd->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"}) {
     2401        $vntpcmd = $ntpcmd->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"};
    24012402    } elsif (defined $ntpcmd->{$ENV{'PBPROJ'}}) {
    24022403        $vntpcmd = $ntpcmd->{$ENV{'PBPROJ'}};
     
    24822483    }
    24832484
    2484     my $ntpline = pb_date2v($vtype,$v);
     2485    # Get distro context
     2486    my $pbos = pb_distro_get_context($v);
     2487   
     2488    my $ntpline = pb_date2v($vtype,$pbos);
    24852489    print SCRIPT "# Time sync\n";
    24862490    print SCRIPT "echo 'setting up date with '";
     
    27262730    $pm->start($counter) and next if (defined $pbparallel);
    27272731
    2728     # Deal with date sync.
    2729     my $ntpline = pb_date2v($vtype,$v);
    2730 
    27312732    # Get distro context
    27322733    my $pbos = pb_distro_get_context($v);
    27332734   
     2735    # Deal with date sync.
     2736    my $ntpline = pb_date2v($vtype,$pbos);
     2737
    27342738    # Name of the account to deal with for VM/VE/RM
    27352739    # Do not use the one passed potentially with -a
Note: See TracChangeset for help on using the changeset viewer.