1 | demo of project-builder.org
|
---|
2 | ===========================
|
---|
3 |
|
---|
4 | # First demonstrate the way of working for pb itself
|
---|
5 | cd ~/local/pb|~/pb|~/svn-git/pb
|
---|
6 | # Show the various versions available in this SVK exported dir
|
---|
7 | ls
|
---|
8 | # get the current tag of the SVK repository
|
---|
9 | svk info|svn info|git svn info
|
---|
10 |
|
---|
11 | # get the current version of project-builder
|
---|
12 | rpm -q project-builder
|
---|
13 | pb --help
|
---|
14 | pb
|
---|
15 |
|
---|
16 | # Decide to build a package for project-builder based on that devel version
|
---|
17 | # to replace the one currently installed
|
---|
18 | pb -p pb -r devel sbx2build|cms2build
|
---|
19 |
|
---|
20 | # Show the upstream part
|
---|
21 | ls -altg /home/bruno/svn-git/pb/delivery/
|
---|
22 | tar tvfz /home/bruno/svn-git/pb/delivery/project-builder-develXXX.tar.gz
|
---|
23 |
|
---|
24 | # Show the pb specific part
|
---|
25 | tar tvfz /home/bruno/svn-git/pb/delivery/project-builder-develXXX.pbconf.tar.gz
|
---|
26 |
|
---|
27 | # Now make the packages
|
---|
28 | pb -p pb build2pkg
|
---|
29 |
|
---|
30 | # Look at the latest pckges created
|
---|
31 | ls -altrg /home/bruno/svn-git/pb/build/RPMS/noarch
|
---|
32 |
|
---|
33 | # Install the generated packages
|
---|
34 | sudo urpmi /home/bruno/svn-git/pb/build/RPMS/noarch/*.rpm
|
---|
35 |
|
---|
36 | # Check that it's the right one
|
---|
37 | rpm -q project-builder
|
---|
38 | pb -h
|
---|
39 | git svn info
|
---|
40 |
|
---|
41 | # Now show how easy it's to build for another distro in a VM
|
---|
42 | ls /home/qemu
|
---|
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/
|
---|
46 |
|
---|
47 | pb -p pb -m mageia-3-i386 sbx2vm
|
---|
48 | # Now show how easy it's to build for another distro in a VE
|
---|
49 | ls /home/rpmbootstrap
|
---|
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/
|
---|
55 |
|
---|
56 | # Docker part
|
---|
57 | # Mount the external HDD if needed
|
---|
58 | sudo mount /dev/sdc1 /mnt
|
---|
59 | $ sudo mount -o bind /run/media/bruno/pb+docker/docker /var/cache/docker
|
---|
60 | # Then restart docker to avoid errors with Attempt to write a readonly database
|
---|
61 | $ sudo systemctl restart docker
|
---|
62 | $ sudo systemctl restart docker_registry
|
---|
63 | # Now show how easy it's to build for another distro in a Docker VE
|
---|
64 | # Create Docker container
|
---|
65 | $ docker images
|
---|
66 |
|
---|
67 | # If docker issue with net, restart docker
|
---|
68 | $ sudo ip link delete docker0
|
---|
69 | $ sudo systemctl restart docker.service
|
---|
70 |
|
---|
71 | # Building with rpmbootstrap for a distro
|
---|
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 |
|
---|
106 | # On another distro already preped
|
---|
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 |
|
---|
114 | # Another container Ubuntu 13.10
|
---|
115 | $ pb -p pb -m ubuntu-13.10-x86_64 -T docker build2ve
|
---|
116 | $ ls -al /var/ftp/pub/pb/test/ubuntu/13.10
|
---|
117 |
|
---|
118 | # On another project
|
---|
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
|
---|
123 |
|
---|
124 |
|
---|
125 | # Look at what was created
|
---|
126 | $ docker images
|
---|
127 | $ docker history localhost:5000/pb:mageia-4-x86_64-pb-pb
|
---|
128 |
|
---|
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 | #
|
---|
137 |
|
---|
138 | # WIth VMs
|
---|
139 | # Now show how easy it's to build for another project for which I'm upstream
|
---|
140 | -> pb -p mondorescue -m debian-6.0-x86_64 sbx2ve
|
---|
141 |
|
---|
142 | # Now show how easy it's to build for another project for which I'm not upstream with patches
|
---|
143 | -> pb -p afio -r 2.5 -m debian-6.0-x86_64 sbx2ve
|
---|
144 |
|
---|
145 | # Look at conf files
|
---|
146 | cat ~/.pbrc
|
---|
147 | cat /home/rpmbootstrap/.pbrc
|
---|
148 | cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio.pb
|
---|
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
|
---|
151 | ls -R ~/svn-git/pb/projects/afio/pbconf/2.5/
|
---|
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 |
|
---|