[1915] | 1 | demo of project-builder.org
|
---|
[814] | 2 | ===========================
|
---|
| 3 |
|
---|
| 4 | # First demonstrate the way of working for pb itself
|
---|
[1835] | 5 | cd ~/local/pb|~/pb|~/svn-git/pb
|
---|
[814] | 6 | # Show the various versions available in this SVK exported dir
|
---|
| 7 | ls
|
---|
| 8 | # get the current tag of the SVK repository
|
---|
[1835] | 9 | svk info|svn info|git svn info
|
---|
[814] | 10 |
|
---|
| 11 | # get the current version of project-builder
|
---|
| 12 | rpm -q project-builder
|
---|
[817] | 13 | pb --help
|
---|
[1835] | 14 | pb
|
---|
[814] | 15 |
|
---|
| 16 | # Decide to build a package for project-builder based on that devel version
|
---|
| 17 | # to replace the one currently installed
|
---|
[1835] | 18 | pb -p pb -r devel sbx2build|cms2build
|
---|
[814] | 19 |
|
---|
| 20 | # Show the upstream part
|
---|
[2084] | 21 | ls -altg /home/bruno/svn-git/pb/pbdelivery/
|
---|
| 22 | tar tvfz /home/bruno/svn-git/pb/pbdelivery/project-builder-develXXX.tar.gz
|
---|
[814] | 23 |
|
---|
| 24 | # Show the pb specific part
|
---|
[2084] | 25 | tar tvfz /home/bruno/svn-git/pb/pbdelivery/project-builder-develXXX.pbconf.tar.gz
|
---|
[814] | 26 |
|
---|
| 27 | # Now make the packages
|
---|
| 28 | pb -p pb build2pkg
|
---|
| 29 |
|
---|
| 30 | # Look at the latest pckges created
|
---|
[2084] | 31 | ls -altrg /home/bruno/svn-git/pb/pbbuild/RPMS/noarch
|
---|
[814] | 32 |
|
---|
| 33 | # Install the generated packages
|
---|
[2084] | 34 | sudo urpmi /home/bruno/svn-git/pb/pbbuild/RPMS/noarch/*.rpm
|
---|
[814] | 35 |
|
---|
| 36 | # Check that it's the right one
|
---|
[816] | 37 | rpm -q project-builder
|
---|
[1968] | 38 | pb -h
|
---|
[1835] | 39 | git svn info
|
---|
[814] | 40 |
|
---|
[817] | 41 | # Now show how easy it's to build for another distro in a VM
|
---|
[1101] | 42 | ls /home/qemu
|
---|
[1915] | 43 | -> pb -p pb -m debian-7-x86_64 sbx2vm
|
---|
| 44 | ls -al /var/ftp/pub/pb/test/debian/7/
|
---|
| 45 | ls -al /var/ftp/pub/pb/test/debian/dists/7/
|
---|
[1835] | 46 |
|
---|
| 47 | pb -p pb -m mageia-3-i386 sbx2vm
|
---|
[817] | 48 | # Now show how easy it's to build for another distro in a VE
|
---|
[1288] | 49 | ls /home/rpmbootstrap
|
---|
[1835] | 50 | pb -p pb -m centos-6-x86_64 build2ve
|
---|
| 51 | pb -p pb -m ubuntu-11.10-x86_64 build2ve
|
---|
| 52 | -> pb -p pb -m debian-6.0-x86_64 sbx2ve
|
---|
| 53 | ls -al /var/ftp/pub/pb/test/debian/6.0/
|
---|
| 54 | ls -al /var/ftp/pub/pb/test/debian/dists/6.0/
|
---|
[816] | 55 |
|
---|
[1960] | 56 | # Docker part
|
---|
[1980] | 57 | # Mount the external HDD if needed
|
---|
| 58 | sudo mount /dev/sdc1 /mnt
|
---|
[2079] | 59 | $ sudo mount -o bind /mnt/docker /var/cache/docker
|
---|
[1980] | 60 | # Then restart docker to avoid errors with Attempt to write a readonly database
|
---|
[2006] | 61 | $ sudo systemctl restart docker
|
---|
| 62 | $ sudo systemctl restart docker_registry
|
---|
[1915] | 63 | # Now show how easy it's to build for another distro in a Docker VE
|
---|
| 64 | # Create Docker container
|
---|
[2006] | 65 | $ docker images
|
---|
[1980] | 66 |
|
---|
[2006] | 67 | # If docker issue with net, restart docker
|
---|
| 68 | $ sudo ip link delete docker0
|
---|
| 69 | $ sudo systemctl restart docker.service
|
---|
| 70 |
|
---|
[1980] | 71 | # Building with rpmbootstrap for a distro
|
---|
[2006] | 72 | # We already imported the upstream container images to save time
|
---|
| 73 | # Start with the local distro to simplify
|
---|
| 74 | #
|
---|
| 75 | $ pb -p pb -m mageia-5-x86_64 -T docker -i mageia:5 newve
|
---|
| 76 | # or without -i if time permits using rpmbootstrap
|
---|
| 77 | $ docker images | grep mageia-5
|
---|
| 78 | $ docker images | grep mageia-5 | awk '{print $3}'
|
---|
| 79 | $ docker run -ti `docker images | grep mageia-5 | awk '{print $3}'` /bin/bash
|
---|
| 80 | [root@8158b86786a7 /]# cat /etc/mageia-release
|
---|
| 81 | Mageia release 5 (Official) for x86_64
|
---|
| 82 | [root@8158b86786a7 /]# uname -a
|
---|
| 83 | Linux 8158b86786a7 3.19.8-desktop-3.mga5 #1 SMP Sat Jun 13 17:05:48 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
|
---|
| 84 | [root@8158b86786a7 /]# urpmi tcsh
|
---|
| 85 | http://distro.ibiblio.org/mageia/distrib/5/x86_64/media/core/release/tcsh-6.18.01-8.mga5.x86_64.rpm
|
---|
| 86 | installing tcsh-6.18.01-8.mga5.x86_64.rpm from /var/cache/urpmi/rpms
|
---|
| 87 | Preparing... #############################################
|
---|
| 88 | 1/1: tcsh #############################################
|
---|
| 89 | [root@8158b86786a7 /]# pb --help
|
---|
| 90 | bash: pb: command not found
|
---|
| 91 | [root@8158b86786a7 /]# exit
|
---|
| 92 | pb -p pb -m mageia-5-x86_64 -T docker sbx2setupve
|
---|
| 93 | $ docker images | grep mageia-5
|
---|
| 94 | localhost:5000/pb mageia-5-x86_64-pb 43bcfd269f29 2 minutes ago 376.2 MB
|
---|
| 95 | localhost:5000/pb mageia-5-x86_64 466f10e78bba 16 minutes ago 184.5 MB
|
---|
| 96 | $ docker run -ti `docker images | grep mageia-5-x86_64-pb | awk '{print $3}'` /bin/bash
|
---|
| 97 | [root@bbd981bcf4cd /]# pb --help
|
---|
| 98 | pb (aka project-builder.org) Version devel20150930111943-2002
|
---|
| 99 | [root@bbd981bcf4cd /]# exit
|
---|
| 100 | $ pb -p pb -m mageia-5-x86_64 -T docker prepve
|
---|
| 101 | $ docker images | grep mageia-5-x86_64-pb-pb
|
---|
| 102 | localhost:5000/pb mageia-5-x86_64-pb-pb 66dd65cab2cc About a minute ago 378.9 MB
|
---|
| 103 | $ pb -p pb -m mageia-5-x86_64 -T docker sbx2ve
|
---|
| 104 |
|
---|
| 105 |
|
---|
[1960] | 106 | # On another distro already preped
|
---|
[2006] | 107 | # we can launch in // the same for ubuntu 15.04
|
---|
| 108 | $ pb -p pb -m ubuntu-15.04-x86_64 -T docker -i ubuntu:15.04 newve
|
---|
| 109 | $ pb -p pb -m ubuntu-15.04-x86_64 -T docker sbx2setupve
|
---|
| 110 | $ pb -p pb -m ubuntu-15.04-x86_64 -T docker prepve
|
---|
| 111 | $ pb -p pb -m ubuntu-15.04-x86_64 -T docker sbx2ve
|
---|
| 112 |
|
---|
| 113 |
|
---|
[1980] | 114 | # Another container Ubuntu 13.10
|
---|
[2006] | 115 | $ pb -p pb -m ubuntu-13.10-x86_64 -T docker build2ve
|
---|
| 116 | $ ls -al /var/ftp/pub/pb/test/ubuntu/13.10
|
---|
[1960] | 117 |
|
---|
[1915] | 118 | # On another project
|
---|
[2006] | 119 | $ pb -p mondorescue -m mageia-4-x86_64 -T docker prepve
|
---|
| 120 | $ docker images
|
---|
| 121 | $ ls -al /var/ftp/pub/pb/test/mageia/4/x86_64
|
---|
| 122 | $ ssh bruno@www.mondorescue.org ls -altrg /prj/ftp/test/mageia/4/x86_64
|
---|
[1915] | 123 |
|
---|
[1960] | 124 |
|
---|
[1942] | 125 | # Look at what was created
|
---|
[2006] | 126 | $ docker images
|
---|
| 127 | $ docker history localhost:5000/pb:mageia-4-x86_64-pb-pb
|
---|
[1915] | 128 |
|
---|
[2006] | 129 | $ docker ps -a
|
---|
| 130 | $ docker attach <ctnid>
|
---|
| 131 | $ docker images
|
---|
| 132 | $ docker run -ti <imgid> /bin/bash
|
---|
| 133 | $ pb -h
|
---|
| 134 | $ docker run -ti <imgid> /bin/bash
|
---|
| 135 | $ ls -al /var/ftp/pub/pb/test/mageia/4/x86_64
|
---|
| 136 | #
|
---|
[1980] | 137 |
|
---|
| 138 | # WIth VMs
|
---|
[817] | 139 | # Now show how easy it's to build for another project for which I'm upstream
|
---|
[1835] | 140 | -> pb -p mondorescue -m debian-6.0-x86_64 sbx2ve
|
---|
[1288] | 141 |
|
---|
[817] | 142 | # Now show how easy it's to build for another project for which I'm not upstream with patches
|
---|
[1835] | 143 | -> pb -p afio -r 2.5 -m debian-6.0-x86_64 sbx2ve
|
---|
[816] | 144 |
|
---|
[1101] | 145 | # Look at conf files
|
---|
| 146 | cat ~/.pbrc
|
---|
[1288] | 147 | cat /home/rpmbootstrap/.pbrc
|
---|
[1835] | 148 | cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio.pb
|
---|
[1838] | 149 | cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio/rpm/afio.spec
|
---|
| 150 | cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio/deb/control
|
---|
[1835] | 151 | ls -R ~/svn-git/pb/projects/afio/pbconf/2.5/
|
---|
[1288] | 152 |
|
---|
| 153 | # Short Lab
|
---|
| 154 | # in pblab account
|
---|
| 155 | # prepa
|
---|
| 156 | # As root
|
---|
| 157 | rm -rf /prj/svn
|
---|
| 158 | svnadmin create /prj/svn
|
---|
| 159 | cat >> /prj/svn/conf/authz << EOF
|
---|
| 160 | [/]
|
---|
| 161 | pblab = rw
|
---|
| 162 | * = r
|
---|
| 163 | EOF
|
---|
| 164 | cat >> /prj/svn/conf/passwd << EOF
|
---|
| 165 | pblab = pblab
|
---|
| 166 | EOF
|
---|
| 167 | cat > /prj/svn/conf/svnserve.conf << EOF
|
---|
| 168 | [general]
|
---|
| 169 | password-db = passwd
|
---|
| 170 | authz-db = authz
|
---|
| 171 | [sasl]
|
---|
| 172 | EOF
|
---|
| 173 | killall svnserve
|
---|
| 174 | ~pblab/bin/rc.local
|
---|
| 175 |
|
---|
| 176 | # as pblab
|
---|
| 177 | rm -rf pb .pbrc
|
---|
| 178 | cat > afio.pb.add << EOF
|
---|
| 179 | defpkgdir afio = dummy
|
---|
| 180 | pbpackager default = Big Chief <bigchief@hp.com>
|
---|
| 181 | projver afio = 2.5
|
---|
| 182 | projtag afio = 1
|
---|
| 183 | pburl afio = ftp://localhost/src/afio-2.5.tar.gz
|
---|
| 184 | pbrepo afio = ftp://localhost
|
---|
| 185 | EOF
|
---|
| 186 |
|
---|
| 187 | pb -p afio clean
|
---|
| 188 | cat ~/.pbrc
|
---|
| 189 | cat >> ~/.pbrc << EOF
|
---|
| 190 | pbconfurl afio = svn://localhost/pb/afio/pbconf
|
---|
| 191 | EOF
|
---|
| 192 | echo "pbdefdir default = \$ENV{'HOME'}/pb" >> ~/.pbrc
|
---|
| 193 | mkdir pb
|
---|
| 194 | svn import pb svn://localhost/pb -m "Initial creation of pb repo"
|
---|
| 195 | # passwd asked here
|
---|
| 196 |
|
---|
| 197 | cd pb
|
---|
| 198 | svn co svn://localhost/pb .
|
---|
| 199 | pb -p afio newproj afio
|
---|
| 200 | # passwd asked here
|
---|
| 201 |
|
---|
| 202 | cat ~/afio.pb.add >> afio/pbconf/afio.pb
|
---|
| 203 | pb -p afio sbx2build
|
---|
| 204 |
|
---|
| 205 | # with Ubuntu CD
|
---|
| 206 | cat >> ~/.pbrc << EOF
|
---|
| 207 | vmpath default = /home/qemu
|
---|
| 208 | EOF
|
---|
| 209 |
|
---|