mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
testing, issue #775: Add automatic testing notifications to docker-ci
This commit is contained in:
parent
35e87ee571
commit
f7fed2ea5f
4 changed files with 45 additions and 8 deletions
|
@ -30,6 +30,16 @@ Deployment
|
||||||
export AWS_KEYPAIR_NAME=xxxxxxxxxxxx
|
export AWS_KEYPAIR_NAME=xxxxxxxxxxxx
|
||||||
export AWS_SSH_PRIVKEY=xxxxxxxxxxxx
|
export AWS_SSH_PRIVKEY=xxxxxxxxxxxx
|
||||||
|
|
||||||
|
# Define email recipient and IRC channel
|
||||||
|
export EMAIL_RCP=xxxxxx@domain.com
|
||||||
|
export IRC_CHANNEL=docker
|
||||||
|
|
||||||
|
# Define buildbot credentials
|
||||||
|
export BUILDBOT_PWD=xxxxxxxxxxxx
|
||||||
|
export IRC_PWD=xxxxxxxxxxxx
|
||||||
|
export SMTP_USER=xxxxxxxxxxxx
|
||||||
|
export SMTP_PWD=xxxxxxxxxxxx
|
||||||
|
|
||||||
# Checkout docker
|
# Checkout docker
|
||||||
git clone git://github.com/dotcloud/docker.git
|
git clone git://github.com/dotcloud/docker.git
|
||||||
|
|
||||||
|
|
4
testing/Vagrantfile
vendored
4
testing/Vagrantfile
vendored
|
@ -27,7 +27,9 @@ Vagrant::Config.run do |config|
|
||||||
pkg_cmd << "apt-get install -q -y python-dev python-pip supervisor; " \
|
pkg_cmd << "apt-get install -q -y python-dev python-pip supervisor; " \
|
||||||
"pip install -r #{CFG_PATH}/requirements.txt; " \
|
"pip install -r #{CFG_PATH}/requirements.txt; " \
|
||||||
"chown #{USER}.#{USER} /data; cd /data; " \
|
"chown #{USER}.#{USER} /data; cd /data; " \
|
||||||
"#{CFG_PATH}/setup.sh #{USER} #{CFG_PATH}; "
|
"#{CFG_PATH}/setup.sh #{USER} #{CFG_PATH} #{ENV['BUILDBOT_PWD']} " \
|
||||||
|
"#{ENV['IRC_PWD']} #{ENV['IRC_CHANNEL']} #{ENV['SMTP_USER']} " \
|
||||||
|
"#{ENV['SMTP_PWD']} #{ENV['EMAIL_RCP']}; "
|
||||||
# Install docker dependencies
|
# Install docker dependencies
|
||||||
pkg_cmd << "apt-get install -q -y python-software-properties; " \
|
pkg_cmd << "apt-get install -q -y python-software-properties; " \
|
||||||
"add-apt-repository -y ppa:dotcloud/docker-golang/ubuntu; apt-get update -qq; " \
|
"add-apt-repository -y ppa:dotcloud/docker-golang/ubuntu; apt-get update -qq; " \
|
||||||
|
|
|
@ -7,8 +7,9 @@ from buildbot.config import BuilderConfig
|
||||||
from buildbot.process.factory import BuildFactory
|
from buildbot.process.factory import BuildFactory
|
||||||
from buildbot.process.properties import Interpolate
|
from buildbot.process.properties import Interpolate
|
||||||
from buildbot.steps.shell import ShellCommand
|
from buildbot.steps.shell import ShellCommand
|
||||||
from buildbot.status import html
|
from buildbot.status import html, words
|
||||||
from buildbot.status.web import authz, auth
|
from buildbot.status.web import authz, auth
|
||||||
|
from buildbot.status.mail import MailNotifier
|
||||||
|
|
||||||
PORT_WEB = 80 # Buildbot webserver port
|
PORT_WEB = 80 # Buildbot webserver port
|
||||||
PORT_GITHUB = 8011 # Buildbot github hook port
|
PORT_GITHUB = 8011 # Buildbot github hook port
|
||||||
|
@ -20,7 +21,14 @@ GITHUB_DOCKER = 'github.com/dotcloud/docker'
|
||||||
DOCKER_PATH = '/data/docker'
|
DOCKER_PATH = '/data/docker'
|
||||||
BUILDER_PATH = '/data/buildbot/slave/{0}/build'.format(BUILDER_NAME)
|
BUILDER_PATH = '/data/buildbot/slave/{0}/build'.format(BUILDER_NAME)
|
||||||
DOCKER_BUILD_PATH = BUILDER_PATH + '/src/github.com/dotcloud/docker'
|
DOCKER_BUILD_PATH = BUILDER_PATH + '/src/github.com/dotcloud/docker'
|
||||||
BUILDBOT_PWD = 'pass-docker'
|
|
||||||
|
# Credentials set by setup.sh and Vagrantfile
|
||||||
|
BUILDBOT_PWD = ''
|
||||||
|
IRC_PWD = ''
|
||||||
|
IRC_CHANNEL = ''
|
||||||
|
SMTP_USER = ''
|
||||||
|
SMTP_PWD = ''
|
||||||
|
EMAIL_RCP = ''
|
||||||
|
|
||||||
|
|
||||||
c = BuildmasterConfig = {}
|
c = BuildmasterConfig = {}
|
||||||
|
@ -47,8 +55,15 @@ c['builders'] = [BuilderConfig(name=BUILDER_NAME,slavenames=['buildworker'],
|
||||||
factory=factory)]
|
factory=factory)]
|
||||||
|
|
||||||
# Status
|
# Status
|
||||||
authz_cfg=authz.Authz(auth=auth.BasicAuth([(TEST_USER,TEST_PWD)]),
|
authz_cfg = authz.Authz(auth=auth.BasicAuth([(TEST_USER, TEST_PWD)]),
|
||||||
forceBuild='auth')
|
forceBuild='auth')
|
||||||
c['status'] = [html.WebStatus(http_port=PORT_WEB, authz=authz_cfg)]
|
c['status'] = [html.WebStatus(http_port=PORT_WEB, authz=authz_cfg)]
|
||||||
c['status'].append(html.WebStatus(http_port=PORT_GITHUB,allowForce=True,
|
c['status'].append(html.WebStatus(http_port=PORT_GITHUB, allowForce=True,
|
||||||
change_hook_dialects={ 'github' : True }))
|
change_hook_dialects={ 'github': True }))
|
||||||
|
c['status'].append(MailNotifier(fromaddr='buildbot@docker.io',
|
||||||
|
sendToInterestedUsers=False, extraRecipients=[EMAIL_RCP],
|
||||||
|
mode='failing', relayhost='smtp.mailgun.org', smtpPort=587, useTls=True,
|
||||||
|
smtpUser=SMTP_USER, smtpPassword=SMTP_PWD))
|
||||||
|
c['status'].append(words.IRC("irc.freenode.net", "dockerqabot",
|
||||||
|
channels=[IRC_CHANNEL], password=IRC_PWD, allowForce=True,
|
||||||
|
notify_events={'exception':1, 'successToFailure':1, 'failureToSuccess':1}))
|
||||||
|
|
|
@ -6,11 +6,16 @@
|
||||||
|
|
||||||
USER=$1
|
USER=$1
|
||||||
CFG_PATH=$2
|
CFG_PATH=$2
|
||||||
|
BUILDBOT_PWD=$3
|
||||||
|
IRC_PWD=$4
|
||||||
|
IRC_CHANNEL=$5
|
||||||
|
SMTP_USER=$6
|
||||||
|
SMTP_PWD=$7
|
||||||
|
EMAIL_RCP=$8
|
||||||
BUILDBOT_PATH="/data/buildbot"
|
BUILDBOT_PATH="/data/buildbot"
|
||||||
DOCKER_PATH="/data/docker"
|
DOCKER_PATH="/data/docker"
|
||||||
SLAVE_NAME="buildworker"
|
SLAVE_NAME="buildworker"
|
||||||
SLAVE_SOCKET="localhost:9989"
|
SLAVE_SOCKET="localhost:9989"
|
||||||
BUILDBOT_PWD="pass-docker"
|
|
||||||
export PATH="/bin:sbin:/usr/bin:/usr/sbin:/usr/local/bin"
|
export PATH="/bin:sbin:/usr/bin:/usr/sbin:/usr/local/bin"
|
||||||
|
|
||||||
function run { su $USER -c "$1"; }
|
function run { su $USER -c "$1"; }
|
||||||
|
@ -23,7 +28,12 @@ run "mkdir -p $BUILDBOT_PATH"
|
||||||
cd $BUILDBOT_PATH
|
cd $BUILDBOT_PATH
|
||||||
run "buildbot create-master master"
|
run "buildbot create-master master"
|
||||||
run "cp $CFG_PATH/master.cfg master"
|
run "cp $CFG_PATH/master.cfg master"
|
||||||
run "sed -i -E 's#(DOCKER_PATH = ).+#\1\"$DOCKER_PATH\"#' master/master.cfg"
|
run "sed -i -E 's#(BUILDBOT_PWD = ).+#\1\"$BUILDBOT_PWD\"#' master/master.cfg"
|
||||||
|
run "sed -i -E 's#(IRC_PWD = ).+#\1\"$IRC_PWD\"#' master/master.cfg"
|
||||||
|
run "sed -i -E 's#(IRC_CHANNEL = ).+#\1\"$IRC_CHANNEL\"#' master/master.cfg"
|
||||||
|
run "sed -i -E 's#(SMTP_USER = ).+#\1\"$SMTP_USER\"#' master/master.cfg"
|
||||||
|
run "sed -i -E 's#(SMTP_PWD = ).+#\1\"$SMTP_PWD\"#' master/master.cfg"
|
||||||
|
run "sed -i -E 's#(EMAIL_RCP = ).+#\1\"$EMAIL_RCP\"#' master/master.cfg"
|
||||||
run "buildslave create-slave slave $SLAVE_SOCKET $SLAVE_NAME $BUILDBOT_PWD"
|
run "buildslave create-slave slave $SLAVE_SOCKET $SLAVE_NAME $BUILDBOT_PWD"
|
||||||
|
|
||||||
# Allow buildbot subprocesses (docker tests) to properly run in containers,
|
# Allow buildbot subprocesses (docker tests) to properly run in containers,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue