diff --git a/ci/ci.sh b/ci/ci.sh index a074acb..b4d2df5 100755 --- a/ci/ci.sh +++ b/ci/ci.sh @@ -1,6 +1,4 @@ #!/bin/sh -export RUN_ID=$(node generate-id.js) -echo "INFO: Run id: $RUN_ID" echo "INFO: Sleep seconds set for services to start: ${SLEEP:=60}" # defaults to 60 seconds if [[ $NODE_ENV == "local_client-public" ]]; then diff --git a/ci/generate-id.js b/ci/generate-id.js deleted file mode 100644 index e99f4d4..0000000 --- a/ci/generate-id.js +++ /dev/null @@ -1,11 +0,0 @@ -import { uniqueNamesGenerator, adjectives, animals, colors } from 'unique-names-generator'; - -function main() { - const runId = uniqueNamesGenerator({ - dictionaries: [adjectives, animals, colors], - length: 3 - }) - console.log(runId) -} - -main() diff --git a/ci/report-exit.js b/ci/report-exit.js index cb36c73..f162f56 100644 --- a/ci/report-exit.js +++ b/ci/report-exit.js @@ -1,19 +1,27 @@ -import { generateDiscordCloudwatchLogUrl, listECSTasks, sendDiscordNotification, getCommitHashes } from './helpers.js'; +import { + getThisTaskArn, + generateDiscordCloudwatchLogUrl, + getCommitHashes, + sendDiscordNotification +} from './helpers.js'; const main = async () => { try { - const taskArns = await listECSTasks() + const taskArn = getThisTaskArn() + console.log('INFO: taskArn:=', taskArn) const commitHashes = await getCommitHashes() // e.g. "ceramic-anchor-service (333fc9afb59a) <==> go-ipfs-daemon (6871b7dcd27d)\n" - console.log('INFO: listECSTasks taskArns:=', taskArns) - let logUrls = generateDiscordCloudwatchLogUrl() - if (logUrls.length < 1) { - logUrls = ["No log Urls found"] + + let logUrl = generateDiscordCloudwatchLogUrl(taskArn) + if (logUrl == '') { + logUrl = 'No log URL found' + } else { + logUrl = `[Cloudwatch logs for task ${taskArn}](${logUrl})` } const message = [ { title: 'Tests Exited', - description: `Run Id: ${process.env.RUN_ID}`, + description: `Run Id: ${taskArn}`, color: 16711712, fields: [ { @@ -26,7 +34,7 @@ const main = async () => { }, { name: 'Logs', - value: `${logUrls}`, + value: `${logUrl}`, } ], }, diff --git a/package-lock.json b/package-lock.json index 1424d56..7f3030a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,8 +43,7 @@ "ts-jest": "^28.0.8", "ts-node": "^10.9.1", "typescript": "^4.7.4", - "typestub-multihashes": "^0.0.4", - "unique-names-generator": "^4.7.1" + "typestub-multihashes": "^0.0.4" } }, "node_modules/@3id/did-provider": { @@ -22693,14 +22692,6 @@ "unique-slug": "^2.0.0" } }, - "node_modules/unique-names-generator": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/unique-names-generator/-/unique-names-generator-4.7.1.tgz", - "integrity": "sha512-lMx9dX+KRmG8sq6gulYYpKWZc9RlGsgBR6aoO8Qsm3qvkSJ+3rAymr+TnV8EDMrIrwuFJ4kruzMWM/OpYzPoow==", - "engines": { - "node": ">=8" - } - }, "node_modules/unique-slug": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", @@ -42243,11 +42234,6 @@ "unique-slug": "^2.0.0" } }, - "unique-names-generator": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/unique-names-generator/-/unique-names-generator-4.7.1.tgz", - "integrity": "sha512-lMx9dX+KRmG8sq6gulYYpKWZc9RlGsgBR6aoO8Qsm3qvkSJ+3rAymr+TnV8EDMrIrwuFJ4kruzMWM/OpYzPoow==" - }, "unique-slug": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", diff --git a/package.json b/package.json index 2afe5fe..78f4eaf 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,6 @@ "ts-jest": "^28.0.8", "ts-node": "^10.9.1", "typescript": "^4.7.4", - "typestub-multihashes": "^0.0.4", - "unique-names-generator": "^4.7.1" + "typestub-multihashes": "^0.0.4" } }