mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Create the build log in the artifact dir
This allows the jenkins master to receive the log file even if the build script aborted. Before I was just copying the log file to the artifact dir at the end of the script, which meant that jenkins only gets the log when the script succeeds.
This commit is contained in:
parent
a146a80034
commit
e22c000d5c
1 changed files with 4 additions and 5 deletions
|
@ -92,10 +92,6 @@ def _init():
|
|||
help='Location where build artifacts should be '
|
||||
'placed, the jenkins master will grab all of '
|
||||
'these. Default: %default')
|
||||
path_group.add_option('--log-file',
|
||||
dest='log_file',
|
||||
default='/tmp/salt-buildpackage.log',
|
||||
help='Log results to a file. Default: %default')
|
||||
parser.add_option_group(path_group)
|
||||
|
||||
# This group should also consist of nothing but file paths, which will be
|
||||
|
@ -155,6 +151,10 @@ def _init():
|
|||
problems.append('Unable to create artifact directory {0}: {1}'
|
||||
.format(opts.artifact_dir, exc))
|
||||
|
||||
# Create log file in the artifact dir so it is sent back to master if the
|
||||
# job fails
|
||||
opts.log_file = os.path.join(opts.artifact_dir, 'salt-buildpackage.log')
|
||||
|
||||
if problems:
|
||||
_abort(problems)
|
||||
|
||||
|
@ -360,4 +360,3 @@ if __name__ == '__main__':
|
|||
shutil.copy(artifact, opts.artifact_dir)
|
||||
log.info('Copied {0} to artifact directory'.format(artifact))
|
||||
log.info('Done!')
|
||||
shutil.copy(opts.log_file, opts.artifact_dir)
|
||||
|
|
Loading…
Add table
Reference in a new issue