source: ProjectBuilder/devel/pb-doc/pb-demo@ 2084

Last change on this file since 2084 was 2084, checked in by Bruno Cornec, 8 years ago
  • build and delivery directories renamed pbbuild and pbdelivery for consistency and to ease filtering (with git e.g.)
File size: 6.4 KB
Line 
1demo of project-builder.org
2===========================
3
4# First demonstrate the way of working for pb itself
5cd ~/local/pb|~/pb|~/svn-git/pb
6# Show the various versions available in this SVK exported dir
7ls
8# get the current tag of the SVK repository
9svk info|svn info|git svn info
10
11# get the current version of project-builder
12rpm -q project-builder
13pb --help
14pb
15
16# Decide to build a package for project-builder based on that devel version
17# to replace the one currently installed
18pb -p pb -r devel sbx2build|cms2build
19
20# Show the upstream part
21ls -altg /home/bruno/svn-git/pb/pbdelivery/
22tar tvfz /home/bruno/svn-git/pb/pbdelivery/project-builder-develXXX.tar.gz
23
24# Show the pb specific part
25tar tvfz /home/bruno/svn-git/pb/pbdelivery/project-builder-develXXX.pbconf.tar.gz
26
27# Now make the packages
28pb -p pb build2pkg
29
30# Look at the latest pckges created
31ls -altrg /home/bruno/svn-git/pb/pbbuild/RPMS/noarch
32
33# Install the generated packages
34sudo urpmi /home/bruno/svn-git/pb/pbbuild/RPMS/noarch/*.rpm
35
36# Check that it's the right one
37rpm -q project-builder
38pb -h
39git svn info
40
41# Now show how easy it's to build for another distro in a VM
42ls /home/qemu
43-> pb -p pb -m debian-7-x86_64 sbx2vm
44ls -al /var/ftp/pub/pb/test/debian/7/
45ls -al /var/ftp/pub/pb/test/debian/dists/7/
46
47pb -p pb -m mageia-3-i386 sbx2vm
48# Now show how easy it's to build for another distro in a VE
49ls /home/rpmbootstrap
50pb -p pb -m centos-6-x86_64 build2ve
51pb -p pb -m ubuntu-11.10-x86_64 build2ve
52-> pb -p pb -m debian-6.0-x86_64 sbx2ve
53ls -al /var/ftp/pub/pb/test/debian/6.0/
54ls -al /var/ftp/pub/pb/test/debian/dists/6.0/
55
56# Docker part
57# Mount the external HDD if needed
58sudo mount /dev/sdc1 /mnt
59$ sudo mount -o bind /mnt/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
81Mageia release 5 (Official) for x86_64
82[root@8158b86786a7 /]# uname -a
83Linux 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
86installing tcsh-6.18.01-8.mga5.x86_64.rpm from /var/cache/urpmi/rpms
87Preparing... #############################################
88 1/1: tcsh #############################################
89[root@8158b86786a7 /]# pb --help
90bash: pb: command not found
91[root@8158b86786a7 /]# exit
92pb -p pb -m mageia-5-x86_64 -T docker sbx2setupve
93$ docker images | grep mageia-5
94localhost:5000/pb mageia-5-x86_64-pb 43bcfd269f29 2 minutes ago 376.2 MB
95localhost: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
98pb (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
102localhost: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
146cat ~/.pbrc
147cat /home/rpmbootstrap/.pbrc
148cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio.pb
149cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio/rpm/afio.spec
150cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio/deb/control
151ls -R ~/svn-git/pb/projects/afio/pbconf/2.5/
152
153# Short Lab
154# in pblab account
155# prepa
156# As root
157rm -rf /prj/svn
158svnadmin create /prj/svn
159cat >> /prj/svn/conf/authz << EOF
160[/]
161pblab = rw
162* = r
163EOF
164cat >> /prj/svn/conf/passwd << EOF
165pblab = pblab
166EOF
167cat > /prj/svn/conf/svnserve.conf << EOF
168[general]
169password-db = passwd
170authz-db = authz
171[sasl]
172EOF
173killall svnserve
174~pblab/bin/rc.local
175
176# as pblab
177rm -rf pb .pbrc
178cat > afio.pb.add << EOF
179defpkgdir afio = dummy
180pbpackager default = Big Chief <bigchief@hp.com>
181projver afio = 2.5
182projtag afio = 1
183pburl afio = ftp://localhost/src/afio-2.5.tar.gz
184pbrepo afio = ftp://localhost
185EOF
186
187pb -p afio clean
188cat ~/.pbrc
189cat >> ~/.pbrc << EOF
190pbconfurl afio = svn://localhost/pb/afio/pbconf
191EOF
192echo "pbdefdir default = \$ENV{'HOME'}/pb" >> ~/.pbrc
193mkdir pb
194svn import pb svn://localhost/pb -m "Initial creation of pb repo"
195# passwd asked here
196
197cd pb
198svn co svn://localhost/pb .
199pb -p afio newproj afio
200# passwd asked here
201
202cat ~/afio.pb.add >> afio/pbconf/afio.pb
203pb -p afio sbx2build
204
205# with Ubuntu CD
206cat >> ~/.pbrc << EOF
207vmpath default = /home/qemu
208EOF
209
Note: See TracBrowser for help on using the repository browser.