다음 CLI 예제 명령 및 응답에 표시된 대로 서비스 파이프라인을 새 마이너 버전으로 업데이트합니다.
서비스 파이프라인을 수정된 spec
로 업데이트할 때 "${Proton::CURRENT_VAL}"
를 사용하여 원본 spec
에서 보존할 파라미터 값을 표시하는 데 사용할 수 있습니다(값이 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"
}
}