Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
})
const waitForBuild = new Wait(this, `Wait for ${id}`, {
duration: WaitDuration.seconds(10)
})
this.task.next(waitForBuild)
waitForBuild.next(checkBuildTask)
checkBuildTask.next(
new Choice(this, `${id} done?`)
.when(
Condition.stringEquals(
`$.buildStatus.${id}.buildStatus`,
'SUCCEEDED'
),
new Succeed(this, `Success ${id}`)
)
.when(
Condition.stringEquals(
`$.buildStatus.${id}.buildStatus`,
'IN_PROGRESS'
),
waitForBuild
)
.otherwise(new Fail(this, `Failure ${id}`))
)
}
}
sourceLocationPath: `$.[${moduleIndex}].runBuildResult.${moduleName}_${stageName}_build_job`
}
)
const ifChangedChoice = new Choice(
this,
`${moduleName} changed? ${stageName} deploy`
)
.when(
Condition.booleanEquals(
`$.[${moduleIndex}].changes.${moduleName}`,
true
),
deployJob.task
)
.otherwise(new Succeed(this, `Skip ${stageName} ${moduleName} deploy`))
this.stageState.branch(ifChangedChoice)
})
}
const changesPath = true || stageNo === 1 ? '$' : `$.[${moduleIndex}]`
const ifChangedChoice = new Choice(
this,
`${moduleName} changed? ${stageName} build`
)
.when(
Condition.or(
Condition.booleanEquals(
`${changesPath}.changes.${moduleName}`,
true
),
Condition.booleanEquals(`${changesPath}.changes.all_modules`, true)
),
buildJob.task
)
.otherwise(new Succeed(this, `Skip ${stageName} ${moduleName} build`))
this.stageState.branch(ifChangedChoice)
})
}