@ossy/deployment-tools 0.0.32 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/deployment-queue-client.ts +9 -6
package/package.json
CHANGED
|
@@ -6,29 +6,32 @@ import {
|
|
|
6
6
|
} from '@aws-sdk/client-sqs'
|
|
7
7
|
import { DeploymentPlatform, ContainerDeploymentRequest } from 'types'
|
|
8
8
|
import { AwsCredentialsClient } from 'aws-credentials-client'
|
|
9
|
-
import { logInfo, logError } from 'log'
|
|
9
|
+
import { logInfo, logError, logDebug } from 'log'
|
|
10
10
|
|
|
11
11
|
export class DeploymentQueueClient {
|
|
12
12
|
|
|
13
13
|
static sendDeploymentRequest(deploymentPlatform: DeploymentPlatform, deploymentRequest: ContainerDeploymentRequest) {
|
|
14
|
-
logInfo({
|
|
14
|
+
logInfo({ message: '[DeploymentQueueClient] Starting deployment sequence' })
|
|
15
15
|
return DeploymentQueueClient.createAwsSqsClient(deploymentPlatform)
|
|
16
16
|
.then(sqsClient => {
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const sendMessageParams = {
|
|
19
19
|
QueueUrl: deploymentPlatform.awsDeploymentSqsArn,
|
|
20
20
|
MessageBody: JSON.stringify(deploymentRequest)
|
|
21
|
-
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
logDebug({ message: '[DeploymentQueueClient] SendMessageCommand params', data: sendMessageParams })
|
|
24
|
+
const command = new SendMessageCommand(sendMessageParams)
|
|
22
25
|
|
|
23
26
|
return sqsClient.send(command)
|
|
24
|
-
.then(() => logInfo({
|
|
27
|
+
.then(() => logInfo({ message: '[DeploymentQueueClient] Deployment request sent' }))
|
|
25
28
|
.catch(error => logError({ message: '[DeploymentQueueClient] Could not send deployment request', error }))
|
|
26
29
|
})
|
|
27
30
|
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
static pollForDeploymentRequests(deploymentPlatform: DeploymentPlatform, handleDeploymentRequest: (deploymentRequest: ContainerDeploymentRequest) => Promise<void>) {
|
|
31
|
-
logInfo({
|
|
34
|
+
logInfo({ message: '[DeploymentQueueClient] Starting polling for deployment requests' })
|
|
32
35
|
DeploymentQueueClient.createAwsSqsClient(deploymentPlatform).then(sqsClient => {
|
|
33
36
|
const FIVE_MINUTES = 3000
|
|
34
37
|
|