aboutsummaryrefslogtreecommitdiffstats
path: root/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py')
-rw-r--r--lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py315
1 files changed, 0 insertions, 315 deletions
diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py b/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py
deleted file mode 100644
index 8ea6a81f..00000000
--- a/lib/python2.7/site-packages/autobuilder/buildsteps/PublishArtifacts.py
+++ /dev/null
@@ -1,315 +0,0 @@
-'''
-Created on Jan 11, 2013
-
-__author__ = "Elizabeth 'pidge' Flanagan"
-__copyright__ = "Copyright 2012-2013, Intel Corp."
-__credits__ = ["Elizabeth Flanagan"]
-__license__ = "GPL"
-__version__ = "2.0"
-__maintainer__ = "Elizabeth Flanagan"
-__email__ = "pidge@toganlabs.com"
-'''
-
-from buildbot.steps.shell import ShellCommand
-from twisted.python import log
-import os, datetime
-from autobuilder.config import *
-
-class PublishArtifacts(ShellCommand):
-
- haltOnFailure = False
- flunkOnFailure = True
- name = "Publishing Artifacts"
- def __init__(self, factory, argdict=None, **kwargs):
- self.factory = factory
- self.description = "Publishing Artifacts"
- self.workerdir=os.path.join(os.path.join(YOCTO_ABBASE, "yocto-worker"))
- for k, v in argdict.iteritems():
- if type(v) is bool:
- setattr(self, k, str(v))
- else:
- setattr(self, k, v)
- self.timeout = 100000
- kwargs['timeout']=self.timeout
- ShellCommand.__init__(self, **kwargs)
-
- def start(self):
- pipeline = "|| export PA_FAIL=1"
- DEST=self.getProperty("DEST")
- buildername=self.getProperty("buildername")
- got_revision_poky=self.getProperty("got_revision_poky")
- distroversion=self.getProperty("distroversion")
- self.layerversion_yoctobsp = int(self.getProperty("layerversion_yoctobsp", "0"))
- self.layerversion_yocto = int(self.getProperty("layerversion_yocto", "0"))
- self.layerversion_core = int(self.getProperty("layerversion_core", "0"))
- self.minnowExists = self.getProperty("minnowExists", "False")
- self.basedir=os.path.join(os.path.join(
- self.workerdir, buildername),
- "build/build/")
- self.tmpdir = os.environ.get("TMP_DIR")
- if self.tmpdir is None:
- self.tmpdir = os.path.join(self.basedir, "tmp")
- command = ""
- deploy = self.getProperty("custom_deploy_artifacts", "False")
- if str(os.environ.get('PUBLISH_BUILDS')) == "True" \
- and deploy == "True":
- for artifact in self.artifacts:
- if self.layerversion_yoctobsp > 1 and artifact == "atom-pc":
- artifact = "genericx86"
- elif self.layerversion_yoctobsp < 2 and artifact == "genericx86":
- artifact = "atom-pc"
- if self.layerversion_yoctobsp < 2 and artifact == "genericx86-64":
- artifact = "None"
- if self.minnowExists == "False" and "minnow" in artifact:
- artifact = "None"
- if self.layerversion_yoctobsp > 2 and artifact == "beagleboard":
- artifact = "beaglebone"
- elif self.layerversion_yoctobsp < 3 and artifact == "beaglebone-yocto":
- artifact = "beagleboard"
- elif self.layerversion_yoctobsp < 4 and artifact == "beaglebone-yocto":
- artifact = "beaglebone"
-
- if self.layerversion_yoctobsp > 2 and artifact == "routerstationpro":
- artifact = "edgerouter"
- elif self.layerversion_yoctobsp < 3 and artifact == "edgerouter":
- artifact = "routerstationpro"
- if self.layerversion_core > 7 and "adt" in artifact:
- artifact = "None"
- elif self.layerversion_core < 8 and "uninative" in artifact:
- artifact = "None"
-
- if artifact == "adt-installer":
- command=command+"mkdir -p " + os.path.join(DEST, ADT_INST_PUBLISH_DIR) + ";"
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(self.tmpdir, "deploy/sdk/") + \
- "*adt* " + os.path.join(DEST, ADT_INST_PUBLISH_DIR) + pipeline + ";"
- elif artifact == "adt-installer-QA":
- command=command+"mkdir -p " + os.path.join(DEST, ADTQA_INST_PUBLISH_DIR) + ";"
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(self.tmpdir, "deploy/sdk/") + \
- "*adt* " + os.path.join(DEST, ADTQA_INST_PUBLISH_DIR) + pipeline + ";"
- elif artifact == "adtrepo-dev":
- adt_dev_dest= os.environ.get("ADTREPO_DEV_PATH") + "/" + distroversion + "-" + got_revision_poky + '-' + self.getProperty("branch_poky")
- command=command+"mkdir -p " + adt_dev_dest + "/adt-ipk;"
- command=command+"rsync -av " + os.path.join(self.tmpdir, "deploy/ipk/") + " " + adt_dev_dest + "/adt-ipk " + pipeline + ";"
- command=command+"rm -rf " + adt_dev_dest + "/rootfs; mkdir -p " + adt_dev_dest + "/rootfs;"
- command=command+"for x in `ls " + DEST + "/machines/qemu/|grep -v tiny`; do ln -s " + DEST + "/machines/qemu/$x " + adt_dev_dest + "/rootfs/$x; done;"
- if self.layerversion_yocto < 2:
- command=command+"mv " + adt_dev_dest + "/rootfs/qemux86-64 " + adt_dev_dest + "/rootfs/qemux86_64;"
- elif "eclipse-plugin" in artifact:
- artifact_base = artifact.replace("eclipse-plugin-", "")
- deploy_dir = os.path.join(os.path.join(self.workerdir, buildername), "build/scripts")
- # create md5sums only for the zip files
- if os.environ.get('GEN_IMG_MD5') == "True":
- command += "for x in `ls " + deploy_dir + "/*.zip`;"
- command += "do md5sum $x >> " + "$x.md5sum; done;"
- command=command+"mkdir -p " + DEST + "/eclipse-plugin/"+ artifact_base +";"
- command=command+"cp --no-dereference --preserve=links " + \
- os.path.join(deploy_dir, "org.*.zip") + \
- " " + os.path.join(deploy_dir, "org.*.md5sum") + \
- " " + DEST + "/eclipse-plugin/"+ artifact_base + pipeline + ";"
- elif artifact == "build-appliance":
- command=command+"mkdir -p " + DEST + "/" + BA_PUBLISH_DIR + ";"
- if self.layerversion_core > 2:
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(self.tmpdir, "deploy/images/qemux86-64/*.zip") + \
- " " + DEST + "/" + BA_PUBLISH_DIR + pipeline + ";"
- else:
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(self.tmpdir, "deploy/images/*.zip") + \
- " " + DEST + "/" + BA_PUBLISH_DIR + pipeline + ";"
- elif artifact == "buildtools-tarball":
- artifact_name, deploy_image_dir = self.getDeployNames(artifact, buildername)
- command=command+self.generateMD5cmd(artifact, deploy_image_dir)
- command=command+"mkdir -p " + DEST + "/buildtools;"
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(deploy_image_dir, "*buildtools*") + \
- " " + DEST + "/buildtools" + pipeline + ";"
- elif artifact == "rpm":
- command=command+"mkdir -p " + os.path.join(DEST, RPM_PUBLISH_DIR) + ";"
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(self.tmpdir, "deploy/rpm/* ") + \
- os.path.join(DEST, RPM_PUBLISH_DIR) + pipeline + ";"
- elif artifact == "deb":
- command=command+"mkdir -p " + os.path.join(DEST, DEB_PUBLISH_DIR) + ";"
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(self.tmpdir, "deploy/deb/* ") + \
- os.path.join(DEST, DEB_PUBLISH_DIR) + pipeline + ";"
- elif artifact == "ipk":
- command=command+"mkdir -p " + os.path.join(DEST, IPK_PUBLISH_DIR) + ";"
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(self.tmpdir, "deploy/ipk/* ") + \
- os.path.join(DEST, IPK_PUBLISH_DIR) + pipeline + ";"
- elif artifact == "sstate":
- if str(os.environ.get("PUBLISH_SSTATE")) == "True":
- is_release = self.getProperty('custom_is_release', 'No')
- if is_release == 'No':
- is_release = self.getProperty("is_release")
- release = str(is_release) == "True"
- sstate_dir = os.environ.get("SSTATE_DIR")
- pub_dir = os.environ.get("SSTATE_PUBLISH_DIR")
- rel_dir = ""
- if release and self.layerversion_core > 8:
- sstate_release_number = self.get_release_number()
- sstate_dir = sstate_dir + '-' + sstate_release_number
- rel_dir = pub_dir + '-' + sstate_release_number
- if sstate_dir is not None and pub_dir is not None:
- command=command+"mkdir -p " + pub_dir + pipeline + ";"
- command=command+"cp -R --no-dereference --preserve=links " + \
- sstate_dir + "/* " + pub_dir + pipeline + ";"
- if release:
- command=command+"mkdir -p " + rel_dir + pipeline + ";"
- # For a release build we want to deep copy symlinks
- command=command+"cp -R --dereference --preserve=links " + \
- sstate_dir + "/* " + rel_dir + pipeline + ";"
- else:
- command=command+"echo 'Skipping copy of sstate, directories not configured.';"
- else:
- command=command+"echo 'Skipping copy of sstate, PUBLISH_SSTATE not set.';"
- elif artifact == "toolchain":
- artifact_name, deploy_image_dir = self.getDeployNames(artifact, buildername)
- command=command+self.generateMD5cmd(artifact, deploy_image_dir)
- command=command+"mkdir -p " + os.path.join(DEST, X86TC_PUBLISH_DIR) + ";"
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(deploy_image_dir, "poky-*i686-core-image* ") + \
- os.path.join(DEST, X86TC_PUBLISH_DIR) + pipeline + ";"
- command=command+"mkdir -p " + os.path.join(DEST, X8664TC_PUBLISH_DIR) + ";"
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(deploy_image_dir, "poky-*x86_64-core-image* ") + \
- os.path.join(DEST, X8664TC_PUBLISH_DIR) + pipeline + ";"
- elif artifact == "uninative":
- artifact_name, deploy_image_dir = self.getDeployNames(artifact, buildername)
- command=command+self.generateMD5cmd(artifact, deploy_image_dir)
- command=command+"mkdir -p " + os.path.join(DEST, X86TC_PUBLISH_DIR) + ";"
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(deploy_image_dir, "i686-nativesdk-libc* ") + \
- os.path.join(DEST, X86TC_PUBLISH_DIR) + pipeline + ";"
- command=command+"mkdir -p " + os.path.join(DEST, X8664TC_PUBLISH_DIR) + ";"
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(deploy_image_dir, "x86_64-nativesdk-libc* ") + \
- os.path.join(DEST, X8664TC_PUBLISH_DIR) + pipeline + ";"
- elif artifact == "oe-toolchain":
- command=command+"mkdir -p " + os.path.join(DEST, X86TC_PUBLISH_DIR) + ";"
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(self.tmpdir, "deploy/sdk/oecore-i686* ") + \
- os.path.join(DEST, X86TC_PUBLISH_DIR) + pipeline + ";"
- command=command+"mkdir -p " + os.path.join(DEST, X8664TC_PUBLISH_DIR) + ";"
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(self.tmpdir, "deploy/sdk/oecore-x86_64* ") + \
- os.path.join(DEST, X8664TC_PUBLISH_DIR) + pipeline + ";"
- elif "qemu" in artifact:
- artifact_name, deploy_image_dir = self.getDeployNames(artifact, buildername)
- command += self.generateMD5cmd(artifact, deploy_image_dir)
- command=command+"mkdir -p " + DEST + "/" + QEMU_PUBLISH_DIR + "/" + artifact_name + ";"
- if "-wic" in buildername:
- deploy_image_dir += "/*/*"
- if self.layerversion_core < 10:
- deploy_image_dir += "/build"
- command=command+"cp --no-dereference --preserve=links " + \
- deploy_image_dir + "/*\.direct " + \
- deploy_image_dir + "/*\.direct.md5sum " + \
- DEST + "/" + QEMU_PUBLISH_DIR + "/" + artifact_name + pipeline + ";"
- else:
- command=command+"cp -R --no-dereference --preserve=links " + \
- deploy_image_dir + \
- "/*" + artifact + "* " + DEST + "/" + QEMU_PUBLISH_DIR + "/" + artifact_name + pipeline + ";"
- if "qemuarm" in artifact:
- command=command+"cp -R --no-dereference --preserve=links " + \
- deploy_image_dir + \
- "/*Image* " + DEST + "/" + QEMU_PUBLISH_DIR +"/" + artifact_name + pipeline + ";"
- elif "mpc8315e" in artifact:
- artifact_name, deploy_image_dir = self.getDeployNames(artifact, buildername)
- command += self.generateMD5cmd(artifact, deploy_image_dir)
- command=command+"mkdir -p " + DEST + "/" + MACHINE_PUBLISH_DIR + "/" + artifact_name + ";"
- command=command+"cp -R --no-dereference --preserve=links " + \
- deploy_image_dir + \
- "/*mpc8315* " + DEST + "/" + MACHINE_PUBLISH_DIR + "/" + artifact_name + pipeline + ";"
- elif artifact == "tiny":
- command=command+"mkdir -p " + DEST + "/" + QEMU_PUBLISH_DIR + "/qemu-tiny;"
- command += self.generateMD5cmd(artifact, QEMU_PUBLISH_DIR + "/qemu-tiny")
- if self.layerversion_core > 2:
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(self.tmpdir, "deploy/images/qemux86/* ") + \
- " " + DEST + "/" + QEMU_PUBLISH_DIR + "/qemu-tiny" + pipeline + ";"
- else:
- command=command+"cp -R --no-dereference --preserve=links " + \
- os.path.join(self.tmpdir, "deploy/images/*") + \
- DEST + "/" + QEMU_PUBLISH_DIR + "/qemu-tiny" + pipeline + ";"
- elif artifact == "conf":
- artifact_name, deploy_image_dir = self.getDeployNames(artifact, buildername)
- command=command+"mkdir -p " + DEST + "/"+ MACHINE_PUBLISH_DIR + "/" + artifact_name + "/conf;"
- command=command+"cp -R --no-dereference " + \
- os.path.join(self.basedir, "conf/") + \
- "/* " + DEST + "/" + MACHINE_PUBLISH_DIR + "/" + artifact_name + "/conf" + pipeline + ";"
- elif artifact == "md5sums":
- command = command + "echo 'MD5sums are generated and deployed from the image or toolchain artifact';"
- elif artifact == "None":
- command=command+"echo 'Skipping copy of " + artifact + ".';"
- else:
- artifact_name, deploy_image_dir = self.getDeployNames(artifact, buildername)
- self.layerversion_yoctobsp = int(self.getProperty("layerversion_yoctobsp", "0"))
- if self.layerversion_yoctobsp < 2 and \
- "genericx86-64" in artifact:
- command = command+"echo 'Skipping copy of genericx86-64.'; "
- else:
- command += self.generateMD5cmd(artifact, deploy_image_dir)
- if "-wic" in buildername:
- deploy_image_dir += "/*/*"
- if self.layerversion_core < 10:
- deploy_image_dir += "/build"
- command=command+"mkdir -p " + DEST + "/" + MACHINE_PUBLISH_DIR + "/" + artifact_name + ";"
- command=command+"cp --no-dereference --preserve=links " + \
- deploy_image_dir + "/*\.direct " + \
- deploy_image_dir + "/*\.direct.md5sum " + \
- DEST + "/" + MACHINE_PUBLISH_DIR + "/" + artifact_name + pipeline + ";"
- else:
- command=command+"mkdir -p " + DEST + "/"+ MACHINE_PUBLISH_DIR +"/" + artifact_name + ";"
- if "beagle" in artifact:
- command=command+"cp -R --no-dereference --preserve=links " + \
- deploy_image_dir + \
- "/*Image* " + DEST + "/" + MACHINE_PUBLISH_DIR +"/" + artifact_name + pipeline + ";"
- command=command+"cp -R --no-dereference --preserve=links " + \
- deploy_image_dir + \
- "/u-boot* " + DEST + "/" + MACHINE_PUBLISH_DIR +"/" + artifact_name + pipeline + ";"
- command=command+"cp -R --no-dereference --preserve=links " + \
- deploy_image_dir + \
- "/*"+artifact+"* " + DEST + "/" + MACHINE_PUBLISH_DIR +"/" + artifact_name + pipeline + ";"
- command=command+'if [ "$PA_FAIL" = "1" ]; then exit 1; fi;'
- self.command = command
- else:
- self.command = "echo 'Skipping Step.'"
- ShellCommand.start(self)
-
- def generateMD5cmd(self, artifact, deploy_dir):
- cmd = ""
- if os.environ.get('GEN_IMG_MD5') == "True":
- cmd += "for x in `find " + deploy_dir + " -maxdepth 5 -type f`;"
- cmd += "do if [ ${x##*.} != md5sum ]; then md5sum $x >> " + "$x.md5sum; fi; done;"
- return cmd
-
- def getDeployNames(self, artifact, buildername):
- artifact_name = artifact
- if "-lsb" in buildername:
- artifact_name = artifact_name + "-lsb"
- if "-wic" in buildername:
- deploy_dir_image = os.path.join(os.path.join(self.tmpdir, "deploy/wic_images/"), artifact)
- elif artifact_name == "md5sums":
- deploy_dir_image = os.path.join(self.tmpdir, "deploy/images/")
- elif artifact_name == "uninative" or artifact_name == "buildtools-tarball" \
- or artifact_name == "toolchain":
- deploy_dir_image = os.path.join(self.tmpdir, "deploy/sdk/")
- else:
- if self.layerversion_core > 2:
- deploy_dir_image = os.path.join(os.path.join(self.tmpdir, "deploy/images/"), artifact)
- else:
- deploy_dir_image = os.path.join(self.tmpdir, "deploy/images/")
- return artifact_name, deploy_dir_image
-
- def describe(self, done=False):
- description = ShellCommand.describe(self,done)
- return description
-
- def get_release_number(self):
- release_number = self.getProperty("custom_yocto_number", "")
- release_components = release_number.split('.', 3)
- return '.'.join(release_components).strip('.')