-
Notifications
You must be signed in to change notification settings - Fork 141
/
stage.go
105 lines (95 loc) · 4.86 KB
/
stage.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// Copyright 2020 The PipeCD Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package model
// Stage represents the middle and temporary state of application
// before reaching its final desired state.
type Stage string
const (
// StageWait represents the waiting state for a specified period of time.
StageWait Stage = "WAIT"
// StageWaitApproval represents the waiting state until getting an approval
// from one of the specified approvers.
StageWaitApproval Stage = "WAIT_APPROVAL"
// StageAnalysis represents the waiting state for analysing
// the application status based on metrics, log, http request...
StageAnalysis Stage = "ANALYSIS"
// StageK8sSync represents the state where
// all resources should be synced with the Git state.
StageK8sSync Stage = "K8S_SYNC"
// StageK8sPrimaryRollout represents the state where
// the PRIMARY variant resources has been updated to the new version/configuration.
StageK8sPrimaryRollout Stage = "K8S_PRIMARY_ROLLOUT"
// StageK8sCanaryRollout represents the state where
// the CANARY variant resources has been rolled out with the new version/configuration.
StageK8sCanaryRollout Stage = "K8S_CANARY_ROLLOUT"
// StageK8sCanaryClean represents the state where
// the CANARY variant resources has been cleaned.
StageK8sCanaryClean Stage = "K8S_CANARY_CLEAN"
// StageK8sBaselineRollout represents the state where
// the BASELINE variant resources has been rolled out.
StageK8sBaselineRollout Stage = "K8S_BASELINE_ROLLOUT"
// StageK8sBaselineClean represents the state where
// the BASELINE variant resources has been cleaned.
StageK8sBaselineClean Stage = "K8S_BASELINE_CLEAN"
// StageK8sTrafficRouting represents the state where the traffic to application
// should be splitted as the specified percentage to PRIMARY, CANARY, BASELINE variants.
StageK8sTrafficRouting Stage = "K8S_TRAFFIC_ROUTING"
// StageTerraformSync synced infrastructure with all the tf defined in Git.
// Firstly, it does plan and if there are any changes detected it applies those changes automatically.
StageTerraformSync Stage = "TERRAFORM_SYNC"
// StageTerraformPlan shows terraform plan result.
StageTerraformPlan Stage = "TERRAFORM_PLAN"
// StageTerraformApply represents the state where
// the new configuration has been applied.
StageTerraformApply Stage = "TERRAFORM_APPLY"
// StageCloudRunSync does quick sync by rolling out the new version
// and switching all traffic to it.
StageCloudRunSync Stage = "CLOUDRUN_SYNC"
// StageCloudRunPromote promotes the new version to receive amount of traffic.
StageCloudRunPromote Stage = "CLOUDRUN_PROMOTE"
// StageLambdaSync does quick sync by rolling out the new version
// and switching all traffic to it.
StageLambdaSync Stage = "LAMBDA_SYNC"
// StageLambdaCanaryRollout represents the state where
// the CANARY variant resources has been rolled out with the new version/configuration.
StageLambdaCanaryRollout Stage = "LAMBDA_CANARY_ROLLOUT"
// StageLambdaPromote prmotes the new version to receive amount of traffic.
StageLambdaPromote Stage = "LAMBDA_PROMOTE"
// StageECSSync does quick sync by rolling out the new version
// and switching all traffic to it.
StageECSSync Stage = "ECS_SYNC"
// StageECSCanaryRollout represents the stage where
// the CANARY variant resource have been rolled out with the new version/configuration.
// The CANARY variant will serve amount of traffic set in this stage option.
StageECSCanaryRollout Stage = "ECS_CANARY_ROLLOUT"
// StageECSPrimaryRollout represents the stage where
// the PRIMARY variant resource have been rolled out with the new version/configuration.
// The PRIMARY variant will serve 100% traffic after it's rolled out.
StageECSPrimaryRollout Stage = "ECS_PRIMARY_ROLLOUT"
// StageECSTrafficRouting represents the state where the traffic to application
// should be splitted as the specified percentage to PRIMARY/CANARY variants.
StageECSTrafficRouting Stage = "ECS_TRAFFIC_ROUTING"
// StageECSCanaryClean represents the stage where
// the CANARY variant resources has been cleaned.
StageECSCanaryClean Stage = "ECS_CANARY_CLEAN"
// StageRollback represents a state where
// the all temporarily created stages will be reverted to
// bring back the pre-deploy stage.
// This stage is AUTOMATICALLY GENERATED and can not be used
// to specify in configuration file.
StageRollback Stage = "ROLLBACK"
)
func (s Stage) String() string {
return string(s)
}