Permalink
Browse files

fix(builds): fix all job time execution and caching

  • Loading branch information...
jkuri committed Sep 11, 2017
1 parent d11ce5a commit 0c65b2515b6ec6219943170b81bcf626b5ac1812
Showing with 13 additions and 5 deletions.
  1. +9 −5 src/api/process.ts
  2. +4 −0 src/app/styles/terminal.sass
@@ -67,12 +67,12 @@ export function startBuildProcess(
let copyRestoreCmd = [
`if [ -e ${cacheHostPath} ];`,
`then docker cp ${cacheHostPath} ${name}:/home/abstruse`,
`; fi`
`; else exit 0; fi`
].join(' ');
let restoreCmd = [
`if [ -e /home/abstruse/${cacheFile} ];`,
`then tar xjf /home/abstruse/${cacheFile} -C .`,
`; fi`
`; else exit 0; fi`
].join(' ');

restoreCache = Observable.concat(...[
@@ -83,9 +83,13 @@ export function startBuildProcess(
let tarCmd = [
`if [ ! -e /home/abstruse/${cacheFile} ];`,
`then tar cjSf /home/abstruse/${cacheFile} ${proc.cache.join(' ')}`,
`; fi`
`; else exit 0; fi`
].join(' ');
let saveTarCmd = [,
`if [ ! -e ${cacheHostPath} ];`,
`then docker cp ${name}:/home/abstruse/${cacheFile} ${cacheHostPath}`,
'; else exit 0; fi'
].join(' ');
let saveTarCmd = `docker cp ${name}:/home/abstruse/${cacheFile} ${cacheHostPath}`;

saveCache = Observable.concat(...[
executeInContainer(name, { command: tarCmd, type: CommandType.store_cache }),
@@ -126,7 +130,7 @@ export function startBuildProcess(
.concat(...scriptCommands.map(cmd => executeInContainer(name, cmd)))
.concat(...deployCommands.map(cmd => executeInContainer(name, cmd)))
.timeoutWith(idleTimeout, Observable.throw(new Error('command timeout')))
.merge(Observable.timer(jobTimeout).timeInterval().mergeMap(() => {
.takeUntil(Observable.timer(jobTimeout).timeInterval().mergeMap(() => {
return Observable.throw('job timeout');
}))
.subscribe((event: ProcessOutput) => {
@@ -58,11 +58,15 @@
color: $white
right: 5px
top: 8px
outline: none
border: none

.command-loader
margin-top: -4px
width: 16px
height: 16px
outline: none
border: none

.output
display: inline-block

0 comments on commit 0c65b25

Please sign in to comment.