User:Ncopa/buildmsg: Difference between revisions

From Alpine Linux
No edit summary
(formatting)
Line 1: Line 1:
Note how to set up a new build server using buildmsg
Note how to set up a new build server using buildmsg


 
== vreating new vserver ==
<pre>
build:~# setup-vs-guest
build:~# setup-vs-guest
Hostname for new vserver: build-2-6
Hostname for new vserver: build-2-6
Line 13: Line 14:
Enter template file (or empty for generate a new):  
Enter template file (or empty for generate a new):  
Generating template...
Generating template...
</pre>


cp /etc/vservers/build-2-5/fstab /etc/vservers/build-2-6/
mkdir /vservers/build-2-6/var/cache/distfiles


cp /etc/vservers/build-2-5/fstab /etc/vservers/build-2-6/
echo "~single_ip" >> /etc/vservers/build-2-6/nflags
mkdir /vservers/build-2-6/var/cache/distfiles
cp -a /vservers/build-2-5/root/.ssh/ /vservers/build-2-6/root/
 
echo "~single_ip" >> /etc/vservers/build-2-6/nflags
cp -a /vservers/build-2-5/root/.ssh/ /vservers/build-2-6/root/


# firewall DNAT
=== firewall DNAT ===
iptables -t nat -A PREROUTING -d 91.220.88.36/32 -p tcp -m tcp --dport 22026 -j DNAT --to-destination 192.168.8.26:22
iptables -t nat -A PREROUTING -d 91.220.88.36/32 -p tcp -m tcp --dport 22026 -j DNAT --to-destination 192.168.8.26:22
/etc/init.d/iptables save
/etc/init.d/iptables save
Line 27: Line 28:


vserver build-2-6 start
vserver build-2-6 start
== installing and setting up ssh ==
vserver build-2-6 enter
vserver build-2-6 enter


Line 38: Line 41:
/etc/init.d/sshd restart
/etc/init.d/sshd restart


 
== prepare buildozer user ==
adduser buildozer
adduser buildozer
addgroup buildozer wheel ; addgroup buildozer abuild
addgroup buildozer wheel ; addgroup buildozer abuild
Line 46: Line 49:
  %wheel  ALL=(ALL) NOPASSWD: ALL
  %wheel  ALL=(ALL) NOPASSWD: ALL


cp -a /root/.ssh /home/buildozer/
=== logout from vserver enter ===
cp -a /vservers/build-2-5/home/buildozer/.abuild \
  /vservers/build-2-5/home/buildozer/.abuild \
  /vservers/build-2-6/home/buildozer/


# logout from vserver enter
cp -a /vservers/build-2-5/home/buildozer/.abuild /vservers/build-2-6/home/buildozer/




# log in via ssh from desktop:
# log in via ssh from desktop
ssh -p buildozer@dev.alpinelinux.org
ssh -p buildozer@dev.alpinelinux.org


sudo chown -R buildozer:buildozer .abuild/
sudo chown -R buildozer:buildozer .abuild/


=== verify ssh out ===
vi .ssh/config  
vi .ssh/config  
  Host nl.alpinelinux.org
  Host nl.alpinelinux.org
Port 22014
Port 22014


# test ssh. needed for upload
# test ssh. needed for upload
ssh nl.alpinelinux.org
ssh nl.alpinelinux.org
exit
 


== set up abuild ==
mkdir ~/packages
mkdir ~/packages


Line 79: Line 87:
  ABUILD_LOG_CMD="buildmsg-send --server=tcp://git.alpinelinux.org:55555 log $(hostname): abuild:"
  ABUILD_LOG_CMD="buildmsg-send --server=tcp://git.alpinelinux.org:55555 log $(hostname): abuild:"


== autobuilder/buildmsg ==
git clone git://git.alpinelinux.org/autobuilder
git clone git://git.alpinelinux.org/autobuilder
cd autobuilder
cd autobuilder
sudo apk add rsync lua-posix lua-zmq
make
make
sudo make install
sudo make install
Line 88: Line 96:
  git_branch=master
  git_branch=master
  upload_release=v2.5
  upload_release=v2.5
== /etc/buildmsg/ ==


sudo vi /etc/buildmsg/subscribe.lua  
sudo vi /etc/buildmsg/subscribe.lua  
Line 103: Line 107:


sudo vi /etc/conf.d/buildmsg-subscribe  
sudo vi /etc/conf.d/buildmsg-subscribe  
buildmsg_user="buildozer"
buildmsg_user="buildozer"
buildmsg_group="buildozer"
buildmsg_group="buildozer"


sudo /etc/init.d/buildmsg-subscribe start
sudo /etc/init.d/buildmsg-subscribe start
sudo rc-update add buildmsg-subscribe
sudo rc-update add buildmsg-subscribe

Revision as of 11:58, 24 April 2013

Note how to set up a new build server using buildmsg

vreating new vserver

build:~# setup-vs-guest
Hostname for new vserver: build-2-6
Available network interfaces are: lo eth2 eth3 bond0 dummy0.
Which one to use for build-2-6? (or 'done') [dummy0] 
Enter IP address/mask for dummy0: [192.168.8.99/24] 192.168.8.26/24
Available network interfaces are: lo eth2 eth3 bond0.
Which one to use for build-2-6? (or 'done') [done] 
Enter context id for build-2-6: [10026] 
Enter guest machine architecture (i686 or x86_64): [x86_64] i686
Enter template file (or empty for generate a new): 
Generating template...
cp /etc/vservers/build-2-5/fstab /etc/vservers/build-2-6/
mkdir /vservers/build-2-6/var/cache/distfiles
echo "~single_ip" >> /etc/vservers/build-2-6/nflags
cp -a /vservers/build-2-5/root/.ssh/ /vservers/build-2-6/root/

firewall DNAT

iptables -t nat -A PREROUTING -d 91.220.88.36/32 -p tcp -m tcp --dport 22026 -j DNAT --to-destination 192.168.8.26:22 /etc/init.d/iptables save lbu ci

vserver build-2-6 start

installing and setting up ssh

vserver build-2-6 enter

echo http://dl-3.alpinelinux.org/alpine/v2.5/packages/main > /etc/apk/repositories

apk add -U openssh alpine-sdk rsync lua-posix lua-zmq

sed -i -e 's/\#ListenAddress 0.0.0.0/ListenAddress 192.168.8.26/' /etc/ssh/sshd_config sed -i -e 's/\#UseDNS.*/UseDNS no/' /etc/ssh/sshd_config rc-update add sshd /etc/init.d/sshd restart

prepare buildozer user

adduser buildozer addgroup buildozer wheel ; addgroup buildozer abuild

visudo

# Same thing without a password
%wheel  ALL=(ALL) NOPASSWD: ALL

logout from vserver enter

cp -a /vservers/build-2-5/home/buildozer/.abuild \

 /vservers/build-2-5/home/buildozer/.abuild \ 
 /vservers/build-2-6/home/buildozer/


# log in via ssh from desktop

ssh -p buildozer@dev.alpinelinux.org

sudo chown -R buildozer:buildozer .abuild/

verify ssh out

vi .ssh/config

Host nl.alpinelinux.org

Port 22014

# test ssh. needed for upload
ssh nl.alpinelinux.org
exit


set up abuild

mkdir ~/packages

git clone git://git.alpinelinux.org/aports git clone git://git.alpinelinux.org/alpine-iso

echo "2.5.0" > alpine-iso/previous


sudo vi /etc/abuild.conf

export JOBS=4
#USE_COLORS=1
REPODEST=$HOME/packages/
PACKAGER="Buildozer <alpine-devel@lists.alpinelinux.org>"
ABUILD_LOG_CMD="buildmsg-send --server=tcp://git.alpinelinux.org:55555 log $(hostname): abuild:"

autobuilder/buildmsg

git clone git://git.alpinelinux.org/autobuilder cd autobuilder make sudo make install

sudo vi /etc/autobuilder.conf

git_branch=master
upload_release=v2.5

sudo vi /etc/buildmsg/subscribe.lua

publisher='tcp://dev.alpinelinux.org:55556'
subscriber_command='/etc/buildmsg/buildmsg-script'
subscriber_filter='build master'


sudo vi /etc/buildmsg/client.lua

server='tcp://dev.alpinelinux.org:55555'

sudo vi /etc/conf.d/buildmsg-subscribe

buildmsg_user="buildozer"
buildmsg_group="buildozer"

sudo /etc/init.d/buildmsg-subscribe start sudo rc-update add buildmsg-subscribe