次の CLI のコマンドとレスポンスの例に示すように、サービスパイプラインを更新して新しいマイナーバージョンにします。
修正した spec
でサービスパイプラインを更新する際には、"${Proton::CURRENT_VAL}"
を使用して spec
に値が存在する場合に元の spec
を保存するパラメータ値を指定できます。get-service
で説明するように、spec
を使用してサービスパイプラインの元の サービスデータを表示する を表示します。
以下の例は、"${Proton::CURRENT_VAL}"
での spec
の使用方法を示します。
仕様:
proton: ServiceSpec
pipeline:
my_sample_pipeline_optional_input: "${Proton::CURRENT_VAL}"
my_sample_pipeline_required_input: "${Proton::CURRENT_VAL}"
instances:
- name: "my-instance"
environment: "simple-env"
spec:
my_sample_service_instance_optional_input: "${Proton::CURRENT_VAL}"
my_sample_service_instance_required_input: "${Proton::CURRENT_VAL}"
- name: "my-other-instance"
environment: "simple-env"
spec:
my_sample_service_instance_required_input: "789"
コマンド: 更新する
$
aws proton update-service-pipeline \
--service-name "simple-svc
" \
--spec "file://service-spec.yaml
" \
--template-major-version "1
" \
--template-minor-version "1
" \
--deployment-type "MINOR_VERSION
"
レスポンス:
{
"pipeline": {
"arn": "arn:aws:proton:region-id:123456789012:service/simple-svc/pipeline/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
"createdAt": "2021-04-02T21:29:59.962000+00:00",
"deploymentStatus": "IN_PROGRESS",
"lastDeploymentAttemptedAt": "2021-04-02T21:39:28.991000+00:00",
"lastDeploymentSucceededAt": "2021-04-02T21:29:59.962000+00:00",
"spec": "proton: ServiceSpec\n\npipeline:\n my_sample_pipeline_optional_input: \"abc\"\n my_sample_pipeline_required_input: \"123\"\n\ninstances:\n - name: \"my-instance\"\n environment: \"MySimpleEnv\"\n spec:\n my_sample_service_instance_optional_input: \"def\"\n my_sample_service_instance_required_input: \"456\"\n - name: \"my-other-instance\"\n environment: \"MySimpleEnv\"\n spec:\n my_sample_service_instance_required_input: \"789\"\n",
"templateMajorVersion": "1",
"templateMinorVersion": "0",
"templateName": "svc-simple"
}
}
コマンド: ステータスを取得して確認する
$
aws proton get-service \
--name "simple-svc
"
レスポンス:
{
"service": {
"arn": "arn:aws:proton:region-id:123456789012:service/simple-svc",
"branchName": "main",
"createdAt": "2021-04-02T21:29:59.962000+00:00",
"lastModifiedAt": "2021-04-02T21:30:54.364000+00:00",
"name": "simple-svc",
"pipeline": {
"arn": "arn:aws:proton:region-id:123456789012:service/simple-svc/pipeline",
"createdAt": "2021-04-02T21:29:59.962000+00:00",
"deploymentStatus": "SUCCEEDED",
"lastDeploymentAttemptedAt": "2021-04-02T21:39:28.991000+00:00",
"lastDeploymentSucceededAt": "2021-04-02T21:39:28.991000+00:00",
"spec": "proton: ServiceSpec\n\npipeline:\n my_sample_pipeline_optional_input: \"abc\"\n my_sample_pipeline_required_input: \"123\"\n\ninstances:\n - name: \"instance-one\"\n environment: \"simple-env\"\n spec:\n my_sample_service_instance_optional_input: \"def\"\n my_sample_service_instance_required_input: \"456\"\n - name: \"my-other-instance\"\n environment: \"simple-env\"\n spec:\n my_sample_service_instance_required_input: \"789\"\n",
"templateMajorVersion": "1",
"templateMinorVersion": "1",
"templateName": "svc-simple"
},
"repositoryConnectionArn": "arn:aws:codestar-connections:region-id:123456789012:connection/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
"repositoryId": "repo-name/myorg-myapp",
"spec": "proton: ServiceSpec\n\npipeline:\n my_sample_pipeline_optional_input: \"abc\"\n my_sample_pipeline_required_input: \"123\"\n\ninstances:\n - name: \"instance-one\"\n environment: \"simple-env\"\n spec:\n my_sample_service_instance_optional_input: \"def\"\n my_sample_service_instance_required_input: \"456\"\n - name: \"my-other-instance\"\n environment: \"simple-env\"\n spec:\n my_sample_service_instance_required_input: \"789\"\n",
"status": "ACTIVE",
"templateName": "svc-simple"
}
}