Changeset 2252 in ProjectBuilder
- Timestamp:
- Aug 30, 2017, 5:07:32 PM (7 years ago)
- Location:
- devel
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-doc/README
r2084 r2252 5 5 Example: 6 6 7 $ cat $HOME/.pbrc 7 $ cat $HOME/.pbrc.yml 8 --- 8 9 # 9 10 # Root of the temp file used to store info on the project … … 13 14 # to your VMs 14 15 # 15 pbrc pb = $ENV{'HOME'}/pb/svn/pbrc 16 pbrc: 17 pb: $ENV{'HOME'}/pb/svn/pbrc 16 18 $ 17 19 -
devel/pb-doc/pb-demo
r2237 r2252 175 175 176 176 # Look at conf files 177 cat ~/.pbrc 178 cat /home/rpmbootstrap/.pbrc 179 cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio. pb177 cat ~/.pbrc.yml 178 cat /home/rpmbootstrap/.pbrc.yml 179 cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio.yml 180 180 cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio/rpm/afio.spec 181 181 cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio/deb/control … … 206 206 207 207 # 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 208 rm -rf pb .pbrc.yml 209 cat > 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 216 222 EOF 217 223 218 224 pb -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 225 cat ~/.pbrc.yml 226 cat >> ~/.pbrc.yml << EOF 227 --- 228 pbconfurl: 229 afio: svn://localhost/pb/afio/pbconf 230 EOF 231 echo " pbdefdir:" >> ~/.pbrc.yml 232 echo " default: \$ENV{'HOME'}/pb" >> ~/.pbrc.yml 224 233 mkdir pb 225 234 svn import pb svn://localhost/pb -m "Initial creation of pb repo" … … 231 240 # passwd asked here 232 241 233 cat ~/afio. pb.add >> afio/pbconf/afio.pb242 cat ~/afio.yml.add >> afio/pbconf/afio.yml 234 243 pb -p afio sbx2build 235 244 236 245 # with Ubuntu CD 237 cat >> ~/.pbrc << EOF 238 vmpath default = /home/qemu 239 EOF 240 246 cat >> ~/.pbrc.yml << EOF 247 vmpath: 248 default: /home/qemu 249 EOF 250 -
devel/pb-modules/etc/pb.conf.pod
r2241 r2252 17 17 The 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. 18 18 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.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.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. 20 20 21 21 =head1 OPTIONS -
devel/pb-modules/lense/projectbuilder.aug
r829 r2252 30 30 let lns = ( record | comment | empty )* 31 31 32 let filter = (incl "/home/bruno/.pbrc ") . Util.stdexcl32 let filter = (incl "/home/bruno/.pbrc.yml") . Util.stdexcl 33 33 34 34 let xfm = transform lns filter -
devel/pb-modules/lib/ProjectBuilder/Conf.pm
r2250 r2252 62 62 # Read hash codes of values from a configuration file and return table of pointers 63 63 # 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"); 66 66 67 67 =head1 USAGE -
devel/pb-modules/lib/ProjectBuilder/Env.pm
r2251 r2252 73 73 } 74 74 75 $ENV{'PBETC'} = "$dir/.pbrc ";75 $ENV{'PBETC'} = "$dir/.pbrc.yml"; 76 76 77 77 if (! -f $ENV{'PBETC'}) { … … 185 185 $p->{$ENV{'PBPROJ'}} = pb_path_expand($p->{$ENV{'PBPROJ'}}); 186 186 # 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"); 188 188 } 189 189 } … … 223 223 224 224 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) 226 226 Names under a pbproj and the corresponding pbconf should be similar 227 227 -
devel/pb/bin/pb
r2251 r2252 481 481 =head1 CONFIGURATION FILES 482 482 483 Each pb user may have a configuration in F<$HOME/.pbrc >. The values in this file may overwrite any other configuration file value.483 Each pb user may have a configuration in F<$HOME/.pbrc.yml>. The values in this file may overwrite any other configuration file value. 484 484 485 485 Here is an example of such a configuration file: … … 493 493 # svn+ssh, cvs+ssh, ... 494 494 # 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 496 497 497 498 # This is normaly defined in the project's configuration file 498 499 # Url of the project 499 500 # 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 501 503 502 504 # All these URLs needs to be defined here as the are the entry point 503 505 # for how to build packages for the project 504 506 # 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 509 515 510 516 # Under that dir will take place everything related to pb … … 512 518 # to your VMs/chroot/... 513 519 # 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 518 528 519 529 # pbconfdir points to the directory where the CMS content of the pbconfurl is checked out 520 530 # 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 523 535 524 536 # pbdir points to the directory where the CMS content of the pburl is checked out 525 537 # If not defined, pbdir is under pbdefdir/pbproj 526 538 # 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 529 543 530 544 # -daemonize doesn't work with qemu 0.8.2 531 vmopt default = -m 384 545 vmopt: 546 default: -m 384 532 547 533 548 =head1 COMMAND DETAILS … … 535 550 =head2 newproj 536 551 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:552 The newproj command creates a new project-builder project. To run this command you first need to define two variables in your ~/.pbrc.yml file: 538 553 539 554 pbconfurl I<project> = file:///home/anderse/.git/project-builder-config/I<project> … … 588 603 =item Update your filters and build files. 589 604 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 transform s in the *.pbf files. The build files will be filtered by the filters defined in the *.pbffiles to generate the inputs to the build step. Therefore, if you change those files, you need to re-run the cms2build step.605 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 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. 591 606 592 607 =item Build the package. … … 606 621 =over 4 607 622 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 625 Update 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 616 635 617 636 If you are building for rpm style OS's, update the verpmtype option, and install the appropriate tool. 618 637 619 verpmtype default = rpmbootstrap 638 verpmtype: 639 default: rpmbootstrap 620 640 621 641 You 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: 622 642 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/ 627 651 628 652 =item Run the cms2build command … … 648 672 You need to have a sshhost entry for setupve to work, so add one, even an invalid one, e.g.: 649 673 650 sshhost $project = foo.example.org 674 sshhost: 675 $project: foo.example.org 651 676 652 677 =item Setup the virtual environment … … 670 695 You 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. 671 696 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 674 701 675 702 You 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. 676 703 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 678 706 679 707 =item Update your filters and build files 680 708 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.709 You may need to update your filter files as in the build2pkg step if you are building for a new OS or architecture. 682 710 683 711 =item Build the packages and copy them to the repository … … 3384 3412 if (($action eq "build") || ($action eq "prep")) { 3385 3413 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"; 3388 3416 # TODO: Why ? 3389 3417 print SCRIPT "cd ..\n"; -
devel/pbmkbm/bin/pbmkbm
r2241 r2252 257 257 pb_log(0,"Starting boot media build for $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}\n"); 258 258 259 pb_env_init_pbrc(); # to get content of HOME/.pbrc 259 pb_env_init_pbrc(); # to get content of HOME/.pbrc.yml 260 260 261 261 # Global hash containing all the configuration information -
devel/pbtest/bin/pbtest
r2251 r2252 136 136 sudopbtest "pbdistrocheck" 137 137 138 cat > /tmp/.pbrc << EOF138 cat > /tmp/.pbrc.yml << EOF 139 139 # 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 149 158 # 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 169 EOF 170 sudocmd "mv /tmp/.pbrc.yml $PBTEST/.pbrc.yml" 157 171 158 172 sudopbtest "pb -p $PBPROJ clean 2>&1 > /dev/null" 1 159 173 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" 174 cat > /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 185 EOF 186 echo " vmlist:" >> /tmp/.pbrc.yml 187 echo " default: `echo $TESTVMDIST | sed 's/ /,/g'`" >> /tmp/.pbrc.yml 188 sudocmd "mv /tmp/.pbrc.yml $PBTEST/vm/.pbrc.yml" 189 190 cat > /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 205 EOF 206 echo " velist:" >> /tmp/.pbrc.yml 207 echo " default: `echo $TESTVEDIST | sed 's/ /,/g'`" >> /tmp/.pbrc.yml 208 sudocmd "mv /tmp/.pbrc.yml $PBTEST/ve/.pbrc.yml" 209 sudocmd "chown ${PBUSER}:$PBUSER $PBTEST/.pbrc.yml $PBTEST/ve/.pbrc.yml $PBTEST/vm/.pbrc.yml" 182 210 183 211 sudopbtest "ssh-keygen -f $PBTEST/.ssh/id_rsa -t rsa -b 768 -v -N ''" -
devel/rpmbootstrap/bin/rpmbootstrap
r2241 r2252 138 138 Created on the fly if needed. 139 139 If 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) 141 141 142 142 =back … … 243 243 # Create if not existent and use default if none given 244 244 # 245 pb_env_init_pbrc(); # to get content of HOME/.pbrc 245 pb_env_init_pbrc(); # to get content of HOME/.pbrc.yml 246 246 my $vepath = shift @ARGV; 247 247
Note:
See TracChangeset
for help on using the changeset viewer.