cleanup
parent
8d8f10f6f6
commit
1f747fb338
|
|
@ -267,7 +267,7 @@ class AWS {
|
|||
|
||||
# if library directory doesn't exist create it,
|
||||
if [ ! -d "/${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/${buildParameters.projectPath}/Library" ]; then
|
||||
echo 'Creating Library folder'
|
||||
echo "Creating Library folder"
|
||||
mkdir "/${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/${buildParameters.projectPath}/Library"
|
||||
else
|
||||
echo 'Library folder already present, make sure you setup .gitignore correctly (cleaning out Library folder for this build)!'
|
||||
|
|
@ -660,18 +660,16 @@ class AWS {
|
|||
const logBaseUrl = `https://${SDK.config.region}.console.aws.amazon.com/cloudwatch/home?region=${SDK.config.region}#logsV2:log-groups/log-group/${taskDef.taskDefStackName}`;
|
||||
core.info(`You can also see the logs at AWS Cloud Watch: ${logBaseUrl}`);
|
||||
let readingLogs = true;
|
||||
const timestampReady = (t1, t2, tlimit) => {
|
||||
return t2 - t1 / 1000 < tlimit;
|
||||
};
|
||||
let timestamp = 0;
|
||||
while (readingLogs) {
|
||||
yield new Promise((resolve) => setTimeout(resolve, 1500));
|
||||
const taskData = yield getTaskData();
|
||||
if ((taskData === null || taskData === void 0 ? void 0 : taskData.lastStatus) !== 'RUNNING') {
|
||||
if (timestamp == 0) {
|
||||
core.info('Task stopped, streaming end of logs');
|
||||
timestamp = Date.now();
|
||||
}
|
||||
if (timestampReady(timestamp, Date.now(), 30)) {
|
||||
if (Date.now() - timestamp < 30000) {
|
||||
core.info('Task status is not RUNNING for 30 seconds, last query for logs');
|
||||
readingLogs = false;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -55,7 +55,7 @@ class AWS {
|
|||
|
||||
# if library directory doesn't exist create it,
|
||||
if [ ! -d "/${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/${buildParameters.projectPath}/Library" ]; then
|
||||
echo 'Creating Library folder'
|
||||
echo "Creating Library folder"
|
||||
mkdir "/${efsDirectoryName}/${buildUid}/${repositoryDirectoryName}/${buildParameters.projectPath}/Library"
|
||||
else
|
||||
echo 'Library folder already present, make sure you setup .gitignore correctly (cleaning out Library folder for this build)!'
|
||||
|
|
@ -537,18 +537,16 @@ class AWS {
|
|||
core.info(`You can also see the logs at AWS Cloud Watch: ${logBaseUrl}`);
|
||||
|
||||
let readingLogs = true;
|
||||
const timestampReady = (t1, t2, tlimit) => {
|
||||
return t2 - t1 / 1000 < tlimit;
|
||||
};
|
||||
let timestamp: number = 0;
|
||||
while (readingLogs) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 1500));
|
||||
const taskData = await getTaskData();
|
||||
if (taskData?.lastStatus !== 'RUNNING') {
|
||||
if (timestamp == 0) {
|
||||
core.info('Task stopped, streaming end of logs');
|
||||
timestamp = Date.now();
|
||||
}
|
||||
if (timestampReady(timestamp, Date.now(), 30)) {
|
||||
if (Date.now() - timestamp < 30000) {
|
||||
core.info('Task status is not RUNNING for 30 seconds, last query for logs');
|
||||
readingLogs = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue