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