{
    "name": "시나리오8",
    "stages": [
        {
            "type": "deployManifest",
            "name": "deploy replicaset",
            "refId": "1",
            "requisiteStageRefIds": [],
            "ifStageFailType": "HALT_ENTIRE_PIPELINE",
            "deployTarget": "{배포 대상 설정에 저장된 배포 대상 이름}",
            "manifests": [
                {
                    "apiVersion": "apps/v1",
                    "kind": "ReplicaSet",
                    "metadata": {
                        "annotations": {
                            "strategy.spinnaker.io/max-version-history": "2",
                            "traffic.spinnaker.io/load-balancers": "[\"service {생성되어 있는 Service 이름}\"]"
                        },
                        "labels": {
                            "app": "myapp"
                        },
                        "name": "myapp-frontend",
                        "namespace": "{namespace 이름}"
                    },
                    "spec": {
                        "replicas": 4,
                        "selector": {
                            "matchLabels": {
                                "app": "myapp"
                            }
                        },
                        "template": {
                            "metadata": {
                                "labels": {
                                    "app": "myapp"
                                }
                            },
                            "spec": {
                                "containers": [
                                    {
                                        "image": "nginx:stable-alpine3.17-slim",
                                        "name": "frontend"
                                    }
                                ]
                            }
                        }
                    }
                }
            ],
            "namespaceOverride": "",
            "startArtifacts": null,
            "expectedArtifacts": null,
            "manifestArtifactId": null,
            "manifestSource": "text",
            "manifestArtifact": null
        },
        {
            "type": "disableManifest",
            "name": "disable old app",
            "refId": "2",
            "requisiteStageRefIds": [
                "4"
            ],
            "ifStageFailType": "HALT_ENTIRE_PIPELINE",
            "deployTarget": "{배포 대상 설정에 저장된 배포 대상 이름}",
            "namespace": "{namespace 이름}",
            "mode": "dynamic",
            "kind": "replicaSet",
            "cluster": "replicaSet {1번 스테이지에서 생성한 ReplicaSet 이름}",
            "criteria": "Second Newest"
        },
        {
            "type": "webhook",
            "name": "Monitoring Application",
            "refId": "3",
            "requisiteStageRefIds": [
                "1"
            ],
            "ifStageFailType": "IGNORE_THE_FAILURE",
            "url": "{Service의 상태를 확인할 수 있는 URL}",
            "payload": null,
            "customHeaders": {},
            "failFastStatusCodes": [
                500
            ],
            "method": "GET"
        },
        {
            "type": "checkPreconditions",
            "name": "success",
            "refId": "4",
            "requisiteStageRefIds": [
                "3"
            ],
            "ifStageFailType": "HALT_ENTIRE_PIPELINE",
            "preconditions": [
                {
                    "failPipeline": false,
                    "type": "stageStatus",
                    "context": {
                        "equals": false,
                        "targetExecutionValue": null,
                        "expression": null,
                        "failureMessage": null,
                        "stageName": "Monitoring Application",
                        "stageStatus": "SUCCEEDED"
                    }
                }
            ],
            "nhnStageType": "STAGE_STATUS"
        },
        {
            "type": "checkPreconditions",
            "name": "fail",
            "refId": "5",
            "requisiteStageRefIds": [
                "3"
            ],
            "ifStageFailType": "HALT_ENTIRE_PIPELINE",
            "preconditions": [
                {
                    "failPipeline": false,
                    "type": "stageStatus",
                    "context": {
                        "equals": false,
                        "targetExecutionValue": null,
                        "expression": null,
                        "failureMessage": null,
                        "stageName": "Monitoring Application",
                        "stageStatus": "FAILED_CONTINUE"
                    }
                }
            ],
            "nhnStageType": "STAGE_STATUS"
        },
        {
            "type": "disableManifest",
            "name": "disable new app",
            "refId": "6",
            "requisiteStageRefIds": [
                "5"
            ],
            "ifStageFailType": "HALT_ENTIRE_PIPELINE",
            "deployTarget": "{배포 대상 설정에 저장된 배포 대상 이름}",
            "namespace": "{namespace 이름}",
            "mode": "dynamic",
            "kind": "replicaSet",
            "cluster": "replicaSet {1번 스테이지에서 생성한 ReplicaSet 이름}",
            "criteria": "Newest"
        }
    ],
    "description": "Blue/Green 배포를 위한 시나리오",
    "triggers": null,
    "triggerEnabled": false
}