User:Ncopa/buildmsg: Difference between revisions

From Alpine Linux
 
Line 97: Line 97:


  git_branch=master
  git_branch=master
  upload_release=v2.5
  upload_release=v2.6


  sudo vi /etc/buildmsg/subscribe.lua  
  sudo vi /etc/buildmsg/subscribe.lua  

Latest revision as of 12:35, 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://nl.alpinelinux.org/alpine/edge/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/.ssh \ 
 /vservers/build-2-6/home/buildozer/


# log in via ssh from desktop
ssh -p buildozer@dev.alpinelinux.org
sudo chown -R buildozer:buildozer .abuild/ .ssh/

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
SRCDEST=/var/cache/distfiles/v2.6
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.6
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