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
|
---|
10 | # get it from SVN directly
|
---|
11 | svn info svn+ssh://svn.mondorescue.org/prj/svn/pb/devel
|
---|
12 |
|
---|
13 | # get the current version of project-builder
|
---|
14 | rpm -q project-builder
|
---|
15 | pb --help
|
---|
16 | pb
|
---|
17 |
|
---|
18 | # Decide to build a package for project-builder based on that devel version
|
---|
19 | # to replace the one currently installed
|
---|
20 | pb -p pb -r devel sbx2build|cms2build
|
---|
21 |
|
---|
22 | # Show the upstream part
|
---|
23 | ls -altg /home/bruno/svn-git/pb/pbdelivery/
|
---|
24 | tar tvfz /home/bruno/svn-git/pb/pbdelivery/project-builder-XXX.tar.gz
|
---|
25 |
|
---|
26 | # Show the pb specific part
|
---|
27 | tar tvfz /home/bruno/svn-git/pb/pbdelivery/project-builder-develXXX.pbconf.tar.gz
|
---|
28 |
|
---|
29 | # Now make the packages
|
---|
30 | pb -p pb build2pkg
|
---|
31 |
|
---|
32 | # Look at the latest packages created
|
---|
33 | ls -altrg /home/bruno/svn-git/pb/pbbuild/RPMS/noarch
|
---|
34 |
|
---|
35 | # Install the generated packages
|
---|
36 | sudo urpmi /home/bruno/svn-git/pb/pbbuild/RPMS/noarch/*.rpm
|
---|
37 |
|
---|
38 | # Check that it's the right one
|
---|
39 | rpm -q project-builder
|
---|
40 | pb -h
|
---|
41 | git svn info
|
---|
42 |
|
---|
43 | # Now show how easy it's to build for another distro in a VM
|
---|
44 | ls /home/qemu
|
---|
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/
|
---|
48 |
|
---|
49 | pb -p pb -m mageia-3-i386 sbx2vm
|
---|
50 | # Now show how easy it's to build for another distro in a VE
|
---|
51 | ls /home/rpmbootstrap
|
---|
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/
|
---|
57 |
|
---|
58 | # Docker part
|
---|
59 | # Mount the external HDD if needed
|
---|
60 | sudo mount /dev/sdc1 /mnt
|
---|
61 | $ sudo mount -o bind /mnt/docker /var/cache/docker
|
---|
62 | # Then restart docker to avoid errors with Attempt to write a readonly database
|
---|
63 | $ sudo systemctl restart docker
|
---|
64 | #$ sudo systemctl restart docker_registry
|
---|
65 | # Now show how easy it's to build for another distro in a Docker VE
|
---|
66 | # Create Docker container
|
---|
67 | $ docker images
|
---|
68 |
|
---|
69 | # If docker issue with net, restart docker
|
---|
70 | $ sudo ip link delete docker0
|
---|
71 | $ sudo systemctl restart docker.service
|
---|
72 |
|
---|
73 | # Building with rpmbootstrap for a distro
|
---|
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}'
|
---|
81 | $ docker run -ti `docker images | grep mageia-5 | awk '{print $3}'` /bin/bash
|
---|
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
|
---|
94 | $ pb -p pb -m mageia-5-x86_64 -T docker sbx2setupve
|
---|
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 |
|
---|
107 | # On another distro already preped
|
---|
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 |
|
---|
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
|
---|
119 |
|
---|
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:
|
---|
124 | # Another container Ubuntu 13.10
|
---|
125 | $ pb -p pb -m ubuntu-15.04-x86_64 -T docker build2ve
|
---|
126 | $ ls -al /var/ftp/pub/pb/test/ubuntu/15.04
|
---|
127 |
|
---|
128 | # On another project
|
---|
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
|
---|
133 |
|
---|
134 | # Look at what was created
|
---|
135 | $ docker images
|
---|
136 | $ docker history localhost:5000/pb:mageia-4-x86_64-pb-pb
|
---|
137 |
|
---|
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 | #
|
---|
146 |
|
---|
147 | # WIth VMs
|
---|
148 | # Now show how easy it's to build for another project for which I'm upstream
|
---|
149 | -> pb -p mondorescue -m debian-6.0-x86_64 sbx2ve
|
---|
150 |
|
---|
151 | # Now show how easy it's to build for another project for which I'm not upstream with patches
|
---|
152 | -> pb -p afio -r 2.5 -m debian-6.0-x86_64 sbx2ve
|
---|
153 |
|
---|
154 | # Look at conf files
|
---|
155 | cat ~/.pbrc
|
---|
156 | cat /home/rpmbootstrap/.pbrc
|
---|
157 | cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio.pb
|
---|
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
|
---|
160 | ls -R ~/svn-git/pb/projects/afio/pbconf/2.5/
|
---|
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 |
|
---|