ECS 服务图像更新器
ECS服务图像更新器协助更新一个ECS服务,以使用一个新的多克图像. 如果您正在更改的只是图像( 如您应用程序的新版本) , 创建一个新的任务定义可能很麻烦 。 它将在该处复制当前运行中的任务定义,更新图像,发布新的任务定义并更新该处,以便使用新的任务定义.
注: 我们把包裹移到我们下面了 bugcrowd 国家预防机制组织 -- -- 这将是目前唯一保持的一揽子地点.
CLI 使用量
Options:
--help Show help [boolean]
--version Show version number [boolean]
--image Docker image and tag [required]
--container-name Container to update in the ECS Task Definition.
Conflicts with container-names.
--container-names List of containers to update in the ECS Task
Definition. Comma separated. Conflicts with
container-name.
--service-name ECS Service to update
--task-definition-family Task Definition Family create the new Task
Definition in
--cluster-arn Arn of the ECS Cluster for which the Service exists
on. Used in conjunction with service-name
--output-arn-only Output the new Task Definition Arn only
实例
更新 ECS 服务以使用新图像
$ ecs-service-image-updater --cluster-arn arn:aws:ecs:us-east-1:123456789:cluster/cluster --image image:tag --container-name app --service-name app
在任务定义家族中从最新的任务定义创建新的任务定义
$ ecs-service-image-updater --image image:tag --container-name app --task-definition-family app
模块使用
const updater = require('ecs-service-image-updater');
const options = {
clusterArn: 'clusterArn',
serviceName: 'serviceName',
containerNames: ['containerName'],
image: 'image:tag'
}
updater(options)
.then((taskDefinitionArn) => {
console.log(`Done. New task definition: ${taskDefinitionArn}`);
})
.catch((err) => {
console.log(err);
});