Changeset 2252


Ignore:
Timestamp:
Aug 30, 2017, 5:07:32 PM (4 weeks ago)
Author:
bruno
Message:

Use .pbrc.yml now as a YAML file as well instead of .pbrc

Location:
devel
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-doc/README

    r2084 r2252  
    55Example:
    66
    7 $ cat $HOME/.pbrc
     7$ cat $HOME/.pbrc.yml
     8---
    89#
    910# Root of the temp file used to store info on the project
     
    1314# to your VMs
    1415#
    15 pbrc pb = $ENV{'HOME'}/pb/svn/pbrc
     16  pbrc:
     17    pb: $ENV{'HOME'}/pb/svn/pbrc
    1618$
    1719
  • devel/pb-doc/pb-demo

    r2237 r2252  
    175175
    176176# Look at conf files
    177 cat ~/.pbrc
    178 cat /home/rpmbootstrap/.pbrc
    179 cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio.pb
     177cat ~/.pbrc.yml
     178cat /home/rpmbootstrap/.pbrc.yml
     179cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio.yml
    180180cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio/rpm/afio.spec
    181181cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio/deb/control
     
    206206
    207207# as pblab
    208 rm -rf pb .pbrc
    209 cat > afio.pb.add << EOF
    210 defpkgdir afio = dummy
    211 pbpackager default = Big Chief <bigchief@hp.com>
    212 projver afio = 2.5
    213 projtag afio = 1
    214 pburl afio = ftp://localhost/src/afio-2.5.tar.gz
    215 pbrepo afio = ftp://localhost
     208rm -rf pb .pbrc.yml
     209cat > afio.yml.add << EOF
     210  defpkgdir:
     211    afio : dummy
     212  pbpackager:
     213    default : Big Chief <bigchief@hp.com>
     214  projver:
     215    afio : 2.5
     216  projtag:
     217    afio : 1
     218  pburl:
     219    afio : ftp://localhost/src/afio-2.5.tar.gz
     220  pbrepo:
     221    afio : ftp://localhost
    216222EOF
    217223
    218224pb -p afio clean
    219 cat ~/.pbrc
    220 cat >> ~/.pbrc << EOF
    221 pbconfurl afio = svn://localhost/pb/afio/pbconf
    222 EOF
    223 echo "pbdefdir default = \$ENV{'HOME'}/pb" >>  ~/.pbrc
     225cat ~/.pbrc.yml
     226cat >> ~/.pbrc.yml << EOF
     227---
     228  pbconfurl:
     229    afio: svn://localhost/pb/afio/pbconf
     230EOF
     231echo "  pbdefdir:" >>  ~/.pbrc.yml
     232echo "    default: \$ENV{'HOME'}/pb" >>  ~/.pbrc.yml
    224233mkdir pb
    225234svn import pb svn://localhost/pb -m "Initial creation of pb repo"
     
    231240# passwd asked here
    232241
    233 cat ~/afio.pb.add >> afio/pbconf/afio.pb
     242cat ~/afio.yml.add >> afio/pbconf/afio.yml
    234243pb -p afio sbx2build
    235244
    236245# with Ubuntu CD
    237 cat >> ~/.pbrc << EOF
    238 vmpath default = /home/qemu
    239 EOF
    240 
     246cat >> ~/.pbrc.yml << EOF
     247  vmpath:
     248    default: /home/qemu
     249EOF
     250
  • devel/pb-modules/etc/pb.conf.pod

    r2241 r2252  
    1717The key could be also default, in which case it will be used as a default value if no more precise content is given for the key.
    1818
    19 Each value is detailed below giving the nature of its use (Mandatory or Optional - only used for certain feature), the value of the key (could be the project, an OS name, default, ...), the value of the parameter field and its format, the default configuration file in which it should be defined (home $HOME/.pbrc, conf /etc/pb/pb.conf or /usr/local/etc/pb/pb.conf, VE vepath/.pbrc, VM vmpath/.pbrc,  or project project.pb) and an example of use.
     19Each value is detailed below giving the nature of its use (Mandatory or Optional - only used for certain feature), the value of the key (could be the project, an OS name, default, ...), the value of the parameter field and its format, the default configuration file in which it should be defined (home $HOME/.pbrc.yml, conf /etc/pb/pb.yml or /usr/local/etc/pb/pb.yml, VE vepath/.pbrc.yml, VM vmpath/.pbrc.yml, or project project.yml) and an example of use.
    2020
    2121=head1 OPTIONS
  • devel/pb-modules/lense/projectbuilder.aug

    r829 r2252  
    3030  let lns = ( record | comment | empty )*
    3131
    32   let filter = (incl "/home/bruno/.pbrc") . Util.stdexcl
     32  let filter = (incl "/home/bruno/.pbrc.yml") . Util.stdexcl
    3333
    3434  let xfm = transform lns filter
  • devel/pb-modules/lib/ProjectBuilder/Conf.pm

    r2250 r2252  
    6262  # Read hash codes of values from a configuration file and return table of pointers
    6363  #
    64   my ($k1, $k2) = pb_conf_read_if("$ENV{'HOME'}/.pbrc","key1","key2");
    65   my ($k) = pb_conf_read("$ENV{'HOME'}/.pbrc","key");
     64  my ($k1, $k2) = pb_conf_read_if("$ENV{'HOME'}/.pbrc.yml","key1","key2");
     65  my ($k) = pb_conf_read("$ENV{'HOME'}/.pbrc.yml","key");
    6666
    6767=head1 USAGE
  • devel/pb-modules/lib/ProjectBuilder/Env.pm

    r2251 r2252  
    7373}
    7474
    75 $ENV{'PBETC'} = "$dir/.pbrc";
     75$ENV{'PBETC'} = "$dir/.pbrc.yml";
    7676
    7777if (! -f $ENV{'PBETC'}) {
     
    185185        $p->{$ENV{'PBPROJ'}} = pb_path_expand($p->{$ENV{'PBPROJ'}});
    186186        # TODO: should we add the conf files pointed by project default as well ?
    187         pb_conf_add("$p->{$ENV{'PBPROJ'}}/.pbrc") if (-f "$p->{$ENV{'PBPROJ'}}/.pbrc");
     187        pb_conf_add("$p->{$ENV{'PBPROJ'}}/.pbrc.yml") if (-f "$p->{$ENV{'PBPROJ'}}/.pbrc.yml");
    188188    }
    189189}
     
    223223
    224224
    225  (*) By default, if no relocation in .pbrc, dev dir is taken in the maint pbdefdir (when appropriate)
     225 (*) By default, if no relocation in .pbrc.yml, dev dir is taken in the maint pbdefdir (when appropriate)
    226226 Names under a pbproj and the corresponding pbconf should be similar
    227227
  • devel/pb/bin/pb

    r2251 r2252  
    481481=head1 CONFIGURATION FILES
    482482
    483 Each pb user may have a configuration in F<$HOME/.pbrc>. The values in this file may overwrite any other configuration file value.
     483Each pb user may have a configuration in F<$HOME/.pbrc.yml>. The values in this file may overwrite any other configuration file value.
    484484
    485485Here is an example of such a configuration file:
     
    493493 # svn+ssh, cvs+ssh, ...
    494494 #
    495  pbconfurl linuxcoe = cvs+ssh://:ext:bcornec@linuxcoe.cvs.sourceforge.net:/cvsroot/linuxcoe/pbconf
     495  pbconfurl:
     496    linuxcoe : cvs+ssh://:ext:bcornec@linuxcoe.cvs.sourceforge.net:/cvsroot/linuxcoe/pbconf
    496497
    497498 # This is normaly defined in the project's configuration file
    498499 # Url of the project
    499500 #
    500  pburl linuxcoe = cvs+ssh://:ext:bcornec@linuxcoe.cvs.sourceforge.net:/cvsroot/linuxcoe
     501  pburl:
     502    linuxcoe : cvs+ssh://:ext:bcornec@linuxcoe.cvs.sourceforge.net:/cvsroot/linuxcoe
    501503 
    502504 # All these URLs needs to be defined here as the are the entry point
    503505 # for how to build packages for the project
    504506 #
    505  pbconfurl pb = svn+ssh://svn.project-builder.org/mondo/svn/pb/pbconf
    506  pbconfurl mondorescue = svn+ssh://svn.project-builder.org/mondo/svn/project-builder/mondorescue/pbconf
    507  pbconfurl collectl = svn+ssh://bruno@svn.mondorescue.org/mondo/svn/project-builder/collectl/pbconf
    508  pbconfurl netperf = svn+ssh://svn.mondorescue.org/mondo/svn/project-builder/netperf/pbconf
     507  pbconfurl:
     508    pb: svn+ssh://svn.project-builder.org/mondo/svn/pb/pbconf
     509  pbconfurl:
     510    mondorescue: svn+ssh://svn.project-builder.org/mondo/svn/project-builder/mondorescue/pbconf
     511  pbconfurl:
     512    collectl: svn+ssh://bruno@svn.mondorescue.org/mondo/svn/project-builder/collectl/pbconf
     513  pbconfurl:
     514    netperf: svn+ssh://svn.mondorescue.org/mondo/svn/project-builder/netperf/pbconf
    509515 
    510516 # Under that dir will take place everything related to pb
     
    512518 # to your VMs/chroot/...
    513519 # if not defined then /var/cache
    514  pbdefdir default = $ENV{'HOME'}/project-builder
    515  pbdefdir pb = $ENV{'HOME'}
    516  pbdefdir linuxcoe = $ENV{'HOME'}/LinuxCOE/cvs
    517  pbdefdir mondorescue = $ENV{'HOME'}/mondo/svn
     520  pbdefdir:
     521    default: $ENV{'HOME'}/project-builder
     522  pbdefdir:
     523    pb: $ENV{'HOME'}
     524  pbdefdir:
     525    linuxcoe: $ENV{'HOME'}/LinuxCOE/cvs
     526  pbdefdir:
     527    mondorescue: $ENV{'HOME'}/mondo/svn
    518528 
    519529 # pbconfdir points to the directory where the CMS content of the pbconfurl is checked out
    520530 # If not defined, pbconfdir is under pbdefdir/pbproj/pbconf
    521  pbconfdir linuxcoe = $ENV{'HOME'}/LinuxCOE/cvs/pbconf
    522  pbconfdir mondorescue = $ENV{'HOME'}/mondo/svn/pbconf
     531  pbconfdir:
     532    linuxcoe: $ENV{'HOME'}/LinuxCOE/cvs/pbconf
     533  pbconfdir:
     534    mondorescue: $ENV{'HOME'}/mondo/svn/pbconf
    523535 
    524536 # pbdir points to the directory where the CMS content of the pburl is checked out
    525537 # If not defined, pbdir is under pbdefdir/pbproj
    526538 # Only defined if we have access to the dev of the project
    527  pbdir linuxcoe = $ENV{'HOME'}/LinuxCOE/cvs
    528  pbdir mondorescue = $ENV{'HOME'}/mondo/svn
     539  pbdir:
     540    linuxcoe: $ENV{'HOME'}/LinuxCOE/cvs
     541  pbdir:
     542    mondorescue: $ENV{'HOME'}/mondo/svn
    529543 
    530544 # -daemonize doesn't work with qemu 0.8.2
    531  vmopt default = -m 384
     545  vmopt:
     546    default: -m 384
    532547
    533548=head1 COMMAND DETAILS
     
    535550=head2 newproj
    536551
    537 The newproj command creates a new project-builder project.  To run this command you first need to define two variables in your ~/.pbrc file:
     552The newproj command creates a new project-builder project.  To run this command you first need to define two variables in your ~/.pbrc.yml file:
    538553
    539554 pbconfurl I<project> = file:///home/anderse/.git/project-builder-config/I<project>
     
    588603=item Update your filters and build files.
    589604
    590 You probably need to edit the files describing the build steps in one of the $pbdefdir/$project/pbconf/$version/$project/{deb,rpm,pkg} directories and the filters in $pbdefdir/$project/pbconf/$version/pbfilter. Note that you can define additional filters and transforms in the *.pbf files. The build files will be filtered by the filters defined in the *.pbf files to generate the inputs to the build step. Therefore, if you change those files, you need to re-run the cms2build step.
     605You probably need to edit the files describing the build steps in one of the $pbdefdir/$project/pbconf/$version/$project/{deb,rpm,pkg} directories and the filters in $pbdefdir/$project/pbconf/$version/pbfilter. Note that you can define additional filters and transformations in the filters files. The build files will be filtered by the filters defined in the filters files to generate the inputs to the build step. Therefore, if you change those files, you need to re-run the cms2build step.
    591606
    592607=item Build the package.
     
    606621=over 4
    607622
    608 =item Update ~/.pbrc
    609 
    610 Update your ~/.pbrc file to specify the vepath, velist, velogin, and vetype variables, e.g.:
    611 
    612  vepath default = $ENV{HOME}/cache-project-builder/chroot
    613  velist default = debian-6.0-i386
    614  velogin default = pb
    615  vetype default = chroot
     623=item Update ~/.pbrc.yml
     624
     625Update your ~/.pbrc.yml file to specify the vepath, velist, velogin, and vetype variables, e.g.:
     626
     627  vepath:
     628    default: $ENV{HOME}/cache-project-builder/chroot
     629  velist:
     630    default: debian-6.0-i386
     631  velogin:
     632    default: pb
     633  vetype:
     634    default: chroot
    616635
    617636If you are building for rpm style OS's, update the verpmtype option, and install the appropriate tool.
    618637
    619  verpmtype default = rpmbootstrap
     638  verpmtype:
     639    default: rpmbootstrap
    620640
    621641You may also choose to specify a mirror for the OS packages, and optionally http/ftp proxies.  You can specify the proxies either through environment variables ($http_proxy/$https_proxy/$ftp_proxy) or in the configuration file. The configuration file will be used if no corresponding environment variable has been set. For example, for debian and with a local squid proxy:
    622642
    623  rbsmirrorsrv debian = http://mirrors1.kernel.org/debian/
    624  http_proxy default = http://localhost:3128/
    625  https_proxy default = http://localhost:3128/
    626  ftp_proxy default = http://localhost:3128/
     643  rbsmirrorsrv:
     644    debian: http://mirrors1.kernel.org/debian/
     645  http_proxy:
     646    default: http://localhost:3128/
     647  https_proxy:
     648    default: http://localhost:3128/
     649  ftp_proxy:
     650    default: http://localhost:3128/
    627651
    628652=item Run the cms2build command
     
    648672You need to have a sshhost entry for setupve to work, so add one, even an invalid one, e.g.:
    649673
    650  sshhost $project = foo.example.org
     674  sshhost:
     675    $project: foo.example.org
    651676
    652677=item Setup the virtual environment
     
    670695You need to have a valid sshdir and sshhost entry for build2ve to work, so add them. Note that you need to be able to ssh from the host you run the command on to the repository host, preferably without needing to type in a password, so using ssh-agent or having a special passwordless project-builder ssh key will make this step easier.
    671696
    672  sshhost $project = localhost
    673  sshdir $project = $home/cache-project-builder/repos
     697  sshhost:
     698    $project: localhost
     699  sshdir:
     700    $project: $home/cache-project-builder/repos
    674701
    675702You may also need to specify additional repository files to use or rpms to install. Note the URL for repositories is not the URL of the repository, but the URL of a file that can be put in the yum.repos.d or apt.sources.d directory.
    676703
    677  addrepo centos-5-i386 = http://localhost/pb/centos-extras.repo,http://mirror.centos.org/centos/5/extras/i386/RPMS/chrpath-0.13-3.el5.centos.i386.rpm
     704  addrepo:
     705    centos-5-i386: http://localhost/pb/centos-extras.repo,http://mirror.centos.org/centos/5/extras/i386/RPMS/chrpath-0.13-3.el5.centos.i386.rpm
    678706
    679707=item Update your filters and build files
    680708
    681 You may need to update your filter files (*.pbf) as in the build2pkg step if you are building for a new OS or architecture.
     709You may need to update your filter files as in the build2pkg step if you are building for a new OS or architecture.
    682710
    683711=item Build the packages and copy them to the repository
     
    33843412    if (($action eq "build") || ($action eq "prep")) {
    33853413        print SCRIPT "# Preparation for pb\n";
    3386         print SCRIPT "rm -f \$HOME/.pbrc\n";
    3387         print SCRIPT "cp .pbrc \$HOME\n";
     3414        print SCRIPT "rm -f \$HOME/.pbrc.yml\n";
     3415        print SCRIPT "cp .pbrc.yml \$HOME\n";
    33883416        # TODO: Why ?
    33893417        print SCRIPT "cd ..\n";
  • devel/pbmkbm/bin/pbmkbm

    r2241 r2252  
    257257pb_log(0,"Starting boot media build for $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}\n");
    258258
    259 pb_env_init_pbrc(); # to get content of HOME/.pbrc
     259pb_env_init_pbrc(); # to get content of HOME/.pbrc.yml
    260260
    261261# Global hash containing all the configuration information
  • devel/pbtest/bin/pbtest

    r2251 r2252  
    136136sudopbtest "pbdistrocheck"
    137137
    138 cat > /tmp/.pbrc << EOF
     138cat > /tmp/.pbrc.yml << EOF
    139139# Projects
    140 pbconfurl afio = svn://localhost/pb/afio/pbconf
    141 pbdefdir default = \$ENV{'HOME'}/pb
    142 pbconfurl pb = svn://svn.project-builder.org/pb/pbconf
    143 pbconfdir pb = \$ENV{'HOME'}/pb/pbconf
    144 pburl pb = svn://svn.project-builder.org/pb
    145 pburl mondorescue = svn://svn.mondorescue.org/mondorescue/branches
    146 sshhost pb = localhost
    147 sshlogin pb = $PBUSER
    148 sshdir pb = \$ENV{'HOME'}/ftp
     140  pbconfurl:
     141    afio : svn://localhost/pb/afio/pbconf
     142  pbdefdir:
     143    default : \$ENV{'HOME'}/pb
     144  pbconfurl:
     145    pb : svn://svn.project-builder.org/pb/pbconf
     146  pbconfdir:
     147    pb : \$ENV{'HOME'}/pb/pbconf
     148  pburl:
     149    pb : svn://svn.project-builder.org/pb
     150  pburl:
     151    mondorescue : svn://svn.mondorescue.org/mondorescue/branches
     152  sshhost:
     153    pb : localhost
     154  sshlogin:
     155    pb : $PBUSER
     156  sshdir:
     157    pb : \$ENV{'HOME'}/ftp
    149158#
    150 pbpackager default = Big Chief <bigchief@project-builder.org>
    151 vmport pb = 2200
    152 pbparallel pb = 6
    153 vepath default = $PBTEST/ve
    154 vmpath default = $PBTEST/vm
    155 EOF
    156 sudocmd "mv /tmp/.pbrc $PBTEST/.pbrc"
     159  pbpackager:
     160    default : Big Chief <bigchief@project-builder.org>
     161  vmport:
     162    pb : 2200
     163  pbparallel:
     164    pb : 6
     165  vepath:
     166    default : $PBTEST/ve
     167  vmpath:
     168    default : $PBTEST/vm
     169EOF
     170sudocmd "mv /tmp/.pbrc.yml $PBTEST/.pbrc.yml"
    157171
    158172sudopbtest "pb -p $PBPROJ clean 2>&1 > /dev/null" 1
    159173
    160 cat > /tmp/.pbrc << EOF
    161 vmtype default = kvm
    162 vmcmd default = qemu-kvm
    163 vmsize fedora = 10G
    164 vmmonport default = 4000
    165 vmlogin default = $PBUSER
    166 EOF
    167 echo "vmlist default = `echo $TESTVMDIST | sed 's/ /,/g'`" >> /tmp/.pbrc
    168 sudocmd "mv /tmp/.pbrc $PBTEST/vm/.pbrc"
    169 
    170 cat > /tmp/.pbrc << EOF
    171 vetype default = docker
    172 verpmtype default = rpmbootstrap
    173 vedebtype default = debootstrap
    174 verebuild default = false
    175 veopt default =
    176 vesnap default = false
    177 velogin default = $PBUSER
    178 EOF
    179 echo "velist default = `echo $TESTVEDIST | sed 's/ /,/g'`" >> /tmp/.pbrc
    180 sudocmd "mv /tmp/.pbrc $PBTEST/ve/.pbrc"
    181 sudocmd "chown ${PBUSER}:$PBUSER $PBTEST/.pbrc $PBTEST/ve/.pbrc $PBTEST/vm/.pbrc"
     174cat > /tmp/.pbrc.yml << EOF
     175  vmtype:
     176    default : kvm
     177  vmcmd:
     178    default : qemu-kvm
     179  vmsize:
     180    fedora : 10G
     181  vmmonport:
     182    default : 4000
     183  vmlogin:
     184    default : $PBUSER
     185EOF
     186echo "  vmlist:" >> /tmp/.pbrc.yml
     187echo "    default: `echo $TESTVMDIST | sed 's/ /,/g'`" >> /tmp/.pbrc.yml
     188sudocmd "mv /tmp/.pbrc.yml $PBTEST/vm/.pbrc.yml"
     189
     190cat > /tmp/.pbrc.yml << EOF
     191  vetype:
     192    default : docker
     193  verpmtype:
     194    default : rpmbootstrap
     195  vedebtype:
     196    default : debootstrap
     197  verebuild:
     198    default : false
     199  veopt:
     200    default :
     201  vesnap:
     202    default : false
     203  velogin:
     204    default : $PBUSER
     205EOF
     206echo "  velist:" >> /tmp/.pbrc.yml
     207echo "    default: `echo $TESTVEDIST | sed 's/ /,/g'`" >> /tmp/.pbrc.yml
     208sudocmd "mv /tmp/.pbrc.yml $PBTEST/ve/.pbrc.yml"
     209sudocmd "chown ${PBUSER}:$PBUSER $PBTEST/.pbrc.yml $PBTEST/ve/.pbrc.yml $PBTEST/vm/.pbrc.yml"
    182210
    183211sudopbtest "ssh-keygen -f $PBTEST/.ssh/id_rsa -t rsa -b 768 -v -N ''"
  • devel/rpmbootstrap/bin/rpmbootstrap

    r2241 r2252  
    138138Created on the fly if needed.
    139139If none is given use the default directory hosting VE for project-builder.org
    140 (Cf: vepath parameter in $HOME/.pbrc)
     140(Cf: vepath parameter in $HOME/.pbrc.yml)
    141141
    142142=back
     
    243243# Create if not existent and use default if none given
    244244#
    245 pb_env_init_pbrc(); # to get content of HOME/.pbrc
     245pb_env_init_pbrc(); # to get content of HOME/.pbrc.yml
    246246my $vepath = shift @ARGV;
    247247
Note: See TracChangeset for help on using the changeset viewer.