GIT_REPO_NAME = os.path.basename(GIT_REPO_PATH)
GIT_OLD_ID = os.environ.get('GIT_OLD_ID')
GIT_NEW_ID = os.environ.get('GIT_NEW_ID')
-GIT_BRANCH_NAME = os.environ.get('GIT_UPSTREAM_BRANCH')
-GIT_REMOTE_BRANCH_NAME = os.path.join('origin', '%s' %(GIT_BRANCH_NAME))
+GIT_UPSTREAM_BRANCH = os.environ.get('GIT_UPSTREAM_BRANCH')
+GIT_DEBIAN_BRANCH = os.environ.get('GIT_DEBIAN_BRANCH')
+GIT_DEBIAN_REMOTE_BRANCH = os.path.join('origin', '%s' %(GIT_DEBIAN_BRANCH))
GIT_TARGET_WORKSPACE = os.path.join(
CWD,
'%s-build%s' %(BUILD_ID, BUILD_NUMBER)
msg = (
'From: %s\n' %(SMTP_FROM) +
'To: %s\n' %(GIT_COMMITTER_EMAIL) +
- 'Subject: %s\n' %(SMTP_SUBJECT %(GIT_BRANCH_NAME, BUILD_NUMBER,
+ 'Subject: %s\n' %(SMTP_SUBJECT %(GIT_UPSTREAM_BRANCH, BUILD_NUMBER,
result)) +
- '%s\n' %(SMTP_TEXT %(GIT_BRANCH_NAME, BUILD_NUMBER, result))
+ '%s\n' %(SMTP_TEXT %(GIT_UPSTREAM_BRANCH, BUILD_NUMBER, result))
)
smtp.sendmail(SMTP_FROM, GIT_COMMITTER_EMAIL, msg)
smtp.quit()
logger.debug('repository %s checked out into %s' %(url, destination))
return True
-def git_checkout_branch():
- cmd = [GIT, 'checkout', '-b', GIT_BRANCH_NAME, GIT_REMOTE_BRANCH_NAME]
-
- logger.debug('This is GIT_TARGET_DIR: %s' %(GIT_TARGET_DIR))
- logger.debug('This is GIT_BRANCH_NAME: %s' %(GIT_BRANCH_NAME))
- logger.debug('This is GIT_REMOTE_BRANCH_NAME: %s'
- %(GIT_REMOTE_BRANCH_NAME))
+def git_checkout_debian_branch():
+ cmd = [GIT, 'checkout', '-b', GIT_DEBIAN_BRANCH, GIT_DEBIAN_REMOTE_BRANCH]
+
cmdobj = subprocess.Popen(
cmd,
shell=False,
)
logger.debug(
- 'calling »%s« for checkout' %(' '.join(cmd))
+ 'calling "%s" for checkout' %(' '.join(cmd))
)
ret = cmdobj.wait()
logger.error('Error was: %s' %(cmdobj.stderr.readlines()))
return False
logger.info(
- 'local branch %s successfully checked out.' %(GIT_BRANCH_NAME)
+ 'local branch %s successfully checked out.' %(GIT_DEBIAN_BRANCH)
)
return True
logger.info('git clone was not successfull')
exit_error()
atexit.register(remove_git_target_workspace)
- if not git_checkout_branch():
- sys.exit(1)
- logger.debug('changing dir to %s' %(GIT_TARGET_DIR))
os.chdir(GIT_TARGET_DIR)
+ logger.info('Directory Listing: %s' %(os.listdir(GIT_TARGET_DIR)))
#ftp = FTP(
# 'alexandria.profitbricks.localdomain',