ΠΠΎΡΡΠ΅Π±ΠΎΠ²Π°Π»ΠΎΡΡ ΠΌΠ½Π΅ Π½Π°ΡΡΡΠΎΠΈΡΡ ΠΏΡΠΎΡΠ΅ΡΡ ΡΠ±ΠΎΡΠΊΠΈ ΠΈ Π΄ΠΎΡΡΠ°Π²ΠΊΠΈ Π½Π° ΡΠ°ΠΉΡ ΠΏΠ°ΠΊΠ΅ΡΠΎΠ² ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌ ΠΈΠ· Git-ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠ°ΡΠΈΡ. Π ΡΠ²ΠΈΠ΄Π΅Π², Π½ΠΈ ΡΠ°ΠΊ Π΄Π°Π²Π½ΠΎ, ΡΡΡ Π½Π° Π₯Π°Π±ΡΠ΅ ΡΡΠ°ΡΡΡ ΠΏΠΎ buildbot (ΡΡΡΠ»ΠΊΠ° Π² ΠΊΠΎΠ½ΡΠ΅) ΡΠ΅ΡΠΈΠ» Π΄Π»Ρ ΡΡΠΎΠ³ΠΎ ΠΏΠΎΠΏΡΠΎΠ±ΠΎΠ²Π°ΡΡ Π΅Π³ΠΎ ΠΈ ΠΏΡΠΈΠΌΠ΅Π½ΠΈΡΡ.
Π’Π°ΠΊ ΠΊΠ°ΠΊ buildbot β ΡΡΠΎ ΡΠ°ΡΠΏΡΠ΅Π΄Π΅Π»ΡΠ½Π½Π°Ρ ΡΠΈΡΡΠ΅ΠΌΠ°, ΡΠΎ Π±ΡΠ΄Π΅Ρ Π»ΠΎΠ³ΠΈΡΠ½ΡΠΌ ΠΏΠΎΠ΄ ΠΊΠ°ΠΆΠ΄ΡΡ Π°ΡΡ ΠΈΡΠ΅ΠΊΡΡΡΡ ΠΈ ΠΎΠΏΠ΅ΡΠ°ΡΠΈΠΎΠ½ΠΊΡ ΡΠ΄Π΅Π»Π°ΡΡ ΠΎΡΠ΄Π΅Π»ΡΠ½ΡΠΉ ΡΠ±ΠΎΡΠΎΡΠ½ΡΠΉ Ρ ΠΎΡΡ. Π Π½Π°ΡΠ΅ΠΌ ΡΠ»ΡΡΠ°Π΅ ΡΡΠΎ Π±ΡΠ΄ΡΡ LXC-ΠΊΠΎΠ½ΡΠ΅ΠΉΠ½Π΅ΡΡ (Π² ΡΠ»ΡΡΠ°Π΅ linux) ΠΈ qemu (Π² ΡΠ»ΡΡΠ°Π΅ windows):
- vm-srv-build1 β centos 7, ΡΡΡ Π±ΡΠ΄Π΅Ρ buildbot ΠΌΠ°ΡΡΠ΅Ρ (master) ΠΈ ΠΎΠ΄ΠΈΠ½ ΠΈΠ· ΡΠ°Π±ΠΎΡΠΈΡ (worker)
- vm-srv-build2 β debian 10, Π΄Π»Ρ ΡΠ±ΠΎΡΠΊΠΈ DEB ΠΏΠ°ΠΊΠ΅ΡΠΎΠ²
- vm-srv-build3 β windows 10, Π΄Π»Ρ ΡΠ±ΠΎΡΠΊΠΈ, ΡΠ°ΠΌΠΈ ΠΏΠΎΠ½ΠΈΠΌΠ°Π΅ΡΠ΅, ΠΏΠΎΠ΄ ΡΡΠΎ
Π‘ΠΎΠ±ΠΈΡΠ°ΡΡ Π±ΡΠ΄Π΅ΠΌ
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ°
GNU/Linux
ΠΠΎ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠ΅, Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ Π² ΡΠ΅ΡΠΈ Π΄ΠΎΡΡΠ°ΡΠΎΡΠ½ΠΎ
ΠΠ»Ρ ΠΌΠ°ΡΡΠ΅ΡΠ°:
pip3 install buildbot
pip3 install twisted
pip3 install autobahn
pip3 install pysqlite3
pip3 install sqlalchemy sqlalchemy-migrate
pip3 install buildbot-www buildbot-grid-view buildbot-console-view buildbot-waterfall-view
pip3 install python-dateutil
ΠΠ»Ρ «ΡΠ°Π±ΠΎΡΠΈΡ », Π΄ΠΎΡΡΠ°ΡΠΎΡΠ½ΠΎΠ³ΠΎ ΡΡΠΎΠ³ΠΎ:
pip3 install buildbot-worker
ΠΠΎΠ½Π΅ΡΠ½ΠΎ, Π±ΠΎΠ»Π΅Π΅ ΠΏΡΠ°Π²ΠΈΠ»ΡΠ½ΡΠΌ Π±ΡΠ΄Π΅Ρ ΡΠΎΠ±ΡΠ°ΡΡ ΠΏΠ°ΠΊΠ΅ΡΡ ΠΏΠΎΠ΄ ΠΊΠ°ΠΆΠ΄ΡΡ ΠΠ‘, Π½ΠΎ ΡΡΠΎ Π² ΡΠ°ΠΌΠΊΠΈ ΡΡΠ°ΡΡΠΈ Π½Π΅ Π²Ρ ΠΎΠ΄ΠΈΡ. Π’Π°ΠΊΠΆΠ΅ ΠΎΠΏΡΡΡΠΈΠΌ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ Π½Π°ΡΡΡΠΎΠΉΠΊΠΈ ΠΊΠΎΠ½ΡΠ΅ΠΉΠ½Π΅ΡΠΎΠ² Π΄Π»Ρ ΡΠ°Π±ΠΎΡΡ, ΠΎΡΠΌΠ΅ΡΡ ΡΠΎΠ»ΡΠΊΠΎ, ΡΡΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡ ProxMox VE. Π Π΅ΡΡ ΠΏΠΎΡΡΠ΅Π±ΡΠ΅ΡΡΡ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ ΠΏΠ°ΠΊΠ΅ΡΡ ΠΏΠΎΠ΄ ΠΊΠ°ΠΆΠ΄ΡΡ ΠΎΡΡ ΠΏΠΎΡΡΠ΅Π±Π½ΡΠ΅ Π΄Π»Ρ ΡΠ±ΠΎΡΠΊΠΈ (centos: rpmdevtools ΠΈ Ρ.Π΄; debian: build-essential, dh-make, pbuilder ΠΈ Ρ.Π΄.)
Π‘Π±ΠΎΡΠΊΠ° ΠΏΡΠΎΠ΅ΠΊΡΠΎΠ² ΠΈ ΡΠ΅ΡΠ²ΠΈΡΡ buildbot Π±ΡΠ΄ΡΡ Π·Π°ΠΏΡΡΠΊΠ°ΡΡΡΡ ΠΎΡ ΠΈΠΌΠ΅Π½ΠΈ Π½Π΅ΠΏΡΠΈΠ²ΠΈΠ»Π΅Π³ΠΈΡΠΎΠ²Π°Π½Π½ΠΎΠ³ΠΎ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ, ΠΏΠΎΡΡΠΎΠΌΡ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ Π΅Π³ΠΎ ΡΠΎΠ·Π΄Π°ΡΡ Π½Π° Π²ΡΠ΅Ρ Ρ ΠΎΡΡΠ°Ρ , ΡΡΠ°ΡΡΠ²ΡΡΡΠΈΡ Π² ΠΏΡΠΎΡΠ΅ΡΡΠ΅:
adduser buildbot
ΠΠ°Π»ΡΡΠ΅ Π½Π°ΡΡΡΠΎΠΈΠΌ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΠΉ Π·Π°ΠΏΡΡΠΊ ΡΠ΅ΡΠ²ΠΈΡΠΎΠ², ΡΠΎΠΎΡΠ²Π΅ΡΡΡΠ²Π΅Π½Π½ΠΎ Π½Π° ΠΊΠ°ΠΆΠ΄ΠΎΠΌ ΠΈΠ· Ρ ΠΎΡΡΠΎΠ² (ΠΊΠΎΠ½ΡΠ΅ΠΉΠ½Π΅ΡΠΎΠ²):
Systemd ΡΠ½ΠΈΡ Π΄Π»Ρ Π·Π°ΠΏΡΡΠΊΠ° ΠΌΠ°ΡΡΠ΅ΡΠ°:
touch /etc/systemd/buildbot-master.service
[Unit]
Description=BuildBot master service
After=network.target
[Service]
User=buildbot
Group=buildbot
WorkingDirectory=/home/buildbot/master
ExecStart=/usr/local/bin/buildbot start --nodaemon
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
ΠΈ «ΡΠ°Π±ΠΎΡΠ΅Π³ΠΎ»
touch /etc/systemd/buildbot-worker.service
[Unit]
Description=BuildBot worker service
After=network.target
[Service]master
User=buildbot
Group=buildbot
WorkingDirectory=/home/buildbot/worker
ExecStart=/usr/local/bin/buildbot-worker start --nodaemon
[Install]
WantedBy=buildbot-master.service
Π’Π°ΠΊ ΠΊΠ°ΠΊ Π²ΡΠ΅ ΡΠΊΡΠΈΠΏΡΡ (Π² Π½Π°ΡΠ΅ΠΌ ΡΠ»ΡΡΠ°Π΅) Π»Π΅ΠΆΠ°Ρ Π² /usr/local/, ΡΠΎ ΡΠ»Π΅Π΄ΡΠ΅Ρ ΠΏΡΠΎΠΏΠΈΡΠ°ΡΡ ΠΏΡΡΡ ΠΊ Π½ΠΈΠΌ Π² ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ ΠΎΠΊΡΡΠΆΠ΅Π½ΠΈΡ:
nano /root/.bash_profile
PATH=$PATH:$HOME/.local/bin:$HOME/bin:/usr/local/bin
ΠΠΎΡΠ»Π΅ ΡΡΠΎΠ³ΠΎ, ΠΌΠΎΠΆΠ½ΠΎ ΡΠΎΠ·Π΄Π°ΡΡ ΠΈΠ½ΡΡΠ°ΡΡΡΡΠΊΡΡΡΡ ΠΊΠ°ΡΠ°Π»ΠΎΠ³ΠΎΠ² Π΄Π»Ρ «ΡΠ°Π±ΠΎΡΠΈΡ » (Π½Π° Π²ΡΠ΅Ρ Ρ ΠΎΡΡΠ°Ρ ), Π΄Π»Ρ ΡΡΠΎΠ³ΠΎ ΡΠ΅Π³ΠΈΡΡΡΠΈΡΡΠ΅ΡΡΡ ΠΏΠΎΠ΄ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Π΅ΠΌ buildbot ΠΈ Π²ΡΠΏΠΎΠ»Π½ΡΠ΅ΠΌ ΡΠ»Π΅Π΄ΡΡΡΠΈΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ:
ΠΠ° ΠΏΠ΅ΡΠ²ΠΎΠΌ Ρ ΠΎΡΡΠ΅ vm-srv-build1:
su - buildbot
mkdir /home/buildbot/worker
cd ~
buildbot-worker create-worker --umask=0o22 --keepalive=60 worker vm-srv-build1:4000 CentOS 123456
ΠΠ° Π²ΡΠΎΡΠΎΠΌ Ρ ΠΎΡΡΠ΅ vm-srv-build2:
su - buildbot
mkdir /home/buildbot/worker
cd ~
buildbot-worker create-worker --umask=0o22 --keepalive=60 worker vm-srv-build1:4000 Debian-10 123456
ΠΠ° Ρ ΠΎΡΡΠ°Ρ -ΡΠ°Π±ΠΎΡΠΈΡ ΡΠ»ΡΠΆΠ±Ρ buildbot-worker ΠΌΠΎΠΆΠ½ΠΎ Π·Π°ΠΏΡΡΡΠΈΡΡ
systemctl start buildbot-worker
MS Windows
Π ΠΊΠ°ΡΠ΅ΡΡΠ²Π΅ «ΡΠ°Π±ΠΎΡΠ΅Π³ΠΎ» Π΄Π»Ρ ΡΠ±ΠΎΡΠΊΠΈ ΠΏΠΎΠ΄ windows, Π±ΡΠ΄Π΅Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½Π° Π²ΠΈΡΡΡΠ°Π»ΡΠ½Π°Ρ ΠΌΠ°ΡΠΈΠ½Π° Ρ ΠΏΠΎΡΠ»Π΅Π΄Π½ΠΈΠΌ ΡΠ΅Π»ΠΈΠ·ΠΎΠΌ Win10.
ΠΠ»Ρ ΡΠ°Π±ΠΎΡΡ ΠΏΠΎΠ½Π°Π΄ΠΎΠ±ΠΈΡΡΡΡ:
Python PyWIN Git - ΠΠ»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ Π²ΡΡΠΊΠΎΠ³ΠΎ-ΡΠ°Π·Π½ΠΎΠ³ΠΎ Π² ΠΏΠΈΡΠΎΠ½Π΅ ΠΏΠΎΠ½Π°Π΄ΠΎΠ±ΠΈΠ»ΠΎΡΡ ΡΠΊΠ°ΡΠ°ΡΡ
Build Tools for Visual Studio 2019 - 7Zip
ΠΠΎΡΠ»Π΅ ΡΠΎΠ³ΠΎ, ΠΊΠ°ΠΊ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡΡ Π²ΡΡ Π²ΡΡΠ΅ΠΏΠ΅ΡΠ΅ΡΠΈΡΠ»Π΅Π½Π½ΠΎΠ΅, ΠΌΠΎΠΆΠ½ΠΎ ΠΏΠΎΡΡΠ°Π²ΠΈΡΡ ΠΈ ΡΠ°ΠΌ buildbot:
pip install buildbot-worker
Π‘ΠΎΠ·Π΄Π°Π΄ΠΈΠΌ ΡΠ°Π±ΠΎΡΠΈΠΉ ΠΊΠ°ΡΠ°Π»ΠΎΠ³
md c:worker
Π Π·Π°ΠΏΡΡΡΠΈΠΌ
buildbot-worker start c:worker
ΠΡΠ»ΠΈ Π²ΡΡ ΡΠ°Π±ΠΎΡΠ°Π΅Ρ (ΡΠΌ. Π»ΠΎΠ³ c:workertwistd.log), ΡΠΎ ΠΌΠΎΠΆΠ½ΠΎ Π½Π°ΡΠ΅Π³ΠΎ «ΡΠ°Π±ΠΎΡΠ΅Π³ΠΎ», Π·Π°ΡΠ΅Π³ΠΈΡΡΡΠΈΡΠΎΠ²Π°ΡΡ ΠΊΠ°ΠΊ ΡΠ»ΡΠΆΠ±Ρ, Π΄ΠΎΠ±Π°Π²ΠΈΠ² Π² ΡΠ΅Π΅ΡΡΡ ΠΏΡΠ½ΠΊΡ Ρ ΡΠ°Π±ΠΎΡΠΈΠΌ ΠΊΠ°ΡΠ°Π»ΠΎΠ³ΠΎΠΌ (ΠΊΠΎΠΌΠ°Π½Π΄Ρ Π²ΡΠΏΠΎΠ»Π½ΡΡΡΡΡ Π² powershell Π·Π°ΠΏΡΡΠ΅Π½Π½ΠΎΠΌ ΠΎΡ ΠΈΠΌΠ΅Π½ΠΈ Π°Π΄ΠΌΠΈΠ½ΠΈΡΡΡΠ°ΡΠΎΡΠ°):
buildbot_worker_windows_service.exe --user VM-SRV-BUILD3buildbot --password 123456 --startup auto install
New-ItemProperty -path Registry::HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesBuildBotParameters -Name directories -PropertyType String -Value c:worker
Π ΠΌΠΎΠΆΠ½ΠΎ Π·Π°ΠΏΡΡΠΊΠ°ΡΡ ΡΠ»ΡΠ±ΠΆΡ
Start-Service buildbot
Π‘ «ΡΠ°Π±ΠΎΡΠΈΠΌΠΈ» Π½Π° ΡΡΠΎΠΌ Π²ΡΡ, Π΄Π°Π»ΡΡΠ΅ ΠΈΡ ΠΌΠΎΠΆΠ½ΠΎ Π½Π΅ ΡΡΠΎΠ³Π°ΡΡ, Π²ΡΡ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅ ΠΈΠ΄ΡΡ Ρ ΠΌΠ°ΡΡΠ΅ΡΠ°.
ΠΠ°ΡΡΡΠΎΠΉΠΊΠ° ΠΌΠ°ΡΡΠ΅ΡΠ°
ΠΠ»Ρ Π½Π°ΡΠ°Π»Π°, ΡΠΎΠ·Π΄Π°Π΄ΠΈΠΌ ΠΈΠ½ΡΡΠ°ΡΡΡΡΠΊΡΡΡΡ Π΄Π»Ρ ΠΌΠ°ΡΡΠ΅ΡΠ° (Π½Π° Π³Π»Π°Π²Π½ΠΎΠΌ Ρ ΠΎΡΡΠ΅), Π΄Π»Ρ ΡΡΠΎΠ³ΠΎ ΡΠ΅Π³ΠΈΡΡΡΠΈΡΡΠ΅ΡΡΡ ΠΏΠΎΠ΄ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Π΅ΠΌ buildbot ΠΈ Π²ΡΠΏΠΎΠ»Π½ΡΠ΅ΠΌ ΡΠ»Π΅Π΄ΡΡΡΠΈΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ:
su - buildbot
mkdir /home/buildbot/master
cd ~
buildbot create-master master
ΠΠ»Ρ Π³ΠΎΡΠΎΠ²ΡΡ ΠΏΠ°ΠΊΠ΅ΡΠΎΠ² ΡΠΎΠ·Π΄Π°Π΄ΠΈΠΌ ΠΊΠ°ΡΠ°Π»ΠΎΠ³ builds
mkdir /home/buildbot/builds
Π ΠΊΠ°ΡΠ°Π»ΠΎΠ³Π΅ /home/buildbot/master/ Π±ΡΠ» ΡΠΎΠ·Π΄Π°Π½ ΡΠ°ΠΉΠ» master.cfg. ΠΠ°Π½Π½ΡΠΉ ΡΠ°ΠΉΠ» ΠΏΡΠ΅Π΄ΡΡΠ°Π²Π»ΡΠ΅Ρ ΡΠΎΠ±ΠΎΠΉ ΠΊΠΎΠ΄ Π½Π° python ΠΈ ΡΠΎΠ΄Π΅ΡΠΆΠΈΡ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ Π²ΡΠ΅Ρ ΠΌΠ΅Ρ Π°Π½ΠΈΠ·ΠΌΠΎΠ² ΡΠ°Π±ΠΎΡΡ ΡΠΈΡΡΠ΅ΠΌΡ, Ρ Π½ΠΈΠΌ ΠΈ Π±ΡΠ΄Π΅ΠΌ ΡΠ°Π±ΠΎΡΠ°ΡΡ Π² Π΄Π°Π»ΡΠ½Π΅ΠΉΡΠ΅ΠΌ.
nano /home/buildbot/master/master.cfg
import os, re
from buildbot.plugins import steps, util, schedulers, worker, changes, reporters
c= BuildmasterConfig ={}
# ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅ Π½Π°ΡΠΈΡ
ΡΠ°Π±ΠΎΡΠΈΡ
.
c['workers'] = [ worker.Worker('CentOS', '123456'), worker.Worker('Debian-10', '123456'), worker.Worker('Windows-10', '123456')]
c['protocols'] = {'pb': {'port': 4000}}
# Π£ΠΊΠ°Π·Π°Π½ΠΈΠ΅ ΠΌΠ°ΡΡΠ΅ΡΡ ΠΊΠ°ΠΊΠΎΠΉ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ ΠΎΡΡΠ»Π΅ΠΆΠΈΠ²Π°ΡΡ
c['change_source'] = []
c['change_source'].append(changes.GitPoller(
repourl = 'https://bitbucket.org/svk28/rac-gui.git',
project = 'Rac-GUI',
branches = True,
pollInterval = 60
)
)
# ΡΠ»ΡΠΆΠ±Π° Π·Π°ΠΏΡΡΠΊΠ° ΡΠ±ΠΎΡΠΊΠΈ
c['schedulers'] = []
c['schedulers'].append(schedulers.SingleBranchScheduler(
name="Rac-GUI-schedulers",
change_filter=util.ChangeFilter(branch='master'),
builderNames=["Rac-GUI-RPM-builder", "Rac-GUI-DEB-builder", "Rac-GUI-WIN-builder"],
properties = {'owner': 'admin'}
)
)
@util.renderer
######################################3
# Π‘Π±ΠΎΡΠΊΠ° RPM-ΠΏΠ°ΠΊΠ΅ΡΠ°
rac_gui_build_RPM = util.BuildFactory()
rac_gui_build_RPM.addStep(steps.Git(
repourl = 'https://bitbucket.org/svk28/rac-gui.git',
workdir = 'rac-gui',
haltOnFailure = True,
submodules = True,
mode='full',
progress = True)
)
ΠΠ»Ρ Π°Π²ΡΠΎΠΌΠ°ΡΠΈΠ·Π°ΡΠΈΠΈ ΡΠ±ΠΎΡΠΊΠΈ ΠΏΠ°ΠΊΠ΅ΡΠΎΠ² ΡΠ°Π·Π½ΡΡ Π²Π΅ΡΡΠΈΠΉ, Π΄Π°Π±Ρ Π½Π΅ ΠΏΡΠΈΡ ΠΎΠ΄ΠΈΠ»ΠΎΠΎΡΡ Π»Π°Π·ΠΈΡΡ Π² ΠΊΠΎΠ΄ ΡΠ°ΠΉΠ»Π° master.cfg, Π² ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠΌ ΡΠΊΡΠΈΠΏΡΠ΅ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ rac_gui.tcl Π² Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠ΅, Π΄ΠΎΠ±Π°Π²Π»Π΅Π½Ρ ΡΡΡΠΎΠΊΠΈ Ρ ΡΠ΅ΠΊΡΡΠΈΠΌΠΈ Π²Π΅ΡΡΠΈΠ΅ΠΉ ΠΈ ΡΠ΅Π»ΠΈΠ·ΠΎΠΌ:
######################################################
# Rac GUI
...
# version: 1.0.3
# release: 1
Π Π½Π° ΠΎΡΠ½ΠΎΠ²Π΅ ΡΡΠΈΡ ΡΡΡΠΎΠΊ buildbot Π±ΡΠ΄Π΅Ρ Π½ΡΠΌΠ΅ΡΠΎΠ²Π°ΡΡ ΠΏΠ°ΠΊΠ΅ΡΡ. ΠΠ»Ρ Π²ΡΠ΄ΡΡΠ³ΠΈΠ²Π°Π½ΠΈΡ Π΄Π°Π½Π½ΡΡ , ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ Π²ΡΠ·ΠΎΠ² ΠΊΠΎΠ½ΡΠΎΠ»ΡΠ½ΠΎΠ³ΠΎ grep. Π buildbot ΠΏΡΠΎΡΡΠΎ ΡΠ°ΠΊ Π½Π΅Π»ΡΠ·Ρ ΠΎΠΏΠ΅ΡΠ΅Π΄Π΅Π»ΠΈΡΡ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ Π΄Π»Ρ «ΡΠ°Π±ΠΎΡΠΈΡ » (Π²ΠΎ Π²ΡΡΠΊΠΎΠΌ ΡΠ»ΡΡΠ°Π΅, Ρ Π½Π΅ Π½Π°ΡΡΠ» ΠΊΠ°ΠΊ). ΠΠ»Ρ ΡΡΠΎΠ³ΠΎ ΡΠ»ΡΠΆΠ°Ρ ΡΠ²ΠΎΠΉΡΡΠ²Π° (property). Π’.Π΅. Π² ΡΠ±ΠΎΡΠΎΡΠ½ΡΠΉ ΠΏΡΠΎΡΠ΅ΡΡ, Π΄ΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ ΡΠ°Π³ΠΈ ΠΏΠΎ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΡ Π²Π΅ΡΡΠΈΠΈ ΠΈ ΡΠ΅Π»ΠΈΠ·Π° ΠΈ ΡΠΎΠΎΡΠ²Π΅ΡΡΠ²Π΅Π½Π½ΠΎ, ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΡΠ²ΠΎΠΉΡΡΠ²Π° version ΠΈ release. Π‘Π²ΠΎΠΉΡΡΠ²Π° ΠΌΠΎΠΆΠ½ΠΎ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°ΡΡ ΡΠ°Π·Π»ΠΈΡΠ½ΡΠΌΠΈ ΡΠΏΠΎΡΠΎΠ±Π°ΠΌΠΈ, Π² Π΄Π°Π½Π½ΠΎΠΌ ΡΠ»ΡΡΠ°Π΅ ΡΡΠΎ Π²ΡΠ·ΠΎΠ² ΠΊΠΎΠ½ΡΠΎΠ»ΡΠ½ΠΎΠΉ ΠΊΠΎΠΌΠ°Π½Π΄Ρ:
# ΠΠΎΠ±Π°Π²ΠΈΠΌ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Π²Π΅ΡΡΠΈΠΈ ΠΈΠ· ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ³ΠΎ ΡΠ°ΠΉΠ»Π°
rac_gui_build_RPM.addStep(
steps.SetPropertyFromCommand(
command="grep version ../rac-gui/rac_gui.tcl | grep -oE 'b[0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2}b'", property="version"
)
)
# ΠΠΎΠ±Π°Π²ΠΈΠΌ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ ΡΠ΅Π»ΠΈΠ·Π° ΠΈΠ· ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ³ΠΎ ΡΠ°ΠΉΠ»Π°
rac_gui_build_RPM.addStep(
steps.SetPropertyFromCommand(
command="grep release ../rac-gui/rac_gui.tcl | grep -oE 'b[0-9]{1,3}b'", property="release"
)
)
ΠΠΎΠ΄ΡΡΠ°Π²Π»ΡΡΡ ΠΏΠΎΠ»ΡΡΠ΅Π½Π½ΡΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΡ ΠΌΠΎΠΆΠ½ΠΎ ΠΏΡΡΡΠΌ Π²ΡΠ·ΠΎΠ²Π° util.Interpolate().
# ΠΠ°ΠΏΠ°ΠΊΡΠ΅ΠΌ ΠΈΡΡ
ΠΎΠ΄Π½ΠΈΠΊΠΈ
rac_gui_build_RPM.addStep(
steps.ShellCommand(
command=["tar", "czf", util.Interpolate("/home/buildbot/rpmbuild/SOURCES/rac-gui-%(prop:version)s-%(prop:release)s.tar.gz"), "../rac-gui"]
)
)
Π’ΡΡ ΡΠ»Π΅Π΄ΡΠ΅Ρ Π·Π°ΠΌΠ΅ΡΠΈΡΡ ΡΡΠΎ, ΡΠ°ΠΊ ΠΊΠ°ΠΊ Ρ ΠΎΡΡ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ ΠΈ Π΄Π»Ρ ΡΡΡΠ½ΠΎΠΉ ΡΠ±ΠΎΡΠΊΠΈ ΠΏΠ°ΠΊΠ΅ΡΠΎΠ², ΡΠΎ ΡΠ±ΠΎΡΠΊΠ° Π±ΡΠ΄Π΅Ρ ΠΏΡΠΎΡ ΠΎΠ΄ΠΈΡΡ ΠΏΠΎ ΡΡΠ°Π½Π΄Π°ΡΡΠ½ΡΠΌ ΠΏΡΡΡΠΌ.
# ΠΠΎΠΏΠΈΡΡΠ΅ΠΌ spec
rac_gui_build_RPM.addStep(steps.ShellCommand(
command=["cp", "../rac-gui/rac_gui.spec", "/home/buildbot/rpmbuild/SPECS/rac_gui.spec"]))
ΠΠ»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ ΠΊΠΎΡΡΠ΅ΠΊΡΠ½ΡΡ Π½ΠΎΠΌΠ΅ΡΠΎΠ² ΡΠ΅Π»ΠΈΠ·Π° ΠΈ Π²Π΅ΡΡΠΈΠΈ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ Π²ΡΠ·ΠΎΠ² ΡΡΠ°Π½Π΄Π°ΡΠ½ΠΎΠ³ΠΎ sed, Ρ.Π΅. ΠΊΠΎΠΌΠ°Π½Π΄Π° Π·Π°ΠΌΠ΅Π½ΡΠ΅Ρ Π·Π½Π°ΡΠ΅Π½ΠΈΡ Π²Π½ΡΡΡΠΈ spec-ΡΠ°ΠΉΠ»Π° Π½Π° Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΡΠ΅
# ΠΌΠ΅Π½ΡΠ΅ΠΌ Π²Π΅ΡΡΠΈΡ
rac_gui_build_RPM.addStep(steps.ShellCommand(
command=["sed", "-i", util.Interpolate("s/.*Version:.*/Version:t%(prop:version)s/"), "/home/buildbot/rpmbuild/SPECS/rac_gui.spec"]))
# ΠΌΠ΅Π½ΡΠ΅ΠΌ ΡΠ΅Π»ΠΈΠ·
rac_gui_build_RPM.addStep(steps.ShellCommand(
command=["sed", "-i", util.Interpolate("s/.*Release:.*/Release:t%(prop:release)s/"), "/home/buildbot/rpmbuild/SPECS/rac_gui.spec"]))
# Π·Π°ΠΏΡΡΠΊΠ°Π΅ΠΌ ΠΏΡΠΎΡΠ΅ΡΡ ΡΠ±ΠΎΡΠΊΠΈ
rac_gui_build_RPM.addStep(steps.RpmBuild(
specfile="/home/buildbot/rpmbuild/SPECS/rac_gui.spec",
dist='.el5',
topdir='/home/buildbot/rpmbuild',
builddir='/home/buildbot/rpmbuild/build',
rpmdir='/home/buildbot/rpmbuild/RPMS',
sourcedir='/home/buildbot/rpmbuild/SOURCES'
)
)
ΠΠΎΡΠΎΠ²ΡΠΉ ΡΠΎΠ±ΡΠ°Π½ΡΠΉ ΠΏΠ°ΠΊΠ΅Ρ ΠΈ Π°ΡΡ ΠΈΠ² Ρ ΠΈΡΡ ΠΎΠ΄Π½ΠΈΠΊΠ°ΠΌΠΈ ΠΊΠΎΠΏΠΈΡΡΠ΅ΠΌ Π½Π° ΠΌΠ°ΡΡΠ΅Ρ. ΠΠΎ ΠΌΠΎΠΆΠ½ΠΎ ΠΈ ΡΡΠ°Π·Ρ Ρ ΡΠ°Π±ΠΎΡΠ΅Π³ΠΎ ΡΠ°ΠΉΠ»Ρ ΠΊΠΎΠΏΠΈΡΠΎΠ²Π°ΡΡ Π² ΡΠ²ΠΎΠΉ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ ΠΈΠ»ΠΈ Π½Π° ΡΠ°ΠΉΡ.
# Π‘ΠΊΠΎΠΏΠΈΡΡΠ΅ΠΌ ΡΠ°ΠΉΠ» Π½Π° ΠΌΠ°ΡΡΠ΅Ρ
rac_gui_build_RPM.addStep(
steps.FileUpload(
workersrc=util.Interpolate("/home/buildbot/rpmbuild/RPMS/noarch/rac-gui-%(prop:version)s-%(prop:release)s.noarch.rpm"),
masterdest=util.Interpolate("/home/buildbot/builds/rac-gui-%(prop:version)s-%(prop:release)s.noarch.rpm")
)
)
rac_gui_build_RPM.addStep(
steps.FileUpload(
workersrc=util.Interpolate("/home/buildbot/rpmbuild/SOURCES/rac-gui-%(prop:version)s-%(prop:release)s.tar.gz"),
masterdest=util.Interpolate("/home/buildbot/builds/rac-gui-%(prop:version)s-%(prop:release)s.tar.gz")
)
)
ΠΠ°ΠΏΡΡΡΠΈΠΌ Π½Π° ΠΌΠ°ΡΡΠ΅ΡΠ΅ ΠΏΡΠΎΡΠ΅ΡΡ ΠΊΠΎΠΏΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΡΠΎΠ±ΡΠ°Π½Π½ΡΡ
ΠΏΠ°ΠΊΠ΅ΡΠΎΠ² Π½Π° Ρ
ΠΎΡΡΠΈΠ½Π³ ΠΏΠΎ ΡΡΠΏ. ΠΠ»Ρ ΡΡΠΎΠ³ΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ
rac_gui_build_RPM.addStep(
steps.MasterShellCommand(
command=["/usr/local/bin/deploy-ftp.tcl",
util.Interpolate("--local-file=/home/buildbot/builds/rac-gui-%(prop:version)s-%(prop:release)s.noarch.rpm"),
util.Interpolate("--remote-file=uploads/rac-gui/rac-gui-%(prop:version)s-%(prop:release)s.noarch.rpm")]
)
)
rac_gui_build_RPM.addStep(
steps.MasterShellCommand(
command=["/usr/local/bin/deploy-ftp.tcl",
util.Interpolate("--local-file=/home/buildbot/builds/rac-gui-%(prop:version)s-%(prop:release)s.tar.gz"),
util.Interpolate("--remote-file=uploads/rac-gui/rac-gui-%(prop:version)s-%(prop:release)s.tar.gz")]
)
)
ΠΠ° ΡΡΠΎΠΌ Ρ RPM Π·Π°ΠΊΠΎΠ½ΡΠΈΠ»ΠΈ. Π’Π΅ΠΏΠ΅ΡΡ ΠΏΡΠΈΡΡΡΠΏΠΈΠΌ ΠΊ ΠΎΠΏΠΈΡΠ°Π½ΠΈΡ Π°Π»Π³ΠΎΡΠΈΡΠΌΠ° ΡΠ±ΠΎΡΠΊΠΈ DEB-ΠΏΠ°ΠΊΠ΅ΡΠ°. Π’Π°ΠΊ ΠΊΠ°ΠΊ ΠΏΡΠΎΡΠ΅ΡΡΡ ΡΠ±ΠΎΡΠΊΠΈ ΠΏΠ°ΠΊΠ΅ΡΠΎΠ² ΠΏΠΎΠ΄ ΡΠ°Π·Π½ΡΠ΅ ΡΠΈΡΡΠ΅ΠΌΡ Π½Π΅Π·Π°Π²ΠΈΡΠΈΠΌΡ Π΄ΡΡΠ³ ΠΎΡ Π΄ΡΡΠ³Π°, ΡΠΎ ΠΈ ΠΌΠ½ΠΎΠ³ΠΈΠ΅ ΡΠ°Π³ΠΈ Π±ΡΠ΄ΡΡ ΠΏΠΎΠ²ΡΠΎΡΡΡΡΡ.
rac_gui_build_DEB = util.BuildFactory()
rac_gui_build_DEB.addStep(steps.Git(
repourl = 'https://bitbucket.org/svk28/rac-gui.git',
haltOnFailure = True,
submodules = True,
mode='full',
workdir='build',
progress = True)
)
# ΠΠΎΠ±Π°Π²ΠΈΠΌ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Π²Π΅ΡΡΠΈΠΈ ΠΈΠ· ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ³ΠΎ ΡΠ°ΠΉΠ»Π°
rac_gui_build_DEB.addStep(
steps.SetPropertyFromCommand(
command="grep version rac_gui.tcl | grep -oE 'b[0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2}b'", property="version"
)
)
# ΠΠΎΠ±Π°Π²ΠΈΠΌ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ ΡΠ΅Π»ΠΈΠ·Π° ΠΈΠ· ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ³ΠΎ ΡΠ°ΠΉΠ»Π°
rac_gui_build_DEB.addStep(
steps.SetPropertyFromCommand(
command="grep release rac_gui.tcl | grep -oE 'b[0-9]{1,3}b'", property="release"
)
)
# ΠΠ΅ΡΠ΅ΠΈΠΌΠ΅Π½ΡΠ΅ΠΌ Π·Π°ΠΏΡΡΠΊΠ°Π΅ΠΌΡΠΉ ΡΠ°ΠΉΠ»
rac_gui_build_DEB.addStep(steps.ShellCommand(
command=["mv", "rac_gui.tcl", "racgui"]))
ΠΠ»Ρ RPM-ΠΏΠ°ΠΊΠ΅ΡΠ° ΡΠ°ΡΡΡ Π½ΠΈΠΆΠ΅ΡΠ»Π΅Π΄ΡΡΡΠΈΡ ΠΏΡΠΎΡΠ΅Π΄ΡΡ Π΄Π΅Π»Π°Π΅ΡΡΡ ΡΠ°ΠΌΠΈΠΌ rpm ΠΏΡΠΈ ΡΠ±ΠΎΡΠΊΠ΅ ΠΈ ΠΎΠΏΠΈΡΠ°Π½Ρ Π²Π½ΡΡΡΠΈ ΡΠΏΠ΅ΠΊΠ°, Π΄Π»Ρ Π΄Π΅Π±ΠΈΠ°Π½Π° ΠΏΡΠΈΡ ΠΎΠ΄ΠΈΡΡΡ ΡΡΠΎ Π΄Π΅Π»Π°ΡΡ ΡΡΡ:
# ΠΠΎΠΌΠ΅Π½ΡΠ΅ΠΌ ΠΏΡΡΠΈ ΠΊ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠ°ΠΌ
rac_gui_build_DEB.addStep(steps.ShellCommand(
command=["sed", "-i", "s+^set dir(lib)+set dir(lib) /usr/share/rac-gui/lib ;#+g", "racgui"]))
# ΠΠΎΠΌΠ΅Π½ΡΠ΅ΠΌ ΠΏΡΡΠΈ ΠΊ ΡΠ°ΠΉΠ»Π°ΠΌ
rac_gui_build_DEB.addStep(steps.ShellCommand(
command=["sed", "-i", "s+[pwd]+/usr/share/rac-gui+g", "racgui"]))
# Π·Π°Π°ΡΡ
ΠΈΠ²ΠΈΡΡΠ΅ΠΌ ΠΈΡΡ
ΠΎΠ΄Π½ΠΈΠΊΠΈ
rac_gui_build_DEB.addStep(steps.ShellCommand(
command=["tar", "czf", util.Interpolate("../rac-gui_%(prop:version)s.orig.tar.gz"), "."]))
# Π‘ΠΎΠ±Π΅ΡΡΠΌ ΠΏΠ°ΠΊΠ΅Ρ
rac_gui_build_DEB.addStep(steps.ShellCommand(
command=["dpkg-buildpackage"]))
# Π‘ΠΊΠΎΠΏΠΈΡΡΠ΅ΠΌ ΡΠ°ΠΉΠ» Π½Π° ΠΌΠ°ΡΡΠ΅Ρ
rac_gui_build_DEB.addStep(
steps.FileUpload(
workersrc=util.Interpolate("../rac-gui_%(prop:version)s-%(prop:release)s_amd64.deb"),
masterdest=util.Interpolate("/home/buildbot/builds/rac-gui_%(prop:version)s-%(prop:release)s_amd64.deb")
)
)
rac_gui_build_DEB.addStep(
steps.MasterShellCommand(
command=["/usr/local/bin/deploy-ftp.tcl",
util.Interpolate("--local-file=/home/buildbot/builds/rac-gui_%(prop:version)s-%(prop:release)s_amd64.deb"),
util.Interpolate("--remote-file=uploads/rac-gui/rac-gui_%(prop:version)s-%(prop:release)s_amd64.deb")]
)
)
Π Ρ DEB ΠΏΠΎΠΊΠΎΠ½ΡΠ΅Π½ΠΎ, ΡΠ΅ΠΏΠ΅ΡΡ windows!
rac_gui_build_WIN = util.BuildFactory()
rac_gui_build_WIN.addStep(steps.Git(
repourl = 'https://bitbucket.org/svk28/rac-gui.git',
haltOnFailure = True,
submodules = True,
mode='full',
workdir='build',
progress = True)
)
Π’Π°ΠΊ ΠΊΠ°ΠΊ Π² windows ΡΡΠ°ΡΠ½ΠΎ Π½Π΅Ρ grep ΠΈ sed (ΠΈΠ»ΠΈ Π΅ΡΡΡ?) ΡΠΎ Π±ΡΠ΄Π΅ΠΌ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ powershell
# ΠΠΎΠ±Π°Π²ΠΈΠΌ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Π²Π΅ΡΡΠΈΠΈ ΠΈΠ· ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ³ΠΎ ΡΠ°ΠΉΠ»Π°
rac_gui_build_WIN.addStep(
steps.SetPropertyFromCommand(
command="powershell -command "((Get-Content .rac_gui.tcl | Select-String -Pattern 'version:') -split 's')[2]",
property="version"
)
)
# ΠΠΎΠ±Π°Π²ΠΈΠΌ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ ΡΠ΅Π»ΠΈΠ·Π° ΠΈΠ· ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ³ΠΎ ΡΠ°ΠΉΠ»Π°
rac_gui_build_WIN.addStep(
steps.SetPropertyFromCommand(
command="powershell -command "((Get-Content .rac_gui.tcl | Select-String -Pattern 'release:') -split 's')[2]",
property="release"
)
)
# Π‘ΠΎΠ·Π΄Π°Π΄ΠΈΠΌ Π·Π°ΠΏΡΡΠΊΠ°Π΅ΠΌΡΠΉ ΡΠ°ΠΉΠ»
rac_gui_build_WIN.addStep(steps.ShellCommand(
command=["c:binfreewrap.exe", "rac_gui.tcl"]))
# Π·Π°ΠΏΠ°ΠΊΡΠ΅ΠΌ ΡΠΎ, ΡΡΠΎ ΠΏΠΎΠ»ΡΡΠΈΠ»ΠΎΡΡ
rac_gui_build_WIN.addStep(steps.ShellCommand(
command=["c:Program Files7-zip7z.exe", "a", "-r", util.Interpolate("..rac-gui_%(prop:version)s-%(prop:release)s.win.zip"), "..build"]))
# ΡΠΊΠΎΠΏΠΈΡΡΠ΅ΠΌ Π½Π° ΠΌΠ°ΡΡΠ΅Ρ
rac_gui_build_WIN.addStep(
steps.FileUpload(
workersrc=util.Interpolate("..rac-gui_%(prop:version)s-%(prop:release)s.win.zip"),
masterdest=util.Interpolate("/home/buildbot/builds/rac-gui_%(prop:version)s-%(prop:release)s.win.zip")
)
)
# Π‘ΠΊΠΎΠΏΠΈΡΡΠ΅ΠΌ ΡΠ°ΠΉΠ» Π½Π° Ρ
ΠΎΡΡΠΈΠ½Π³
rac_gui_build_WIN.addStep(
steps.MasterShellCommand(
command=["/usr/local/bin/deploy-ftp.tcl",
util.Interpolate("--local-file=/home/buildbot/builds/rac-gui_%(prop:version)s-%(prop:release)s.win.zip"),
util.Interpolate("--remote-file=uploads/rac-gui/rac-gui_%(prop:version)s-%(prop:release)s.win.zip")]
)
)
# Π’ΡΡ ΠΎΠΏΡΠ΅Π΄Π΅Π»ΡΠ΅ΠΌ ΠΊΠ°ΠΊΠΈΠ΅ ΡΠ±ΠΎΡΡΠΈΠΊΠΈ Ρ Π½Π°Ρ Π΅ΡΡΡ
c['builders'] = [
util.BuilderConfig(name="Rac-GUI-RPM-builder", workername='CentOS', factory=rac_gui_build_RPM),
util.BuilderConfig(name="Rac-GUI-DEB-builder", workername='Debian-10', factory=rac_gui_build_DEB),
util.BuilderConfig(name="Rac-GUI-WIN-builder", workername='Windows-10', factory=rac_gui_build_WIN),
]
ΠΠ»Ρ ΠΎΠΏΠΎΠ²Π΅ΡΠ΅Π½ΠΈΡ ΠΎ ΡΠΎΡΡΠΎΡΠ½ΠΈΠΈ ΠΏΡΠΎΡΠ΅ΡΡΠ° ΡΠ±ΠΎΡΠΊΠΈ Π±ΡΠ΄Π΅ΠΌ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ ΡΠ»Π΅ΠΊΡΡΠΈΡΠ΅ΡΠΊΡΡ ΠΏΠΎΡΡΡ
c['services'] = []
template=u'''
<h4>Build status: {{ summary }}</h4>
<p> Worker used: {{ workername }}</p>
{% for step in build['steps'] %}
<p> {{ step['name'] }}: {{ step['result'] }}</p>
{% endfor %}
<p><b> -- The Buildbot</b></p>
'''
mailNotifier = reporters.MailNotifier(fromaddr="[email protected]",
sendToInterestedUsers=False,
mode=('all'),
extraRecipients=["[email protected]"],
relayhost="mail.domain.ru",
smtpPort=587,
smtpUser="[email protected]",
smtpPassword="******",
messageFormatter=reporters.MessageFormatter(
template=template, template_type='html',
wantProperties=True, wantSteps=True))
c['services'].append(mailNotifier)
# ΠΡΠ½ΠΎΠ²Π½ΡΠ΅ Π½Π°ΡΡΡΠΎΠΉΠΊΠΈ ΠΌΠ°ΡΡΠ΅ΡΠ°
c['title'] = "The process of bulding"
c['titleURL'] = "http://vm-srv-build1:80/"
c['buildbotURL'] = "http://vm-srv-build1/"
c['www'] = dict(port=80,
plugins=dict(waterfall_view={}, console_view={}, grid_view={}))
c['db'] = {
'db_url' : "sqlite:///state.sqlite"
}
Π‘ΠΎΡ ΡΠ°Π½ΡΠ΅ΠΌ ΡΠ°ΠΉΠ» ΠΈ ΠΌΠΎΠΆΠ½ΠΎ ΠΏΠΎΠΏΡΠΎΠ±ΠΎΠ²Π°ΡΡ Π·Π°ΠΏΡΡΡΠΈΡΡ ΡΠ»ΡΠΆΠ±Ρ ΠΌΠ°ΡΡΠ΅ΡΠ°:
systemctl restart buildbot-master
Π Π»ΠΎΠ³Π΅ ΠΏΡΠΎΠΊΠΎΠ½ΡΡΠΎΠ»ΠΈΡΡΠ΅ΠΌ ΡΡΠΎ Ρ ΠΊΠΎΠ½ΡΠΈΠ³ΠΎΠΌ Π²ΡΠ΅ Π² ΠΏΠΎΡΡΠ΄ΠΊΠ΅ ΠΈ Π²ΡΠ΅ ΡΠ°Π±ΠΎΡΠ°Π΅Ρ Π² ΡΡΠ°ΡΠ½ΠΎΠΌ ΡΠ΅ΠΆΠΈΠΌΠ΅. ΠΡΠ΅ Π½Π°ΡΠΈ ΡΠ°Π±ΠΎΡΠ½ΠΈΠΊΠΈ Π΄ΠΎΠ»ΠΆΠ½Ρ ΡΠ΅ΠΏΠ΅ΡΡ ΠΏΠΎΠ΄ΠΊΠ»ΡΡΠΈΡΡΡΡ, ΠΎ ΡΠ΅ΠΌ Π² Π»ΠΎΠ³Π΅ »»’/home/buildbot/master/twistd.log»»’ Π±ΡΠ΄Π΅Ρ ΡΠ°Π΄ΠΎΡΡΠ½ΠΎ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΎ:
2019-07-24 16:50:35+0300 [-] Loading buildbot.tac...
2019-07-24 16:50:35+0300 [-] Loaded.
2019-07-24 16:50:35+0300 [-] twistd 19.2.1 (/usr/bin/python3.6 3.6.8) starting up.
2019-07-24 16:50:35+0300 [-] reactor class: twisted.internet.epollreactor.EPollReactor.
2019-07-24 16:50:35+0300 [-] Starting BuildMaster -- buildbot.version: 2.3.1
2019-07-24 16:50:35+0300 [-] Loading configuration from '/home/buildbot/master/master.cfg'
2019-07-24 16:50:36+0300 [-] /usr/local/lib/python3.6/site-packages/buildbot/config.py:90: buildbot.config.ConfigWarning: [0.9.0 and later] `buildbotNetUsageData` is not configured and defaults to basic.
This parameter helps the buildbot development team to understand the installation base.
No personal information is collected.
Only installation software version info and plugin usage is sent.
You can `opt-out` by setting this variable to None.
Or `opt-in` for more information by setting it to "full".
2019-07-24 16:50:36+0300 [-] Setting up database with URL 'sqlite:/state.sqlite'
2019-07-24 16:50:36+0300 [-] setting database journal mode to 'wal'
2019-07-24 16:50:36+0300 [-] adding 1 new services, removing 0
2019-07-24 16:50:36+0300 [-] adding 1 new change_sources, removing 0
2019-07-24 16:50:36+0300 [-] gitpoller: using workdir '/home/buildbot/master/gitpoller-work'
2019-07-24 16:50:36+0300 [-] adding 3 new builders, removing 0
2019-07-24 16:50:36+0300 [-] adding 1 new schedulers, removing 0
2019-07-24 16:50:36+0300 [-] initializing www plugin 'waterfall_view'
2019-07-24 16:50:36+0300 [-] initializing www plugin 'console_view'
2019-07-24 16:50:36+0300 [-] initializing www plugin 'grid_view'
2019-07-24 16:50:36+0300 [-] NOTE: www plugin 'sitenav' is installed but not configured
2019-07-24 16:50:36+0300 [-] initializing www plugin 'waterfall_view'
2019-07-24 16:50:36+0300 [-] initializing www plugin 'console_view'
2019-07-24 16:50:36+0300 [-] initializing www plugin 'grid_view'
2019-07-24 16:50:36+0300 [-] NOTE: www plugin 'sitenav' is installed but not configured
2019-07-24 16:50:36+0300 [-] BuildbotSite starting on 80
2019-07-24 16:50:36+0300 [-] Starting factory <buildbot.www.service.BuildbotSite object at 0x7fe31c2657b8>
2019-07-24 16:50:36+0300 [-] adding 3 new workers, removing 0
2019-07-24 16:50:36+0300 [-] PBServerFactory starting on 4000
2019-07-24 16:50:36+0300 [-] Starting factory <twisted.spread.pb.PBServerFactory object at 0x7fe31c147470>
2019-07-24 16:50:37+0300 [-] BuildMaster is running
2019-07-24 16:50:37+0300 [-] buildbotNetUsageData: sending {'installid': 'b6193b126b96689351d2fe95787c5a03fc0879f9', 'versions': {'Python': '3.6.8', 'Buildbot': '2.3.1', 'Twisted': '19.2.1'}, 'platform': {'platform': 'Linux-4.15.18-10- pve-x86_64-with-centos-7.6.1810-Core', 'system': 'Linux', 'machine': 'x86_64', 'processor': 'x86_64', 'python_implementation': 'CPython', 'version': '#1 SMP PVE 4.15.18-32', 'distro': 'centos:7'}, 'plugins': {'buildbot/worker/base/Worker': 3, 'buildbot/config/BuilderConfig': 3, 'buildbot/schedulers/basic/SingleBranchScheduler': 1, 'buildbot/reporters/mail/MailNotifier': 1, 'buildbot/changes/gitpoller/GitPoller': 1, 'buildbot/steps/worker/MakeDirectory': 1, 'buildbot/steps/source/git/Git': 3, 'buildbot/steps/shell/ShellCommand': 9, 'buildbot/steps/package/rpm/rpmbuild/RpmBuild': 1}, 'db': 'sqlite', 'mq': 'simple', 'www_plugins': ['waterfall_view', 'console_view', 'grid_view']}
2019-07-24 16:50:37+0300 [Broker,0,127.0.0.1] worker 'CentOS' attaching from IPv4Address(type='TCP', host='127.0.0.1', port=37332)
2019-07-24 16:50:37+0300 [Broker,0,127.0.0.1] Got workerinfo from 'CentOS'
2019-07-24 16:50:37+0300 [-] bot attached
2019-07-24 16:50:37+0300 [Broker,0,127.0.0.1] Worker CentOS attached to Rac-GUI-RPM-builder
2019-07-24 16:50:37+0300 [-] buildbotNetUsageData: buildbot.net said: ok
2019-07-24 16:50:39+0300 [Broker,1,192.168.55.15] worker 'Windows-10' attaching from IPv4Address(type='TCP', host='192.168.5.145', port=49831)
2019-07-24 16:50:39+0300 [Broker,1,192.168.55.15] Got workerinfo from 'Windows-10'
2019-07-24 16:50:40+0300 [-] bot attached
2019-07-24 16:50:40+0300 [Broker,1,192.168.55.15] Worker Windows-10 attached to Rac-GUI-WIN-builder
2019-07-24 16:50:41+0300 [Broker,2,192.168.55.99] worker 'Debian-10' attaching from IPv4Address(type='TCP', host='192.168.5.9', port=44430)
2019-07-24 16:50:41+0300 [Broker,2,192.168.55.99] Got workerinfo from 'Debian-10'
2019-07-24 16:50:41+0300 [-] bot attached
2019-07-24 16:50:41+0300 [Broker,2,192.168.55.99] Worker Debian-10 attached to Rac-GUI-DEB-builder
ΠΠ° ΡΡΠΎΠΌ ΠΏΡΠΎΡΠ΅ΡΡ Π½Π°ΡΡΡΠΎΠΉΠΊΠΈ Π·Π°Π²Π΅ΡΡΡΠ½. ΠΠΎΡΠΌΠΎΡΡΠ΅ΡΡ ΡΠ΅ΠΊΡΡΠ΅Π΅ ΡΠΎΡΡΠΎΡΠ½ΠΈΠ΅ ΠΌΠΎΠΆΠ½ΠΎ ΡΠ΅ΡΠ΅Π· Π²ΡΠ±-ΠΌΠΎΡΠ΄e. ΠΠ΄Π΅ ΡΠ°ΠΊΠΆΠ΅ ΠΌΠΎΠΆΠ½ΠΎ ΠΏΠΎΡΠΌΠΎΡΡΠ΅ΡΡ ΠΎΡΠΈΠ±ΠΊΠΈ ΡΠ±ΠΎΡΠΊΠΈ, ΠΏΠ½ΡΡΡ Π·Π°Π²ΠΈΡΡΠΈΠΉ ΠΏΡΠΎΡΠ΅ΡΡ Π΅ΡΠ»ΠΈ ΡΡΠΎ-ΡΠΎ ΠΏΠΎΡΠ»ΠΎ Π½ΠΈ ΡΠ°ΠΊ ΠΈ Ρ.Π΄.
Π‘ΡΠ°Π·Ρ ΠΏΠΎΡΠ»Π΅ Π·Π°ΠΏΡΡΠΊΠ° Π½Π°ΡΠΈΡ ΡΠ°Π±ΠΎΡΡΠ³ ΠΌΠΎΠΆΠ½ΠΎ ΠΏΠΎΡΠΌΠΎΡΡΠ΅ΡΡ ΡΠ΅ΡΠ΅Π· ΠΌΠ΅Π½Ρ «Builds» -> «Workers»
ΠΠΎΡΠ»Π΅ ΡΠΎΠ³ΠΎ, ΠΊΠ°ΠΊ Π±ΡΠ΄Π΅Ρ ΠΏΡΠΎΠΈΠ·Π²Π΅Π΄Π΅Π½ ΠΏΠ΅ΡΠ²ΡΠΉ ΠΏΡΠΎΡΠ΅ΡΡ ΡΠ±ΠΎΡΠΊΠΈ (Ρ.Π΅. ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ Π² Git-ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠ°ΡΠΈΠΈ), Π½Π° ΠΏΠ΅ΡΠ²ΠΎΠΉ ΡΡΡΠ°Π½ΠΈΡΠΊΠ΅ ΠΏΠΎΡΠ²ΠΈΡΡΡ ΡΠΎΡΡΠΎΡΠ½ΠΈΠ΅ ΠΏΡΠΎΡΠ΅ΡΡΠΎΠ².
ΠΡΠ»ΠΈ ΡΠΊΠ½ΡΡΡ ΠΌΡΡΠΎΠΉ Π² Π½ΡΠΆΠ½ΡΡ ΡΡΡΠΎΠΊΡ ΡΠΎ ΠΎΡΠΊΡΠΎΠ΅ΡΡΡ ΡΡΡΠ°Π½ΠΈΡΠΊΠ° Ρ ΡΠ΅ΠΊΡΡΠΈΠΌ ΡΠΎΡΡΠΎΡΠ½ΠΈΠ΅ΠΌ Π΄Π°Π½Π½ΠΎΠ³ΠΎ ΠΏΡΠΎΡΠ΅ΡΡΠ°, Π³Π΄Π΅ Π²ΠΈΠ΄Π½ΠΎ ΡΡΠΎ ΠΏΡΠΎΠΈΡΡ ΠΎΠ΄ΠΈΡ, ΠΊΠ°ΠΊΠΈΠ΅ ΠΎΡΠΈΠ±ΠΊΠΈ ΠΈ Ρ.Π΄.
Π¦Π΅Π»ΠΈΠΊΠΎΠΌ ΠΊΠΎΠ½ΡΠΈΠ³ ΠΌΠ°ΡΡΠ΅ΡΠ° ΠΌΠΎΠΆΠ½ΠΎ Π²Π·ΡΡΡ ΡΡΡ
import os, re
from buildbot.plugins import steps, util, schedulers, worker, changes, reporters
c= BuildmasterConfig ={}
c['workers'] = [ worker.Worker('CentOS', '123456'), worker.Worker('Debian-10', '123456'), worker.Worker('Windows-10', '123456')]
c['protocols'] = {'pb': {'port': 4000}}
c['change_source'] = []
c['change_source'].append(changes.GitPoller(
repourl = 'https://bitbucket.org/svk28/rac-gui.git',
project = 'Rac-GUI',
branches = True,
pollInterval = 600
))
# ΡΠ»ΡΠΆΠ±Π° Π·Π°ΠΏΡΡΠΊΠ° ΡΠ±ΠΎΡΠΊΠΈ
c['schedulers'] = []
c['schedulers'].append(schedulers.SingleBranchScheduler(
name="Rac-GUI-schedulers",
change_filter=util.ChangeFilter(branch='master'),
builderNames=["Rac-GUI-RPM-builder", "Rac-GUI-DEB-builder", "Rac-GUI-WIN-builder"],
properties = {'owner': 'admin'}
))
@util.renderer
def get_name_version_release(props):
prog_name = "rac-gui"
prog_version = "1.0.3"
prog_release = "3"
return {
"prog_name": prog_name
#"prog_version": prog_version,
#"prog_release": prog_release
}
rac_gui_build_RPM = util.BuildFactory()
rac_gui_build_RPM.addStep(steps.Git(
repourl = 'https://bitbucket.org/svk28/rac-gui.git',
workdir = 'rac-gui',
haltOnFailure = True,
submodules = True,
mode='full',
progress = True)
)
# ΠΠΎΠ±Π°Π²ΠΈΠΌ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Π²Π΅ΡΡΠΈΠΈ ΠΈΠ· ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ³ΠΎ ΡΠ°ΠΉΠ»Π°
rac_gui_build_RPM.addStep(
steps.SetPropertyFromCommand(
command="grep version ../rac-gui/rac_gui.tcl | grep -oE 'b[0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2}b'", property="version"
)
)
# ΠΠΎΠ±Π°Π²ΠΈΠΌ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ ΡΠ΅Π»ΠΈΠ·Π° ΠΈΠ· ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ³ΠΎ ΡΠ°ΠΉΠ»Π°
rac_gui_build_RPM.addStep(
steps.SetPropertyFromCommand(
command="grep release ../rac-gui/rac_gui.tcl | grep -oE 'b[0-9]{1,3}b'", property="release"
)
)
rac_gui_build_RPM.addStep(steps.ShellCommand(
command=["tar", "czf", util.Interpolate("/home/buildbot/rpmbuild/SOURCES/rac-gui-%(prop:version)s-%(prop:release)s.tar.gz"), "../rac-gui"]))
rac_gui_build_RPM.addStep(steps.ShellCommand(
command=["cp", "../rac-gui/rac_gui.spec", "/home/buildbot/rpmbuild/SPECS/rac_gui.spec"]))
rac_gui_build_RPM.addStep(steps.ShellCommand(
command=["sed", "-i", util.Interpolate("s/.*Version:.*/Version:t%(prop:version)s/"), "/home/buildbot/rpmbuild/SPECS/rac_gui.spec"]))
rac_gui_build_RPM.addStep(steps.ShellCommand(
command=["sed", "-i", util.Interpolate("s/.*Release:.*/Release:t%(prop:release)s/"), "/home/buildbot/rpmbuild/SPECS/rac_gui.spec"]))
rac_gui_build_RPM.addStep(steps.RpmBuild(
specfile="/home/buildbot/rpmbuild/SPECS/rac_gui.spec",
dist='.el5',
topdir='/home/buildbot/rpmbuild',
builddir='/home/buildbot/rpmbuild/build',
rpmdir='/home/buildbot/rpmbuild/RPMS',
sourcedir='/home/buildbot/rpmbuild/SOURCES'
))
# Π‘ΠΊΠΎΠΏΠΈΡΡΠ΅ΠΌ ΡΠ°ΠΉΠ» Π½Π° ΠΌΠ°ΡΡΠ΅Ρ
rac_gui_build_RPM.addStep(
steps.FileUpload(
workersrc=util.Interpolate("/home/buildbot/rpmbuild/RPMS/noarch/rac-gui-%(prop:version)s-%(prop:release)s.noarch.rpm"),
masterdest=util.Interpolate("/home/buildbot/builds/rac-gui-%(prop:version)s-%(prop:release)s.noarch.rpm")
)
)
rac_gui_build_RPM.addStep(
steps.FileUpload(
workersrc=util.Interpolate("/home/buildbot/rpmbuild/SOURCES/rac-gui-%(prop:version)s-%(prop:release)s.tar.gz"),
masterdest=util.Interpolate("/home/buildbot/builds/rac-gui-%(prop:version)s-%(prop:release)s.tar.gz")
)
)
rac_gui_build_RPM.addStep(
steps.MasterShellCommand(
command=["/usr/local/bin/deploy-ftp.tcl",
util.Interpolate("--local-file=/home/buildbot/builds/rac-gui-%(prop:version)s-%(prop:release)s.noarch.rpm"),
util.Interpolate("--remote-file=uploads/rac-gui/rac-gui-%(prop:version)s-%(prop:release)s.noarch.rpm")]
)
)
rac_gui_build_RPM.addStep(
steps.MasterShellCommand(
command=["/usr/local/bin/deploy-ftp.tcl",
util.Interpolate("--local-file=/home/buildbot/builds/rac-gui-%(prop:version)s-%(prop:release)s.tar.gz"),
util.Interpolate("--remote-file=uploads/rac-gui/rac-gui-%(prop:version)s-%(prop:release)s.tar.gz")]
)
)
####################################
## DEB
####################################
rac_gui_build_DEB = util.BuildFactory()
rac_gui_build_DEB.addStep(steps.Git(
repourl = 'https://bitbucket.org/svk28/rac-gui.git',
haltOnFailure = True,
submodules = True,
mode='full',
workdir='build',
progress = True)
)
# ΠΠΎΠ±Π°Π²ΠΈΠΌ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Π²Π΅ΡΡΠΈΠΈ ΠΈΠ· ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ³ΠΎ ΡΠ°ΠΉΠ»Π°
rac_gui_build_DEB.addStep(
steps.SetPropertyFromCommand(
command="grep version rac_gui.tcl | grep -oE 'b[0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2}b'", property="version"
)
)
# ΠΠΎΠ±Π°Π²ΠΈΠΌ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ ΡΠ΅Π»ΠΈΠ·Π° ΠΈΠ· ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ³ΠΎ ΡΠ°ΠΉΠ»Π°
rac_gui_build_DEB.addStep(
steps.SetPropertyFromCommand(
command="grep release rac_gui.tcl | grep -oE 'b[0-9]{1,3}b'", property="release"
)
)
# ΠΠ΅ΡΠ΅ΠΈΠΌΠ΅Π½ΡΠ΅ΠΌ Π·Π°ΠΏΡΡΠΊΠ°Π΅ΠΌΡΠΉ ΡΠ°ΠΉΠ»
rac_gui_build_DEB.addStep(steps.ShellCommand(
command=["mv", "rac_gui.tcl", "racgui"]))
# ΠΠΎΠΌΠ΅Π½ΡΠ΅ΠΌ ΠΏΡΡΠΈ ΠΊ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠ°ΠΌ
rac_gui_build_DEB.addStep(steps.ShellCommand(
command=["sed", "-i", "s+^set dir(lib)+set dir(lib) /usr/share/rac-gui/lib ;#+g", "racgui"]))
# ΠΠΎΠΌΠ΅Π½ΡΠ΅ΠΌ ΠΏΡΡΠΈ ΠΊ ΡΠ°ΠΉΠ»Π°ΠΌ
rac_gui_build_DEB.addStep(steps.ShellCommand(
command=["sed", "-i", "s+[pwd]+/usr/share/rac-gui+g", "racgui"]))
# Π·Π°Π°ΡΡ
ΠΈΠ²ΠΈΡΡΠ΅ΠΌ ΠΈΡΡ
ΠΎΠ΄Π½ΠΈΠΊΠΈ
rac_gui_build_DEB.addStep(steps.ShellCommand(
command=["tar", "czf", util.Interpolate("../rac-gui_%(prop:version)s.orig.tar.gz"), "."]))
# Π‘ΠΎΠ±Π΅ΡΡΠΌ ΠΏΠ°ΠΊΠ΅Ρ
rac_gui_build_DEB.addStep(steps.ShellCommand(
command=["dpkg-buildpackage"]))
# Π‘ΠΊΠΎΠΏΠΈΡΡΠ΅ΠΌ ΡΠ°ΠΉΠ» Π½Π° ΠΌΠ°ΡΡΠ΅Ρ
rac_gui_build_DEB.addStep(
steps.FileUpload(
workersrc=util.Interpolate("../rac-gui_%(prop:version)s-%(prop:release)s_amd64.deb"),
masterdest=util.Interpolate("/home/buildbot/builds/rac-gui_%(prop:version)s-%(prop:release)s_amd64.deb")
)
)
rac_gui_build_DEB.addStep(
steps.MasterShellCommand(
command=["/usr/local/bin/deploy-ftp.tcl",
util.Interpolate("--local-file=/home/buildbot/builds/rac-gui_%(prop:version)s-%(prop:release)s_amd64.deb"),
util.Interpolate("--remote-file=uploads/rac-gui/rac-gui_%(prop:version)s-%(prop:release)s_amd64.deb")]
)
)
############################################
# WIN
############################################
rac_gui_build_WIN = util.BuildFactory()
rac_gui_build_WIN.addStep(steps.Git(
repourl = 'https://bitbucket.org/svk28/rac-gui.git',
haltOnFailure = True,
submodules = True,
mode='full',
workdir='build',
progress = True)
)
# ΠΠΎΠ±Π°Π²ΠΈΠΌ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Π²Π΅ΡΡΠΈΠΈ ΠΈΠ· ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ³ΠΎ ΡΠ°ΠΉΠ»Π°
rac_gui_build_WIN.addStep(
steps.SetPropertyFromCommand(
command="powershell -command "((Get-Content .rac_gui.tcl | Select-String -Pattern 'version:') -split 's')[2]",
property="version"
)
)
# ΠΠΎΠ±Π°Π²ΠΈΠΌ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΠ΅ ΡΠ΅Π»ΠΈΠ·Π° ΠΈΠ· ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ³ΠΎ ΡΠ°ΠΉΠ»Π°
rac_gui_build_WIN.addStep(
steps.SetPropertyFromCommand(
command="powershell -command "((Get-Content .rac_gui.tcl | Select-String -Pattern 'release:') -split 's')[2]",
property="release"
)
)
# Π‘ΠΎΠ·Π΄Π°Π΄ΠΈΠΌ Π·Π°ΠΏΡΡΠΊΠ°Π΅ΠΌΡΠΉ ΡΠ°ΠΉΠ»
rac_gui_build_WIN.addStep(steps.ShellCommand(
command=["c:binfreewrap.exe", "rac_gui.tcl"]))
# Π·Π°ΠΏΠ°ΠΊΡΠ΅ΠΌ ΡΠΎ, ΡΡΠΎ ΠΏΠΎΠ»ΡΡΠΈΠ»ΠΎΡΡ
rac_gui_build_WIN.addStep(steps.ShellCommand(
command=["c:Program Files7-zip7z.exe", "a", "-r", util.Interpolate("..rac-gui_%(prop:version)s-%(prop:release)s.win.zip"), "..build"]))
# ΡΠΊΠΎΠΏΠΈΡΡΠ΅ΠΌ Π½Π° ΠΌΠ°ΡΡΠ΅Ρ
rac_gui_build_WIN.addStep(
steps.FileUpload(
workersrc=util.Interpolate("..rac-gui_%(prop:version)s-%(prop:release)s.win.zip"),
masterdest=util.Interpolate("/home/buildbot/builds/rac-gui_%(prop:version)s-%(prop:release)s.win.zip")
)
)
# Π‘ΠΊΠΎΠΏΠΈΡΡΠ΅ΠΌ ΡΠ°ΠΉΠ» Π½Π° Ρ
ΠΎΡΡΠΈΠ½Π³
rac_gui_build_WIN.addStep(
steps.MasterShellCommand(
command=["/usr/local/bin/deploy-ftp.tcl",
util.Interpolate("--local-file=/home/buildbot/builds/rac-gui_%(prop:version)s-%(prop:release)s.win.zip"),
util.Interpolate("--remote-file=uploads/rac-gui/rac-gui_%(prop:version)s-%(prop:release)s.win.zip")]
)
)
c['builders'] = [
util.BuilderConfig(name="Rac-GUI-RPM-builder", workername='CentOS', factory=rac_gui_build_RPM),
util.BuilderConfig(name="Rac-GUI-DEB-builder", workername='Debian-10', factory=rac_gui_build_DEB),
util.BuilderConfig(name="Rac-GUI-WIN-builder", workername='Windows-10', factory=rac_gui_build_WIN),
]
c['services'] = []
template=u'''
<h4>Build status: {{ summary }}</h4>
<p> Worker used: {{ workername }}</p>
{% for step in build['steps'] %}
<p> {{ step['name'] }}: {{ step['result'] }}</p>
{% endfor %}
<p><b> -- The Buildbot</b></p>
'''
mailNotifier = reporters.MailNotifier(fromaddr="[email protected]",
sendToInterestedUsers=False,
mode=('all'),
extraRecipients=["[email protected]"],
relayhost="mail.domain.local",
smtpPort=587,
smtpUser="[email protected]",
smtpPassword="**********",
messageFormatter=reporters.MessageFormatter(
template=template, template_type='html',
wantProperties=True, wantSteps=True))
c['services'].append(mailNotifier)
c['title'] = "The process of bulding"
c['titleURL'] = "http://vm-srv-build1:80/"
c['buildbotURL'] = "http://vm-srv-build1/"
c['www'] = dict(port=80,
plugins=dict(waterfall_view={}, console_view={}, grid_view={}))
c['db'] = {
'db_url' : "sqlite:///state.sqlite"
}
ΠΠ°ΡΠ΅ΡΠΈΠ°Π»Ρ
ΠΡΠΈ ΠΏΠΎΠ΄Π³ΠΎΡΠΎΠ²ΠΊΠ΅ ΡΡΠ°ΡΡΠΈ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π»ΠΈΡΡ ΡΠ»Π΅Π΄ΡΡΡΠΈΠ΅ ΠΌΠ°ΡΠ΅ΡΠΈΠ°Π»Ρ:
ΠΡΠΈΠΌΠ΅Ρ ΡΠ΅Π°Π»ΠΈΠ·Π°ΡΠΈΠΈ Continuous Integration Ρ ΠΏΠΎΠΌΠΎΡΡΡ BuildBot Buildbot: ΡΠΊΠ°Π· Ρ ΠΏΡΠΈΠΌΠ΅ΡΠ°ΠΌΠΈ Π΅ΡΠ΅ ΠΎΠ± ΠΎΠ΄Π½ΠΎΠΉ ΡΠΈΡΡΠ΅ΠΌΠ΅ Π½Π΅ΠΏΡΠ΅ΡΡΠ²Π½ΠΎΠΉ ΠΈΠ½ΡΠ΅Π³ΡΠ°ΡΠΈΠΈ ΠΠ°ΡΡΡΠΎΠΉΠΊΠ° Π½Π΅ΠΏΡΠ΅ΡΡΠ²Π½ΠΎΠΉ ΠΈΠ½ΡΠ΅Π³ΡΠ°ΡΠΈΠΈ Π² Buildbot Π² Ubuntu 16.04 - ΠΡ ΠΈ Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΡ ΠΏΠΎ ΠΏΡΠΎΠ΄ΡΠΊΡΡ
Buildbot Tutorial
ΠΡΡΠΎΡΠ½ΠΈΠΊ: habr.com