aboutsummaryrefslogtreecommitdiffstats
path: root/lib/python2.7/site-packages/autobuilder/buildsteps/SetDest.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python2.7/site-packages/autobuilder/buildsteps/SetDest.py')
-rw-r--r--lib/python2.7/site-packages/autobuilder/buildsteps/SetDest.py107
1 files changed, 0 insertions, 107 deletions
diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/SetDest.py b/lib/python2.7/site-packages/autobuilder/buildsteps/SetDest.py
deleted file mode 100644
index ec7e4335..00000000
--- a/lib/python2.7/site-packages/autobuilder/buildsteps/SetDest.py
+++ /dev/null
@@ -1,107 +0,0 @@
-'''
-Created on Dec 25, 2012
-
-__author__ = "Elizabeth 'pidge' Flanagan"
-__copyright__ = "Copyright 2013, Intel Corp."
-__credits__ = ["Elizabeth Flanagan"]
-__license__ = "GPL"
-__version__ = "2.0"
-__maintainer__ = "Elizabeth Flanagan"
-__email__ = "pidge@toganlabs.com"
-'''
-
-from buildbot.status.results import SUCCESS, WARNINGS, FAILURE, SKIPPED, \
- EXCEPTION, RETRY, worst_status
-import os, datetime
-import cPickle as pickle
-from autobuilder.config import *
-from twisted.python import log
-from buildbot.steps.shell import ShellCommand
-
-class SetDest(ShellCommand):
- name = "SetDest"
- haltOnFailure = True
- flunkOnFailure = True
- name = "Destination"
- description = ["Setting %s" % name]
- descriptionDone = [name]
-
- def __init__(self, factory, argdict=None, **kwargs):
- self.target=""
- for k, v in argdict.iteritems():
- setattr(self, k, v)
- self.workerworkdir=os.path.join(os.path.join(YOCTO_ABBASE, "yocto-worker"))
- self.description = ["Setting", "Destination"]
-
- for k, v in argdict.iteritems():
- setattr(self, k, v)
- self.description = "Setting Destination"
- # Timeout needs to be passed to LoggingBuildStep as a kwarg
- self.timeout = 100
- kwargs['timeout']=self.timeout
- ShellCommand.__init__(self, **kwargs)
-
- def start(self):
- DEST = self.getProperty("DEST")
- snapshot = ""
- if DEST is not None:
- self.finished(SUCCESS)
- else:
- buildername=self.getProperty("buildername")
- self.workdir=os.path.join(self.workerworkdir, buildername)
- if str(self.getProperty("custom_release_me")) == "True":
- is_milestone = self.getProperty("custom_is_milestone")
- milestone_number = self.getProperty("custom_milestone_number")
- rc_number = self.getProperty("custom_rc_number")
-
- if is_milestone == "False":
- snapshot = "."+rc_number
- elif is_milestone == "True" and milestone_number is not "" and rc_number is not "":
- snapshot = "_"+milestone_number+"."+rc_number
- else:
- snapshot = ""
- prefix = snapshot
- poky_name = self.getProperty("custom_poky_name")+prefix
- poky_number = self.getProperty("custom_poky_number")+prefix
- yocto_number = self.getProperty("custom_yocto_number")+prefix
- rel_name = 'yocto-'+ yocto_number
- if not rel_name or rel_name == "":
- rel_name = self.getProperty(commit-description)
- DEST=os.path.normpath(os.path.join(
- os.environ.get("RELEASE_PUBLISH_DIR"),rel_name))
- if os.environ.get("RELEASE_PUBLISH_DIR") not in DEST:
- self.step_status.setText(["Failed Setting Destination:", "Bad Release Name."])
- self.finished(FAILURE)
- else:
- DEST = os.path.normpath(os.path.join(
- os.environ.get("BUILD_PUBLISH_DIR"), buildername))
- if os.environ.get("BUILD_PUBLISH_DIR") not in DEST:
- self.step_status.setText(["Failed Setting Destination:", "Bad Release Name."])
- self.finished(FAILURE)
- DEST_DATE=datetime.datetime.now().strftime("%Y%m%d")
- DATA_FILE = os.path.join(YOCTO_ABBASE, self.target + "_dest.dat")
- try:
- pfile = open(DATA_FILE, 'rb')
- data = pickle.load(pfile)
- except:
- pfile = open(DATA_FILE, 'wb')
- data = {}
- pickle.dump(data, pfile)
- pfile.close()
- # we can't os.path.exists here as we don't neccessarily have
- # access to the worker dest from controller. So we keep a cpickle of
- # the dests.
- try:
- # if the dictionary entry exists, we increment value by one, then repickle
- REV=data[os.path.join(DEST, DEST_DATE)]
- REV=int(REV) + 1
- except:
- REV=1
- data[os.path.join(DEST, DEST_DATE)] = REV
- pfile = open(DATA_FILE, 'wb')
- pickle.dump(data, pfile)
- pfile.close()
-
- DEST = os.path.join(DEST, DEST_DATE + "-" + str(REV))
- self.setProperty("DEST", DEST)
- self.finished(SUCCESS)