summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2015-08-05 09:34:53 +0200
committerParménides GV <parmegv@sdf.org>2015-08-05 09:34:53 +0200
commit6b0e3a7953dd984b0ea2f4da536812e5a877b5d2 (patch)
tree0fb3a89e1e06265c58c77cf6e24996a2c453c5f5
parentc6835bb3342154adf768288ef7596d46c3a963c9 (diff)
Bundler builder.
Generate bundle using bundler's bundle_pyinstaller.sh, and publish it.
-rw-r--r--conf_template.cfg4
-rw-r--r--master.cfg49
2 files changed, 47 insertions, 6 deletions
diff --git a/conf_template.cfg b/conf_template.cfg
index 4b59e89..ad2c14d 100644
--- a/conf_template.cfg
+++ b/conf_template.cfg
@@ -8,4 +8,6 @@ ssh_port = port
ssh_key = ~/.ssh/id
user = user
server = server
-directory = ~/wheels \ No newline at end of file
+directory = ~/wheels
+sumo_target_directory = ~/sumo-tarball
+bundle_target_directory = ~/bundles \ No newline at end of file
diff --git a/master.cfg b/master.cfg
index 3e606b5..c8569b0 100644
--- a/master.cfg
+++ b/master.cfg
@@ -81,6 +81,10 @@ c['schedulers'].append(ForceScheduler(
name="force_build_of_wheels",
builderNames=['builder_wheels']))
+c['schedulers'].append(ForceScheduler(
+ name="force_build_of_bundler",
+ builderNames=['builder_bundler']))
+
####### BUILDERS
# The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
@@ -163,12 +167,11 @@ def create_builder(repo_name):
def publish_sumo_command(location):
directory = config.get('ftp', 'sumo_target_directory')
- command = ftp_publish_command(location, directory) + '&&' + ftp_soft_link_sumo(location)
+ command = ftp_publish_command(location, directory) + ' && ' + ftp_soft_link(location, directory, 'leap.bitmask-latest-SUMO.tar.gz')
return command
-def ftp_soft_link_sumo(filename):
- directory = config.get('ftp', 'sumo_target_directory')
+def ftp_soft_link(filename, target_directory, symlink_name):
ssh_port = config.get('ftp', 'ssh_port')
ssh_key = config.get('ftp', 'ssh_key')
user = config.get('ftp', 'user')
@@ -178,7 +181,7 @@ def ftp_soft_link_sumo(filename):
"-i", ssh_key,
'-p', ssh_port,
user + '@' + server,
- '"ln -sf ' + directory + '/' + filename + ' ' + directory + '/leap.bitmask-latest-SUMO.tar.gz"']
+ '"ln -sf ' + target_directory + '/' + filename + ' ' + target_directory + '/' + symlink_name + '"']
# Flatten to a string so that a shell executes de command, and
# expands ~
@@ -202,7 +205,7 @@ def ftp_publish_command(from_location, to_location):
"-i", ssh_key,
'-p', ssh_port,
user + '@' + server,
- '"chmod g+r ' + to_location + ' && chown -R ' + user + ':www-data ' + to_location + '"']
+ '"chmod -R g+r ' + to_location + ' && chown -R ' + user + ':www-data ' + to_location + '"']
# Flatten to a string so that a shell executes de command, and
# expands ~
return ' '.join(scp_command) + ' && ' + ' '.join(ssh_command)
@@ -243,12 +246,48 @@ def publish_wheels_command():
return ftp_publish_dir_command(original_wheelhouse, directory)
+def make_bundler_builder():
+ builder_name = "builder_bundler"
+ factory = BuildFactory()
+ repo_name = "bitmask_bundler"
+ repo_url = "https://github.com/parmegv/" + repo_name + ".git"
+ branch = "feature/pyinstaller_bundler"
+ cryptography_version = "0.9.3"
+
+ workdir="build"
+ repo_dir = workdir + "/" + repo_name
+ bundler_output_dir = "bundler_output"
+ sumo_tarball = "leap.bitmask-latest-SUMO.tar.gz"
+
+ publish_bundle = publish_bundle_command('`ls -t *.tar.gz | head -1`')
+
+ factory.addSteps([
+ # Git(repourl=repo_url, branch=branch, workdir=repo_dir, mode='incremental', method='clean', haltOnFailure=True, name="Pull " + repo_url),
+ # ShellCommand(command="rm -rf " + bundler_output_dir, workdir=workdir, name="Remove previous bundler dir"),
+ # ShellCommand(command="mkdir " + bundler_output_dir, workdir=workdir, name="Create bundler dir"),
+ # ShellCommand(command="cp bundle_pyinstaller.sh download_osrandom_engine.sh ../" + bundler_output_dir, workdir=repo_dir, haltOnFailure=True, name="Copy bundle_pyinstaller"),
+ # ShellCommand(command="mkdir files", workdir=workdir + '/' + bundler_output_dir, name="Create auxiliary folder"),
+ # ShellCommand(command="./download_osrandom_engine.sh 0.9.3 files", workdir=workdir + '/' + bundler_output_dir, haltOnFailure=True, name="Create auxiliary folder"),
+ # ShellCommand(command="wget http://lizard.leap.se/sumo-tarball/" + sumo_tarball, workdir=workdir + '/' + bundler_output_dir, haltOnFailure=True, name="Download sumo"),
+ # ShellCommand(command="./bundle_pyinstaller.sh " + sumo_tarball, workdir=workdir + '/' + bundler_output_dir, name="Create bundle"),
+ ShellCommand(command=publish_bundle, workdir=workdir + '/' + bundler_output_dir, name="Publish bundle")
+ ])
+
+ return BuilderConfig(name=builder_name, slavenames=[localhost_slave], factory=factory)
+
+def publish_bundle_command(location):
+ directory = config.get('ftp', 'bundle_target_directory')
+ command = ftp_publish_command(location, directory) + ' && ' + ftp_soft_link(location, directory, 'bitmask-latest.tar.gz')
+
+ return command
+
c['builders'] = []
for repo_name, _, _, _ in REPOS:
c['builders'].append(create_builder(repo_name))
c['builders'].append(make_wheel_builder())
+c['builders'].append(make_bundler_builder())
####### STATUS TARGETS
# 'status' is a list of Status Targets. The results of each build will be