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

Last change on this file since 2079 was 2079, checked in by Bruno Cornec, 8 years ago

Add support for pbr for python project such as python-redfish
Update demo
More API tests added

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