summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-essential.morph2
-rw-r--r--gitlab.configure44
-rw-r--r--gitlab.morph4
-rw-r--r--release.morph32
-rw-r--r--scripts/distbuild-cluster.py57
-rw-r--r--scripts/do-release.py322
-rw-r--r--tools.morph2
-rw-r--r--wayland-armv7-versatile.morph8
-rw-r--r--wayland-x86_64-generic.morph8
9 files changed, 344 insertions, 135 deletions
diff --git a/build-essential.morph b/build-essential.morph
index 13637ba2..4a7d7d9a 100644
--- a/build-essential.morph
+++ b/build-essential.morph
@@ -185,7 +185,7 @@ chunks:
prefix: /usr
- name: eglibc
repo: upstream:eglibc2
- ref: d4f380d3b4c5ef3ba05744240ef0f2c4dc605fa0
+ ref: df0258044f321990eadd647e03095a48ad04c1a8
unpetrify-ref: baserock/2.15-build-essential
build-depends:
- stage2-binutils
diff --git a/gitlab.configure b/gitlab.configure
index ab4ef561..9798c775 100644
--- a/gitlab.configure
+++ b/gitlab.configure
@@ -25,6 +25,12 @@
# * UNICORN_PORT
# * CI_PORT
# * UNICORN_CI_PORT
+# * MAIL_SEND_TYPE
+# * SMTP_ADDR
+# * SMTP_PORT
+# * SMTP_USER
+# * SMTP_PASS
+# * SMTP_DOMAIN
set -e
@@ -82,3 +88,41 @@ EOF
ln -s "/etc/systemd/system/gitlab-setup.service" \
"$ROOT/etc/systemd/system/multi-user.target.wants/gitlab-setup.service"
+
+##########################################################################
+
+rubyescape() {
+ # In ruby, single quoted strings need \ and ' escaping
+ printf "%s\n" "$1" | sed -e "s/['\\]/\\\&/g" \
+ -e "s/^/'/" \
+ -e "s/$/'/"
+}
+
+sedescape() {
+ # Escape all non-alphanumeric characters
+ printf "%s\n" "$1" | sed -e 's/\W/\\&/g'
+}
+
+do_escapes() {
+ printf "%s\n" "$(sedescape "$(rubyescape "$1")")"
+}
+
+if [ "$MAIL_SEND_TYPE" = "smtp" ]; then
+
+ echo "Setting up SMTP for sending e-mail"
+
+ for CONFIG_PATH in \
+ "/usr/share/gitlab-ce/config" "/usr/share/gitlab-ci/config"
+ do
+ sed -i 's/sendmail/smtp/' \
+ "$ROOT$CONFIG_PATH/environments/production.rb"
+
+ sed -e s/\"email.server.com\"/"$(do_escapes "$SMTP_ADDR")/g" \
+ -e s/\"smtp\"/"$(do_escapes "$SMTP_USER")/g" \
+ -e s/\"123456\"/"$(do_escapes "$SMTP_PASS")/g" \
+ -e s/\"gitlab.company.com\"/"$(do_escapes "$SMTP_DOMAIN")/g" \
+ -e s/456/$SMTP_PORT/g \
+ <"$ROOT$CONFIG_PATH/initializers/smtp_settings.rb.sample" \
+ >"$ROOT$CONFIG_PATH/initializers/smtp_settings.rb"
+ done
+fi
diff --git a/gitlab.morph b/gitlab.morph
index a731290a..bc345e1e 100644
--- a/gitlab.morph
+++ b/gitlab.morph
@@ -6,8 +6,8 @@ build-depends:
chunks:
- name: gitlab-ce
repo: upstream:gitlab/gitlab-ce
- ref: cdec1324173c2331153b671ef6ebab749bca9cd4
- unpetrify-ref: baserock/morph
+ ref: 53d98a77d34cbfddaef9eb25cf5f651a78550425
+ unpetrify-ref: baserock/v7.0.0
build-depends: []
- name: gitlab-ci
repo: upstream:gitlab/gitlab-ci
diff --git a/release.morph b/release.morph
index 4ec38837..62d718a8 100644
--- a/release.morph
+++ b/release.morph
@@ -2,28 +2,48 @@ name: release
kind: cluster
description: |
Deploy all the systems for we support in a release.
+
+ This cluster morph is used by the tool 'scripts/do-release'. While
+ you can deploy the systems yourself, if you are making a Baserock release
+ then the script should be used.
systems:
- morph: devel-system-x86_32-chroot
deploy:
devel-system-x86_32-chroot:
type: tar
- location: /src/release/baserock-14.26-devel-system-x86_32-chroot.tar
+ location: baserock-14.28-devel-system-x86_32-chroot.tar
- morph: devel-system-x86_32-generic
deploy:
devel-system-x86_32-generic:
type: rawdisk
- location: /src/release/baserock-14.26-devel-system-x86_32-generic.img
+ location: baserock-14.28-devel-system-x86_32-generic.img
DISK_SIZE: 4G
- VERSION_LABEL: baserock-14.26
- morph: devel-system-x86_64-chroot
deploy:
devel-system-x86_64-chroot:
type: tar
- location: /src/release/baserock-14.26-devel-system-x86_64-chroot.tar
+ location: baserock-14.28-devel-system-x86_64-chroot.tar
- morph: devel-system-x86_64-generic
deploy:
devel-system-x86_64-generic:
type: rawdisk
- location: /src/release/baserock-14.26-devel-system-x86_64-generic.img
+ location: baserock-14.28-devel-system-x86_64-generic.img
DISK_SIZE: 4G
- VERSION_LABEL: baserock-14.26
+- morph: devel-system-armv7lhf-wandboard
+ deploy:
+ release:
+ type: tar
+ location: baserock-14.28-devel-system-armv7lhf-wandboard.tar
+- morph: genivi-baseline-system-x86_64-generic
+ deploy:
+ genivi-baseline-system-x86_64-generic:
+ type: rawdisk
+ location: baserock-14.28-genivi-baseline-system-x86_64-generic.img
+ DISK_SIZE: 4G
+- morph: genivi-baseline-system-armv7lhf-versatile
+ deploy:
+ genivi-baseline-system-armv7lhf-versatile:
+ type: rawdisk
+ location: baserock-14.28-genivi-baseline-system-armv7lhf-versatile.img
+ DISK_SIZE: 4G
+ KERNEL_ARGS: vga=788
diff --git a/scripts/distbuild-cluster.py b/scripts/distbuild-cluster.py
index e5bada58..4c2151aa 100644
--- a/scripts/distbuild-cluster.py
+++ b/scripts/distbuild-cluster.py
@@ -18,6 +18,7 @@ import subprocess
import sys
import time
import yaml
+import argparse
import morphlib
@@ -32,15 +33,6 @@ handle multiple controllers).
'''
-controllers = {
- 'armv7lhf': '10.24.1.134',
- 'x86_32': 'distbuild-x86-32',
- 'x86_64': 'distbuild-x86-64',
-}
-
-
-ref_to_build = 'baserock-14.24'
-
def read_morph(morph_name, kind=None):
with open(morph_name + '.morph') as f:
@@ -49,18 +41,52 @@ def read_morph(morph_name, kind=None):
assert morph['kind'] == kind
return morph
+class Context:
+ '''Holds the script's general context stuff'''
+
+ def __init__(self):
+ # Handle the command line parameters and set up help/usage
+ purpose = 'Build all systems in a cluster using distbuild.'
+ parser = argparse.ArgumentParser(description=purpose)
+ parser.add_argument('cluster', nargs=1, help='Cluster to build')
+ parser.add_argument('ref', nargs=1, help='Reference to build')
+ parser.add_argument('controllers', nargs='*',
+ help='List of controllers [id:host] [id:host]...')
+ args = parser.parse_args()
+
+ # Build controller dictionary from supplied list of controllers
+ self.controllers = {}
+ for controller in args.controllers:
+ self.controllers.update([controller.split(':', 1)])
+
+ # Get cluster and ref to build from supplied arguments
+ self.ref_to_build = args.ref[0]
+ self.cluster_to_build = args.cluster[0]
+
+ def show(self):
+ # Print out the context
+ key_width = max(len(key) for key in self.controllers)
+
+ print "-"*80
+ print " Performing distbuild of: '" + self.cluster_to_build + "'"
+ print " with reference: '" + self.ref_to_build + "'"
+ print " Using controllers:"
+ for key, host in self.controllers.iteritems():
+ print " " + key.rjust(key_width) + ": " + host
+ print "-"*80
+
class Build(object):
'''A single distbuild instance.'''
- def __init__(self, system_name, arch):
+ def __init__(self, ctx, system_name, arch):
self.system_name = system_name
- self.distbuild_controller = controllers[system['arch']]
+ self.distbuild_controller = ctx.controllers[system['arch']]
self.command = [
'morph', 'distbuild-morphology',
'--controller-initiator-address=%s' % self.distbuild_controller,
- 'baserock:baserock/definitions', ref_to_build, system_name]
+ 'baserock:baserock/definitions', ctx.ref_to_build, system_name]
def start(self):
self.process = subprocess.Popen(self.command)
@@ -70,7 +96,10 @@ class Build(object):
if __name__ == '__main__':
- cluster_name = morphlib.util.strip_morph_extension(sys.argv[1])
+ ctx = Context()
+ ctx.show()
+
+ cluster_name = morphlib.util.strip_morph_extension(ctx.cluster_to_build)
cluster = read_morph(cluster_name, kind='cluster')
system_list = [system['morph'] for system in cluster['systems']]
@@ -78,7 +107,7 @@ if __name__ == '__main__':
builds = []
for system_name in system_list:
system = read_morph(system_name)
- builds.append(Build(system_name, system['arch']))
+ builds.append(Build(ctx, system_name, system['arch']))
# Morph dumps many log files to the current directory, which I don't
# want to be in the root of 'definitions'.
diff --git a/scripts/do-release.py b/scripts/do-release.py
index ce347632..5a86f090 100644
--- a/scripts/do-release.py
+++ b/scripts/do-release.py
@@ -41,22 +41,21 @@ class config(object):
build_trove = 'hawkdevtrove'
release_trove = 'git.baserock.org'
- # Note that the 'location' field of the various systems in release.morph
- # should match 'images_dir' here.
deploy_workspace = '/src/ws-release'
images_dir = '/src/release'
artifacts_dir = '/src/release/artifacts'
- # These locations should be appropriate 'staging' directories on the public
- # servers that host images and artifacts. Remember not to upload to the
- # public directories directly, or you risk exposing partially uploaded
- # files. Once everything has uploaded you can 'mv' the release artifacts
- # to the public directories in one quick operation.
- # FIXME: we should probably warn if the dir exists and is not empty.
- images_upload_location = \
- <YOUR USERNAME> '@download.baserock.org:baserock-release-staging'
- artifacts_upload_location = \
- 'root@git.baserock.org:/home/cache/baserock-release-staging'
+ images_server = <YOUR USERNAME> '@download.baserock.org'
+ artifacts_server = 'root@git.baserock.org'
+
+ # These paths are passed to rsync and ssh, so relative paths will be
+ # located inside the user's home directory. The artifact list file ends up
+ # in the parent directory of 'artifacts_public_path'.
+ images_upload_path = 'baserock-release-staging'
+ images_public_path = '/srv/download.baserock.org/baserock'
+
+ artifacts_upload_path = '/home/cache/baserock-release-staging'
+ artifacts_public_path = '/home/cache/artifacts'
# The Codethink Manchester office currently has 8Mbits/s upload available.
# This setting ensures we use no more than half of the available bandwidth.
@@ -70,8 +69,7 @@ def status(message, *args):
@contextlib.contextmanager
def cwd(path):
- '''
- Context manager to set current working directory.'''
+ '''Context manager to set current working directory.'''
old_cwd = os.getcwd()
os.chdir(path)
try:
@@ -136,70 +134,53 @@ class DeployImages(object):
assert morph['kind'] == kind
return morph
- def parse_release_cluster(self, release_cluster):
- '''Validate release cluster and list the systems being released.
-
- This function returns a dict mapping the system name to the location
- of its deployed image.
+ def deploy_single_image(self, system_name, location, version_label):
+ deploy_command = [
+ 'morph', 'deploy', 'release.morph', system_name,
+ '--trove-host=%s' % config.build_trove,
+ '%s.location=%s' % (system_name, location),
+ '%s.VERSION_LABEL=%s' % (system_name, version_label)
+ ]
- It's an open question how we should detect and handle the case where a
- write extension creates more than one file. ARM kernels and GENIVI
- manifest files are possible examples of this.
+ cliapp.runcmd(deploy_command, stdout=sys.stdout)
- '''
+ def deploy_images(self, release_cluster):
+ '''Use `morph deploy` to create the release images.'''
version_label = 'baserock-%s' % config.release_number
-
outputs = {}
+
for system in release_cluster['systems']:
- system_morph = system['morph']
+ system_name = system['morph']
- if system_morph not in system['deploy']:
+ if system_name not in system['deploy']:
raise cliapp.AppException(
'In release.morph: system %s ID should be "%s"' %
- (system_morph, system_morph))
-
- # We can't override 'location' with a different value. We must use
- # what's already in the morphology, and check that it makes sense.
- location = system['deploy'][system_morph]['location']
- if not os.path.samefile(os.path.dirname(location),
- config.images_dir):
- raise cliapp.AppException(
- 'In release.morph: system location %s is not inside '
- 'configured images_dir %s' % (location, config.images_dir))
- if not os.path.basename(location).startswith(version_label):
- raise cliapp.AppException(
- 'In release.morph: system image name %s does not start '
- 'with version label %s' % (location, version_label))
-
- outputs[system_morph] = location
-
- return outputs
+ (system_name, system_name))
- def deploy_images(self, outputs):
- '''Use `morph deploy` to create the release images.'''
+ # The release.morph cluster must specify a basename for the file,
+ # of system-name + extension. This script knows system-name, but it
+ # can't find out the appropriate file extension without
+ # second-guessing the behaviour of write extensions.
+ basename = system['deploy'][system_name]['location']
- # FIXME: once `morph deploy` supports partial deployment, this should
- # deploy only the images which aren't already deployed... it should
- # also check if they need redeploying based on the SHA1 they were
- # deployed from, perhaps. That's getting fancy!
+ if '/' in basename or basename.startswith(version_label):
+ raise cliapp.AppException(
+ 'In release.morph: system %s.location should be just the '
+ 'base name, e.g. "%s.img"' % (system_name, system_name))
- todo = [f for f in outputs.itervalues() if not os.path.exists(f)]
+ filename = '%s-%s' % (version_label, basename)
+ location = os.path.join(config.images_dir, filename)
- if len(todo) == 0:
- status('Reusing existing release images')
- else:
- logging.debug('Need to deploy images: %s' % ', '.join(todo))
- status('Creating release images from release.morph')
-
- version_label = 'baserock-%s' % config.release_number
+ if os.path.exists(location):
+ status('Reusing existing deployment of %s', filename)
+ else:
+ status('Creating %s from release.morph', filename)
+ self.deploy_single_image(system_name, location, version_label)
- morph_config = ['--trove-host=%s' % config.build_trove]
- deploy_config = ['release.VERSION_LABEL=%s' % version_label]
+ outputs[system_name] = location
- cliapp.runcmd(
- ['morph', 'deploy', 'release.morph'] + morph_config +
- deploy_config, stdout=sys.stdout)
+ return outputs
def compress_images(self, outputs):
for name, source_file in outputs.iteritems():
@@ -220,17 +201,28 @@ class DeployImages(object):
with cwd(definitions_dir):
release_cluster = self.read_morph('release.morph', kind='cluster')
-
- outputs = self.parse_release_cluster(release_cluster)
-
- with cwd(definitions_dir):
- self.deploy_images(outputs)
+ outputs = self.deploy_images(release_cluster)
self.compress_images(outputs)
return outputs
+class ArtifactsBundle(object):
+ '''State that is the results of the PrepareArtifacts stage.'''
+ def __init__(self, all_artifacts, new_artifacts,
+ all_artifacts_manifest, all_artifacts_tar,
+ new_artifacts_tar):
+ # Artifact basenames
+ self.all_artifacts = all_artifacts
+ self.new_artifacts = new_artifacts
+
+ # Bundle files
+ self.all_artifacts_manifest = all_artifacts_manifest
+ self.all_artifacts_tar = all_artifacts_tar
+ self.new_artifacts_tar = new_artifacts_tar
+
+
class PrepareArtifacts(object):
'''Stage 2: Fetch all artifacts and archive them.
@@ -251,11 +243,11 @@ class PrepareArtifacts(object):
Morph of Baserock 14.23 or later.
'''
- artifact_list_file = os.path.join(
+ artifact_manifest = os.path.join(
config.artifacts_dir, 'baserock-%s-artifacts.txt' %
config.release_number)
- if os.path.exists(artifact_list_file):
- with open(artifact_list_file) as f:
+ if os.path.exists(artifact_manifest):
+ with open(artifact_manifest) as f:
artifact_basenames = [line.strip() for line in f]
else:
text = cliapp.runcmd(
@@ -263,9 +255,9 @@ class PrepareArtifacts(object):
'list-artifacts', 'baserock:baserock/definitions', 'master'] +
system_morphs)
artifact_basenames = text.strip().split('\n')
- with morphlib.savefile.SaveFile(artifact_list_file, 'w') as f:
+ with morphlib.savefile.SaveFile(artifact_manifest, 'w') as f:
f.write(text)
- return artifact_list_file, artifact_basenames
+ return artifact_manifest, artifact_basenames
def query_remote_artifacts(self, trove, artifact_basenames):
url = 'http://%s:8080/1.0/artifacts' % trove
@@ -360,11 +352,12 @@ class PrepareArtifacts(object):
if not os.path.exists(config.artifacts_dir):
os.makedirs(config.artifacts_dir)
- artifact_list_file, all_artifacts = \
+ artifact_manifest, all_artifacts = \
self.get_artifact_list(system_morphs)
found_artifacts = self.fetch_artifacts(all_artifacts)
+ # Prepare a tar of all artifacts
tar_name = 'baserock-%s-artifacts.tar.gz' % config.release_number
artifacts_tar_file = os.path.join(config.artifacts_dir, tar_name)
artifact_files = [
@@ -372,25 +365,43 @@ class PrepareArtifacts(object):
self.prepare_artifacts_archive(artifacts_tar_file, artifact_files)
+ # Also make a tar of just the artifacts that the target Trove doesn't
+ # already have.
tar_name = 'baserock-%s-new-artifacts.tar.gz' % config.release_number
new_artifacts_tar_file = os.path.join(config.artifacts_dir, tar_name)
result = self.query_remote_artifacts(config.release_trove,
found_artifacts)
new_artifacts = [a for a, present in result.iteritems() if not present]
+
+ artifact_is_system = lambda name: name.split('.')[1] == 'system'
+ new_artifacts = [a for a in new_artifacts if not artifact_is_system(a)]
+
new_artifact_files = [
- os.path.join(config.artifacts_dir, a) for a in new_artifacts
- if a.split('.')[1] != 'system']
+ os.path.join(config.artifacts_dir, a) for a in new_artifacts]
self.prepare_artifacts_archive(new_artifacts_tar_file,
new_artifact_files)
- return (artifact_list_file, artifacts_tar_file, new_artifacts_tar_file)
+ return ArtifactsBundle(
+ all_artifacts=found_artifacts,
+ new_artifacts=new_artifacts,
+ all_artifacts_manifest=artifact_manifest,
+ all_artifacts_tar=artifacts_tar_file,
+ new_artifacts_tar=new_artifacts_tar_file,
+ )
class Upload(object):
- '''Stage 3: upload images and artifacts to public servers.'''
+ '''Stage 3: upload images and artifacts to public servers.
+
+ The files are not uploaded straight to the public directories, because
+ this could lead to partially uploaded artifacts being downloaded by eager
+ users.
- def run_rsync(self, sources, target):
+ '''
+
+ def run_rsync(self, sources, target_server, target_path):
+ target = '%s:%s' % (target_server, target_path)
if isinstance(sources, str):
sources = [sources]
settings = [
@@ -401,44 +412,149 @@ class Upload(object):
cliapp.runcmd(
['rsync'] + settings + sources + [target], stdout=sys.stdout)
+ def extract_remote_tar(self, server, filename, target_dir):
+ extract_command = \
+ ['tar', '-x', '-C', target_dir, '-f', filename]
+ cliapp.ssh_runcmd(server, extract_command)
+
def upload_release_images(self, images):
- self.run_rsync(images, config.images_upload_location)
+ status('Uploading images to %s', config.images_server)
+ self.run_rsync(images, config.images_server, config.images_upload_path)
+
+ def upload_artifacts(self, bundle):
+ server = config.artifacts_server
+ path = config.artifacts_upload_path
+ files = [bundle.all_artifacts_manifest, bundle.new_artifacts_tar]
+
+ status('Uploading new artifacts to %s', server)
+ self.run_rsync(files, server, path)
+
+ remote_artifacts_tar = self.path_relocate(
+ config.artifacts_upload_path, bundle.new_artifacts_tar)
+
+ status('Extracting %s:%s', server, remote_artifacts_tar)
+ self.extract_remote_tar(server, remote_artifacts_tar, path)
+
+ def move_files_into_public_location(self, server, remote_files,
+ remote_target_dir, mode=None,
+ owner=None):
+ '''Move files into a public location on a remote system.
+
+ It'd be nice to do this using install(1) but that copies the files
+ rather than moving them. Since the target is accessible over the
+ internet, the operation must be atomic so that users will not see
+ partially-copied files.
+
+ This function is used to copy large lists of artifact files, so it
+ supports a simple batching mechanism to avoid hitting ARG_MAX. It'd
+ be a better solution to extend morph-cache-server to allow receiving
+ the artifacts. This would require adding some kind of authentication to
+ its API, though. Note that using xargs and sending the list of files
+ over stdin isn't a perfect solution (although perhaps better than the
+ current one) because Busybox's 'mv' doesn't support the '-t' option,
+ making it very awkward to use with 'xargs'.
- def upload_artifacts(self, artifacts_list_file, artifacts_tar_file):
- host, path = config.artifacts_upload_location.split(':', 1)
+ '''
- self.run_rsync([artifacts_list_file, artifacts_tar_file],
- config.artifacts_upload_location)
+ def batch(iterable, batch_size):
+ '''Split an iterable up into batches of 'batch_size' items.'''
+ result = []
+ for item in iterable:
+ result.append(item)
+ if len(result) >= batch_size:
+ yield result
+ result = []
+ yield result
+
+ cliapp.ssh_runcmd(server, ['mkdir', '-p', remote_target_dir])
+ for file_batch in batch(remote_files, 1024):
+ if mode is not None:
+ cliapp.ssh_runcmd(server, ['chmod', mode] + file_batch)
+ if owner is not None:
+ cliapp.ssh_runcmd(server, ['chown', owner] + file_batch)
+ cliapp.ssh_runcmd(
+ server, ['mv'] + file_batch + [remote_target_dir])
+
+ def path_relocate(self, new_parent, path):
+ return os.path.join(new_parent, os.path.basename(path))
+
+ def parent_dir(self, path):
+ return os.path.dirname(path.rstrip('/'))
+
+ def make_images_public(self, image_files):
+ server = config.images_server
+ upload_dir = config.images_upload_path
+ files = [self.path_relocate(upload_dir, f) for f in image_files]
+ target_dir = config.images_public_path
+
+ status('Moving images into %s:%s', server, target_dir)
+ self.move_files_into_public_location(
+ server, files, target_dir, mode='644')
+
+ def make_artifacts_public(self, bundle):
+ server = config.artifacts_server
+ upload_dir = config.artifacts_upload_path
+ files = [
+ self.path_relocate(upload_dir, a) for a in bundle.new_artifacts]
+ target = config.artifacts_public_path
+
+ status('Moving artifacts into %s:%s', server, target)
+ self.move_files_into_public_location(
+ server, files, target, mode='644', owner='cache:cache')
+
+ manifest_file = self.path_relocate(
+ config.artifacts_upload_path, bundle.all_artifacts_manifest)
+ self.move_files_into_public_location(
+ server, [manifest_file], self.parent_dir(target), mode='644')
+
+ def remove_intermediate_files(self, bundle):
+ server = config.artifacts_server
+ remote_artifacts_tar = self.path_relocate(
+ config.artifacts_upload_path, bundle.new_artifacts_tar)
+
+ status('Removing %s:%s', server, remote_artifacts_tar)
+ cliapp.ssh_runcmd(server, ['rm', remote_artifacts_tar])
+
+
+def check_ssh_access(server):
+ status('Checking for access to server %s', server)
- # UGH! Perhaps morph-cache-server should grow an authorised-users-only
- # API call receive artifacts, to avoid this.
- remote_artifacts_tar = os.path.join(
- path, os.path.basename(artifacts_tar_file))
- extract_tar_cmd = 'cd "%s" && tar xf "%s" && chown cache:cache *' % \
- (path, remote_artifacts_tar)
- cliapp.ssh_runcmd(
- host, ['sh', '-c', extract_tar_cmd])
+ try:
+ cliapp.ssh_runcmd(server, ['true'])
+ except cliapp.AppException as e:
+ logging.debug('Got exception: %s', e)
+ raise cliapp.AppException(
+ 'Couldn\'t connect to configured remote server %s' % server)
def main():
- logging.basicConfig(level=logging.DEBUG)
+ logging.basicConfig(level=logging.INFO)
+
+ check_ssh_access(config.images_server)
+ check_ssh_access(config.artifacts_server)
deploy_images = DeployImages()
outputs = deploy_images.run()
+ system_names = outputs.keys()
+ image_files = outputs.values()
+
prepare_artifacts = PrepareArtifacts()
- artifacts_list_file, artifacts_tar_file, new_artifacts_tar_file = \
- prepare_artifacts.run(outputs.keys())
+ artifacts_bundle = prepare_artifacts.run(system_names)
upload = Upload()
- upload.upload_release_images(outputs.values())
- upload.upload_artifacts(artifacts_list_file, new_artifacts_tar_file)
-
- sys.stdout.writelines([
- '\nPreparation for %s release complete!\n' % config.release_number,
- 'Images uploaded to %s\n' % config.images_upload_location,
- 'Artifacts uploaded to %s\n' % config.artifacts_upload_location
- ])
+ upload.upload_release_images(image_files)
+ upload.upload_artifacts(artifacts_bundle)
+
+ upload.make_images_public(image_files)
+ upload.make_artifacts_public(artifacts_bundle)
+
+ upload.remove_intermediate_files(artifacts_bundle)
+
+ status('Images uploaded to %s:%s',
+ config.images_server, config.images_public_path)
+ status('Artifacts uploaded to %s:%s',
+ config.artifacts_server, config.artifacts_public_path)
main()
diff --git a/tools.morph b/tools.morph
index a97bcab8..cb7eb6ff 100644
--- a/tools.morph
+++ b/tools.morph
@@ -92,7 +92,7 @@ chunks:
- six
- name: morph
repo: baserock:baserock/morph
- ref: 770a6cb434ac31238eb2eee526e235728ce07aff
+ ref: fe4486c1ec69c520a2c0aee7b52c35b57808120e
unpetrify-ref: master
build-depends:
- cliapp
diff --git a/wayland-armv7-versatile.morph b/wayland-armv7-versatile.morph
index 1bc2019c..3980c170 100644
--- a/wayland-armv7-versatile.morph
+++ b/wayland-armv7-versatile.morph
@@ -110,8 +110,8 @@ chunks:
- freefont-otf
- name: weston
repo: upstream:weston
- ref: 721c0f13ab80eb209983c1d73e168df4ffb70ddc
- unpetrify-ref: baserock/genivi/weston-ivi-shell-patches
+ ref: 8658e06e69cc3944e89684a2de619e479751633f
+ unpetrify-ref: baserock/genivi/baseline-h-1.1
build-depends:
- pango
- pixman
@@ -122,8 +122,8 @@ chunks:
- cairo
- name: wayland-ivi-extension
repo: upstream:genivi/wayland-ivi-extension
- ref: 167029fad4d2896491093ee313a663f2f057217e
- unpetrify-ref: baserock/genivi/baseline
+ ref: 8b59529cf3b279a948f253bc79263d00d3f051a5
+ unpetrify-ref: baserock/genivi/baseline-h-1.1
build-depends:
- wayland
- weston
diff --git a/wayland-x86_64-generic.morph b/wayland-x86_64-generic.morph
index 6441a1f3..353b953b 100644
--- a/wayland-x86_64-generic.morph
+++ b/wayland-x86_64-generic.morph
@@ -110,8 +110,8 @@ chunks:
- freefont-otf
- name: weston
repo: upstream:weston
- ref: 721c0f13ab80eb209983c1d73e168df4ffb70ddc
- unpetrify-ref: baserock/genivi/weston-ivi-shell-patches
+ ref: 8658e06e69cc3944e89684a2de619e479751633f
+ unpetrify-ref: baserock/genivi/baseline-h-1.1
build-depends:
- pango
- wayland
@@ -122,8 +122,8 @@ chunks:
- libxkbcommon
- name: wayland-ivi-extension
repo: upstream:genivi/wayland-ivi-extension
- ref: 167029fad4d2896491093ee313a663f2f057217e
- unpetrify-ref: baserock/genivi/baseline
+ ref: 8b59529cf3b279a948f253bc79263d00d3f051a5
+ unpetrify-ref: baserock/genivi/baseline-h-1.1
build-depends:
- wayland
- weston