[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 |
|
---|
[2237] | 147 | # Now check what you built:
|
---|
| 148 | # On a deb based distro:
|
---|
| 149 | pb -p pb -m debian-9-x86_64 sbx2ve
|
---|
| 150 | docker run -ti pb:debian-9-x86_64 /bin/bash
|
---|
| 151 | pb --version
|
---|
| 152 | cd /etc/apt/sources.list.d/
|
---|
| 153 | apt-get install gnupg
|
---|
| 154 | wget -qO - ftp://ftp.mondorescue.org/debian/9/pb.pubkey | apt-key add -
|
---|
| 155 | wget ftp://ftp.mondorescue.org/debian/9/pb.sources.list
|
---|
| 156 | apt-get update
|
---|
| 157 | apt-get install project-builder
|
---|
| 158 | pb --version
|
---|
| 159 |
|
---|
| 160 | # On a rpm based distro
|
---|
| 161 | pb -p pb -m fedora-25-x86_64
|
---|
| 162 | docker run -ti pb:fedora-25-x86_64 /bin/bash
|
---|
| 163 | pb --version
|
---|
| 164 | cd /etc/yum.repos.d
|
---|
| 165 | wget ftp://ftp.mondorescue.org/fedora/25/x86_64/pb.repo
|
---|
| 166 | dnf install project-builder
|
---|
| 167 | pb --version
|
---|
| 168 |
|
---|
[1980] | 169 | # WIth VMs
|
---|
[817] | 170 | # Now show how easy it's to build for another project for which I'm upstream
|
---|
[1835] | 171 | -> pb -p mondorescue -m debian-6.0-x86_64 sbx2ve
|
---|
[1288] | 172 |
|
---|
[817] | 173 | # Now show how easy it's to build for another project for which I'm not upstream with patches
|
---|
[1835] | 174 | -> pb -p afio -r 2.5 -m debian-6.0-x86_64 sbx2ve
|
---|
[816] | 175 |
|
---|
[1101] | 176 | # Look at conf files
|
---|
[2252] | 177 | cat ~/.pbrc.yml
|
---|
| 178 | cat /home/rpmbootstrap/.pbrc.yml
|
---|
| 179 | cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio.yml
|
---|
[1838] | 180 | cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio/rpm/afio.spec
|
---|
| 181 | cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio/deb/control
|
---|
[1835] | 182 | ls -R ~/svn-git/pb/projects/afio/pbconf/2.5/
|
---|
[1288] | 183 |
|
---|
| 184 | # Short Lab
|
---|
| 185 | # in pblab account
|
---|
| 186 | # prepa
|
---|
| 187 | # As root
|
---|
| 188 | rm -rf /prj/svn
|
---|
| 189 | svnadmin create /prj/svn
|
---|
| 190 | cat >> /prj/svn/conf/authz << EOF
|
---|
| 191 | [/]
|
---|
| 192 | pblab = rw
|
---|
| 193 | * = r
|
---|
| 194 | EOF
|
---|
| 195 | cat >> /prj/svn/conf/passwd << EOF
|
---|
| 196 | pblab = pblab
|
---|
| 197 | EOF
|
---|
| 198 | cat > /prj/svn/conf/svnserve.conf << EOF
|
---|
| 199 | [general]
|
---|
| 200 | password-db = passwd
|
---|
| 201 | authz-db = authz
|
---|
| 202 | [sasl]
|
---|
| 203 | EOF
|
---|
| 204 | killall svnserve
|
---|
| 205 | ~pblab/bin/rc.local
|
---|
| 206 |
|
---|
| 207 | # as pblab
|
---|
[2252] | 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
|
---|
[2284] | 218 | pbprojurl:
|
---|
[2252] | 219 | afio : ftp://localhost/src/afio-2.5.tar.gz
|
---|
| 220 | pbrepo:
|
---|
| 221 | afio : ftp://localhost
|
---|
[1288] | 222 | EOF
|
---|
| 223 |
|
---|
| 224 | pb -p afio clean
|
---|
[2252] | 225 | cat ~/.pbrc.yml
|
---|
| 226 | cat >> ~/.pbrc.yml << EOF
|
---|
| 227 | ---
|
---|
| 228 | pbconfurl:
|
---|
| 229 | afio: svn://localhost/pb/afio/pbconf
|
---|
[1288] | 230 | EOF
|
---|
[2252] | 231 | echo " pbdefdir:" >> ~/.pbrc.yml
|
---|
| 232 | echo " default: \$ENV{'HOME'}/pb" >> ~/.pbrc.yml
|
---|
[1288] | 233 | mkdir pb
|
---|
| 234 | svn import pb svn://localhost/pb -m "Initial creation of pb repo"
|
---|
| 235 | # passwd asked here
|
---|
| 236 |
|
---|
| 237 | cd pb
|
---|
| 238 | svn co svn://localhost/pb .
|
---|
| 239 | pb -p afio newproj afio
|
---|
| 240 | # passwd asked here
|
---|
| 241 |
|
---|
[2252] | 242 | cat ~/afio.yml.add >> afio/pbconf/afio.yml
|
---|
[1288] | 243 | pb -p afio sbx2build
|
---|
| 244 |
|
---|
| 245 | # with Ubuntu CD
|
---|
[2252] | 246 | cat >> ~/.pbrc.yml << EOF
|
---|
| 247 | vmpath:
|
---|
| 248 | default: /home/qemu
|
---|
[1288] | 249 | EOF
|
---|
| 250 |
|
---|