AWS Doc SDK ExamplesWord
기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
Tools for PowerShell를 사용한 CodePipeline 예제
다음 코드 예제에서는 AWS Tools for PowerShell with CodePipeline를 사용하여 작업을 수행하고 일반적인 시나리오를 구현하는 방법을 보여줍니다.
작업은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 개별 서비스 함수를 직접적으로 호출하는 방법을 보여주며 관련 시나리오의 컨텍스트에 맞는 작업을 볼 수 있습니다.
각 예제에는 컨텍스트에서 코드를 설정하고 실행하는 방법에 대한 지침을 찾을 수 있는 전체 소스 코드에 대한 링크가 포함되어 있습니다.
주제
작업
다음 코드 예시에서는 Confirm-CPJob
을 사용하는 방법을 보여 줍니다.
- for PowerShell 도구
-
예제 1:이 예제는 지정된 작업의 상태를 가져옵니다.
Confirm-CPJob -JobId f570dc12-5ef3-44bc-945a-6e133EXAMPLE -Nonce 3
출력:
Value ----- InProgress
-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조의 AcknowledgeJob를 참조하세요.
-
다음 코드 예시에서는 Disable-CPStageTransition
을 사용하는 방법을 보여 줍니다.
- for PowerShell 도구
-
예제 1:이 예제는 지정된 파이프라인의 지정된 단계에 대한 인바운드 전환을 비활성화합니다.
Disable-CPStageTransition -PipelineName CodePipelineDemo -Reason "Disabling temporarily." -StageName Beta -TransitionType Inbound
-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조의 DisableStageTransition를 참조하세요.
-
다음 코드 예시에서는 Enable-CPStageTransition
을 사용하는 방법을 보여 줍니다.
- for PowerShell 도구
-
예제 1:이 예제에서는 지정된 파이프라인의 지정된 단계에 대한 인바운드 전환을 활성화합니다.
Enable-CPStageTransition -PipelineName CodePipelineDemo -StageName Beta -TransitionType Inbound
-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조의 EnableStageTransition를 참조하세요.
-
다음 코드 예시에서는 Get-CPActionType
을 사용하는 방법을 보여 줍니다.
- for PowerShell 도구
-
예제 1:이 예제는 지정된 소유자에 대해 사용 가능한 모든 작업에 대한 정보를 가져옵니다.
ForEach ($actionType in (Get-CPActionType -ActionOwnerFilter AWS)) { Write-Output ("For Category = " + $actionType.Id.Category + ", Owner = " + $actionType.Id.Owner + ", Provider = " + $actionType.Id.Provider + ", Version = " + $actionType.Id.Version + ":") Write-Output (" ActionConfigurationProperties:") ForEach ($acp in $actionType.ActionConfigurationProperties) { Write-Output (" For " + $acp.Name + ":") Write-Output (" Description = " + $acp.Description) Write-Output (" Key = " + $acp.Key) Write-Output (" Queryable = " + $acp.Queryable) Write-Output (" Required = " + $acp.Required) Write-Output (" Secret = " + $acp.Secret) } Write-Output (" InputArtifactDetails:") Write-Output (" MaximumCount = " + $actionType.InputArtifactDetails.MaximumCount) Write-Output (" MinimumCount = " + $actionType.InputArtifactDetails.MinimumCount) Write-Output (" OutputArtifactDetails:") Write-Output (" MaximumCount = " + $actionType.OutputArtifactDetails.MaximumCount) Write-Output (" MinimumCount = " + $actionType.OutputArtifactDetails.MinimumCount) Write-Output (" Settings:") Write-Output (" EntityUrlTemplate = " + $actionType.Settings.EntityUrlTemplate) Write-Output (" ExecutionUrlTemplate = " + $actionType.Settings.ExecutionUrlTemplate) }
출력:
For Category = Deploy, Owner = AWS, Provider = ElasticBeanstalk, Version = 1: ActionConfigurationProperties: For ApplicationName: Description = The AWS Elastic Beanstalk Application name Key = True Queryable = False Required = True Secret = False For EnvironmentName: Description = The AWS Elastic Beanstalk Environment name Key = True Queryable = False Required = True Secret = False InputArtifactDetails: MaximumCount = 1 MinimumCount = 1 OutputArtifactDetails: MaximumCount = 0 MinimumCount = 0 Settings: EntityUrlTemplate = https://console.aws.amazon.com/elasticbeanstalk/r/application/{Config:ApplicationName} ExecutionUrlTemplate = https://console.aws.amazon.com/elasticbeanstalk/r/application/{Config:ApplicationName} For Category = Deploy, Owner = AWS, Provider = CodeDeploy, Version = 1: ActionConfigurationProperties: For ApplicationName: Description = The AWS CodeDeploy Application name Key = True Queryable = False Required = True Secret = False For DeploymentGroupName: Description = The AWS CodeDeploy Deployment Group name Key = True Queryable = False Required = True Secret = False InputArtifactDetails: MaximumCount = 1 MinimumCount = 1 OutputArtifactDetails: MaximumCount = 0 MinimumCount = 0 Settings: EntityUrlTemplate = https://console.aws.amazon.com/codedeploy/home?#/applications/{Config:ApplicationName}/deployment-groups/{Config:DeploymentGroupName} ExecutionUrlTemplate = https://console.aws.amazon.com/codedeploy/home?#/deployments/{ExternalExecutionId}
-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조의 ListActionTypes를 참조하세요.
-
다음 코드 예시에서는 Get-CPActionableJobList
을 사용하는 방법을 보여 줍니다.
- for PowerShell 도구
-
예제 1:이 예제에서는 지정된 작업 범주, 소유자, 공급자, 버전 및 쿼리 파라미터에 대해 실행 가능한 모든 작업에 대한 정보를 가져옵니다.
Get-CPActionableJobList -ActionTypeId_Category Build -ActionTypeId_Owner Custom -ActionTypeId_Provider MyCustomProviderName -ActionTypeId_Version 1 -QueryParam @{"ProjectName" = "MyProjectName"}
출력:
AccountId Data Id Nonce --------- ---- -- ----- 80398EXAMPLE Amazon.CodePipeline.Model.JobData 0de392f5-712d-4f41-ace3-f57a0EXAMPLE 3
-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조의 PollForJobs를 참조하세요.
-
다음 코드 예시에서는 Get-CPJobDetail
을 사용하는 방법을 보여 줍니다.
- for PowerShell 도구
-
예제 1:이 예제는 지정된 작업에 대한 일반적인 정보를 가져옵니다.
Get-CPJobDetail -JobId f570dc12-5ef3-44bc-945a-6e133EXAMPLE
출력:
AccountId Data Id --------- ---- -- 80398EXAMPLE Amazon.CodePipeline.Model.JobData f570dc12-5ef3-44bc-945a-6e133EXAMPLE
예제 2:이 예제에서는 지정된 작업에 대한 자세한 정보를 가져옵니다.
$jobDetails = Get-CPJobDetail -JobId f570dc12-5ef3-44bc-945a-6e133EXAMPLE Write-Output ("For Job " + $jobDetails.Id + ":") Write-Output (" AccountId = " + $jobDetails.AccountId) $jobData = $jobDetails.Data Write-Output (" Configuration:") ForEach ($key in $jobData.ActionConfiguration.Keys) { $value = $jobData.ActionConfiguration.$key Write-Output (" " + $key + " = " + $value) } Write-Output (" ActionTypeId:") Write-Output (" Category = " + $jobData.ActionTypeId.Category) Write-Output (" Owner = " + $jobData.ActionTypeId.Owner) Write-Output (" Provider = " + $jobData.ActionTypeId.Provider) Write-Output (" Version = " + $jobData.ActionTypeId.Version) Write-Output (" ArtifactCredentials:") Write-Output (" AccessKeyId = " + $jobData.ArtifactCredentials.AccessKeyId) Write-Output (" SecretAccessKey = " + $jobData.ArtifactCredentials.SecretAccessKey) Write-Output (" SessionToken = " + $jobData.ArtifactCredentials.SessionToken) Write-Output (" InputArtifacts:") ForEach ($ia in $jobData.InputArtifacts) { Write-Output (" " + $ia.Name) } Write-Output (" OutputArtifacts:") ForEach ($oa in $jobData.OutputArtifacts) { Write-Output (" " + $oa.Name) } Write-Output (" PipelineContext:") $context = $jobData.PipelineContext Write-Output (" Name = " + $context.Action.Name) Write-Output (" PipelineName = " + $context.PipelineName) Write-Output (" Stage = " + $context.Stage.Name)
출력:
For Job f570dc12-5ef3-44bc-945a-6e133EXAMPLE: AccountId = 80398EXAMPLE Configuration: ActionTypeId: Category = Build Owner = Custom Provider = MyCustomProviderName Version = 1 ArtifactCredentials: AccessKeyId = ASIAIEI3...IXI6YREX SecretAccessKey = cqAFDhEi...RdQyfa2u SessionToken = AQoDYXdz...5u+lsAU= InputArtifacts: MyApp OutputArtifacts: MyAppBuild PipelineContext: Name = Build PipelineName = CodePipelineDemo Stage = Build
-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조의 GetJobDetails를 참조하세요.
-
다음 코드 예시에서는 Get-CPPipeline
을 사용하는 방법을 보여 줍니다.
- for PowerShell 도구
-
예제 1:이 예제는 지정된 파이프라인에 대한 일반적인 정보를 가져옵니다.
Get-CPPipeline -Name CodePipelineDemo -Version 1
출력:
ArtifactStore : Amazon.CodePipeline.Model.ArtifactStore Name : CodePipelineDemo RoleArn : arn:aws:iam::80398EXAMPLE:role/CodePipelineServiceRole Stages : {Source, Build, Beta, TestStage} Version : 1
예제 2:이 예제에서는 지정된 파이프라인에 대한 자세한 정보를 가져옵니다.
$pipeline = Get-CPPipeline -Name CodePipelineDemo Write-Output ("Name = " + $pipeline.Name) Write-Output ("RoleArn = " + $pipeline.RoleArn) Write-Output ("Version = " + $pipeline.Version) Write-Output ("ArtifactStore:") Write-Output (" Location = " + $pipeline.ArtifactStore.Location) Write-Output (" Type = " + $pipeline.ArtifactStore.Type.Value) Write-Output ("Stages:") ForEach ($stage in $pipeline.Stages) { Write-Output (" Name = " + $stage.Name) Write-Output (" Actions:") ForEach ($action in $stage.Actions) { Write-Output (" Name = " + $action.Name) Write-Output (" Category = " + $action.ActionTypeId.Category) Write-Output (" Owner = " + $action.ActionTypeId.Owner) Write-Output (" Provider = " + $action.ActionTypeId.Provider) Write-Output (" Version = " + $action.ActionTypeId.Version) Write-Output (" Configuration:") ForEach ($key in $action.Configuration.Keys) { $value = $action.Configuration.$key Write-Output (" " + $key + " = " + $value) } Write-Output (" InputArtifacts:") ForEach ($ia in $action.InputArtifacts) { Write-Output (" " + $ia.Name) } ForEach ($oa in $action.OutputArtifacts) { Write-Output (" " + $oa.Name) } Write-Output (" RunOrder = " + $action.RunOrder) } }
출력:
Name = CodePipelineDemo RoleArn = arn:aws:iam::80398EXAMPLE:role/CodePipelineServiceRole Version = 3 ArtifactStore: Location = MyBucketName Type = S3 Stages: Name = Source Actions: Name = Source Category = Source Owner = ThirdParty Provider = GitHub Version = 1 Configuration: Branch = master OAuthToken = **** Owner = my-user-name Repo = MyRepoName InputArtifacts: MyApp RunOrder = 1 Name = Build Actions: Name = Build Category = Build Owner = Custom Provider = MyCustomProviderName Version = 1 Configuration: ProjectName = MyProjectName InputArtifacts: MyApp MyAppBuild RunOrder = 1 Name = Beta Actions: Name = CodePipelineDemoFleet Category = Deploy Owner = AWS Provider = CodeDeploy Version = 1 Configuration: ApplicationName = CodePipelineDemoApplication DeploymentGroupName = CodePipelineDemoFleet InputArtifacts: MyAppBuild RunOrder = 1 Name = TestStage Actions: Name = MyJenkinsTestAction Category = Test Owner = Custom Provider = MyCustomTestProvider Version = 1 Configuration: ProjectName = MyJenkinsProjectName InputArtifacts: MyAppBuild RunOrder = 1
-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조의 GetPipeline를 참조하세요.
-
다음 코드 예시에서는 Get-CPPipelineList
을 사용하는 방법을 보여 줍니다.
- for PowerShell 도구
-
예제 1:이 예제는 사용 가능한 파이프라인 목록을 가져옵니다.
Get-CPPipelineList
출력:
Created Name Updated Version ------- ---- ------- ------- 8/13/2015 10:17:54 PM CodePipelineDemo 8/13/2015 10:17:54 PM 3 7/8/2015 2:41:53 AM MyFirstPipeline 7/22/2015 9:06:37 PM 7
-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조의 ListPipelines를 참조하세요.
-
다음 코드 예시에서는 Get-CPPipelineState
을 사용하는 방법을 보여 줍니다.
- for PowerShell 도구
-
예제 1:이 예제에서는 지정된 파이프라인의 단계에 대한 일반적인 정보를 가져옵니다.
Get-CPPipelineState -Name CodePipelineDemo
출력:
Created : 8/13/2015 10:17:54 PM PipelineName : CodePipelineDemo PipelineVersion : 1 StageStates : {Source, Build, Beta, TestStage} Updated : 8/13/2015 10:17:54 PM
예제 2:이 예제에서는 지정된 파이프라인의 상태에 대한 자세한 정보를 가져옵니다.
ForEach ($stageState in (Get-CPPipelineState -Name $arg).StageStates) { Write-Output ("For " + $stageState.StageName + ":") Write-Output (" InboundTransitionState:") Write-Output (" DisabledReason = " + $stageState.InboundTransitionState.DisabledReason) Write-Output (" Enabled = " + $stageState.InboundTransitionState.Enabled) Write-Output (" LastChangedAt = " + $stageState.InboundTransitionState.LastChangedAt) Write-Output (" LastChangedBy = " + $stageState.InboundTransitionState.LastChangedBy) Write-Output (" ActionStates:") ForEach ($actionState in $stageState.ActionStates) { Write-Output (" For " + $actionState.ActionName + ":") Write-Output (" CurrentRevision:") Write-Output (" Created = " + $actionState.CurrentRevision.Created) Write-Output (" RevisionChangeId = " + $actionState.CurrentRevision.RevisionChangeId) Write-Output (" RevisionId = " + $actionState.CurrentRevision.RevisionId) Write-Output (" EntityUrl = " + $actionState.EntityUrl) Write-Output (" LatestExecution:") Write-Output (" ErrorDetails:") Write-Output (" Code = " + $actionState.LatestExecution.ErrorDetails.Code) Write-Output (" Message = " + $actionState.LatestExecution.ErrorDetails.Message) Write-Output (" ExternalExecutionId = " + $actionState.LatestExecution.ExternalExecutionId) Write-Output (" ExternalExecutionUrl = " + $actionState.LatestExecution.ExternalExecutionUrl) Write-Output (" LastStatusChange = " + $actionState.LatestExecution.LastStatusChange) Write-Output (" PercentComplete = " + $actionState.LatestExecution.PercentComplete) Write-Output (" Status = " + $actionState.LatestExecution.Status) Write-Output (" Summary = " + $actionState.LatestExecution.Summary) Write-Output (" RevisionUrl = " + $actionState.RevisionUrl) } }
출력:
For Source: InboundTransitionState: DisabledReason = Enabled = LastChangedAt = LastChangedBy = ActionStates: For Source: CurrentRevision: Created = RevisionChangeId = RevisionId = EntityUrl = https://github.com/my-user-name/MyRepoName/tree/master LatestExecution: ErrorDetails: Code = Message = ExternalExecutionId = ExternalExecutionUrl = LastStatusChange = 07/20/2015 23:28:45 PercentComplete = 0 Status = Succeeded Summary = RevisionUrl = For Build: InboundTransitionState: DisabledReason = Enabled = True LastChangedAt = 01/01/0001 00:00:00 LastChangedBy = ActionStates: For Build: CurrentRevision: Created = RevisionChangeId = RevisionId = EntityUrl = http://54.174.131.1EX/job/MyJenkinsDemo LatestExecution: ErrorDetails: Code = TimeoutError Message = The action failed because a job worker exceeded its time limit. If this is a custom action, make sure that the job worker is configured correctly. ExternalExecutionId = ExternalExecutionUrl = LastStatusChange = 07/21/2015 00:29:29 PercentComplete = 0 Status = Failed Summary = RevisionUrl = For Beta: InboundTransitionState: DisabledReason = Enabled = True LastChangedAt = 01/01/0001 00:00:00 LastChangedBy = ActionStates: For CodePipelineDemoFleet: CurrentRevision: Created = RevisionChangeId = RevisionId = EntityUrl = https://console.aws.amazon.com/codedeploy/home?#/applications/CodePipelineDemoApplication/deployment-groups/CodePipelineDemoFleet LatestExecution: ErrorDetails: Code = Message = ExternalExecutionId = d-D5LTCZXEX ExternalExecutionUrl = https://console.aws.amazon.com/codedeploy/home?#/deployments/d-D5LTCZXEX LastStatusChange = 07/08/2015 22:07:42 PercentComplete = 0 Status = Succeeded Summary = Deployment Succeeded RevisionUrl = For TestStage: InboundTransitionState: DisabledReason = Enabled = True LastChangedAt = 01/01/0001 00:00:00 LastChangedBy = ActionStates: For MyJenkinsTestAction25: CurrentRevision: Created = RevisionChangeId = RevisionId = EntityUrl = http://54.174.131.1EX/job/MyJenkinsDemo LatestExecution: ErrorDetails: Code = Message = ExternalExecutionId = 5 ExternalExecutionUrl = http://54.174.131.1EX/job/MyJenkinsDemo/5 LastStatusChange = 07/08/2015 22:09:03 PercentComplete = 0 Status = Succeeded Summary = Finished RevisionUrl =
-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조의 GetPipelineState를 참조하세요.
-
다음 코드 예시에서는 New-CPCustomActionType
을 사용하는 방법을 보여 줍니다.
- for PowerShell 도구
-
예제 1:이 예제에서는 지정된 속성을 사용하여 새 사용자 지정 작업을 생성합니다.
New-CPCustomActionType -Category Build -ConfigurationProperty @{"Description" = "The name of the build project must be provided when this action is added to the pipeline."; "Key" = $True; "Name" = "ProjectName"; "Queryable" = $False; "Required" = $True; "Secret" = $False; "Type" = "String"} -Settings_EntityUrlTemplate "https://my-build-instance/job/{Config:ProjectName}/" -Settings_ExecutionUrlTemplate "https://my-build-instance/job/mybuildjob/lastSuccessfulBuild{ExternalExecutionId}/" -InputArtifactDetails_MaximumCount 1 -OutputArtifactDetails_MaximumCount 1 -InputArtifactDetails_MinimumCount 0 -OutputArtifactDetails_MinimumCount 0 -Provider "MyBuildProviderName" -Version 1
출력:
ActionConfigurationProperties : {ProjectName} Id : Amazon.CodePipeline.Model.ActionTypeId InputArtifactDetails : Amazon.CodePipeline.Model.ArtifactDetails OutputArtifactDetails : Amazon.CodePipeline.Model.ArtifactDetails Settings : Amazon.CodePipeline.Model.ActionTypeSettings
-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조의 CreateCustomActionType를 참조하세요.
-
다음 코드 예시에서는 New-CPPipeline
을 사용하는 방법을 보여 줍니다.
- for PowerShell 도구
-
예제 1:이 예제는 지정된 설정으로 새 파이프라인을 생성합니다.
$pipeline = New-Object Amazon.CodePipeline.Model.PipelineDeclaration $sourceStageAction = New-Object Amazon.CodePipeline.Model.ActionDeclaration $deployStageAction = New-Object Amazon.CodePipeline.Model.ActionDeclaration $sourceStageActionOutputArtifact = New-Object Amazon.CodePipeline.Model.OutputArtifact $sourceStageActionOutputArtifact.Name = "MyApp" $sourceStageAction.ActionTypeId = @{"Category" = "Source"; "Owner" = "AWS"; "Provider" = "S3"; "Version" = 1} $sourceStageAction.Configuration.Add("S3Bucket", "amzn-s3-demo-bucket") $sourceStageAction.Configuration.Add("S3ObjectKey", "my-object-key-name.zip") $sourceStageAction.OutputArtifacts.Add($sourceStageActionOutputArtifact) $sourceStageAction.Name = "Source" $deployStageActionInputArtifact = New-Object Amazon.CodePipeline.Model.InputArtifact $deployStageActionInputArtifact.Name = "MyApp" $deployStageAction.ActionTypeId = @{"Category" = "Deploy"; "Owner" = "AWS"; "Provider" = "CodeDeploy"; "Version" = 1} $deployStageAction.Configuration.Add("ApplicationName", "CodePipelineDemoApplication") $deployStageAction.Configuration.Add("DeploymentGroupName", "CodePipelineDemoFleet") $deployStageAction.InputArtifacts.Add($deployStageActionInputArtifact) $deployStageAction.Name = "CodePipelineDemoFleet" $sourceStage = New-Object Amazon.CodePipeline.Model.StageDeclaration $deployStage = New-Object Amazon.CodePipeline.Model.StageDeclaration $sourceStage.Name = "Source" $deployStage.Name = "Beta" $sourceStage.Actions.Add($sourceStageAction) $deployStage.Actions.Add($deployStageAction) $pipeline.ArtifactStore = @{"Location" = "amzn-s3-demo-bucket"; "Type" = "S3"} $pipeline.Name = "CodePipelineDemo" $pipeline.RoleArn = "arn:aws:iam::80398EXAMPLE:role/CodePipelineServiceRole" $pipeline.Stages.Add($sourceStage) $pipeline.Stages.Add($deployStage) $pipeline.Version = 1 New-CPPipeline -Pipeline $pipeline
출력:
ArtifactStore : Amazon.CodePipeline.Model.ArtifactStore Name : CodePipelineDemo RoleArn : arn:aws:iam::80398EXAMPLE:role/CodePipelineServiceRole Stages : {Source, Beta} Version : 1
-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조의 CreatePipeline를 참조하세요.
-
다음 코드 예시에서는 Remove-CPCustomActionType
을 사용하는 방법을 보여 줍니다.
- for PowerShell 도구
-
예제 1:이 예제는 지정된 사용자 지정 작업을 삭제합니다. 명령을 실행하면 계속 진행하기 전에 확인하라는 메시지가 표시됩니다. -Force 파라미터를 추가하여 프롬프트 없이 사용자 지정 작업을 삭제합니다.
Remove-CPCustomActionType -Category Build -Provider MyBuildProviderName -Version 1
-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조의 DeleteCustomActionType를 참조하세요.
-
다음 코드 예시에서는 Remove-CPPipeline
을 사용하는 방법을 보여 줍니다.
- for PowerShell 도구
-
예제 1:이 예제는 지정된 파이프라인을 삭제합니다. 명령을 실행하면 계속 진행하기 전에 확인하라는 메시지가 표시됩니다. -Force 파라미터를 추가하여 프롬프트 없이 파이프라인을 삭제합니다.
Remove-CPPipeline -Name CodePipelineDemo
-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조의 DeletePipeline를 참조하세요.
-
다음 코드 예시에서는 Start-CPPipelineExecution
을 사용하는 방법을 보여 줍니다.
- for PowerShell 도구
-
예제 1:이 예제는 지정된 파이프라인 실행을 시작합니다.
Start-CPPipelineExecution -Name CodePipelineDemo
-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조의 StartPipelineExecution를 참조하세요.
-
다음 코드 예시에서는 Update-CPPipeline
을 사용하는 방법을 보여 줍니다.
- for PowerShell 도구
-
예제 1:이 예제는 지정된 기존 파이프라인을 지정된 설정으로 업데이트합니다.
$pipeline = New-Object Amazon.CodePipeline.Model.PipelineDeclaration $sourceStageAction = New-Object Amazon.CodePipeline.Model.ActionDeclaration $deployStageAction = New-Object Amazon.CodePipeline.Model.ActionDeclaration $sourceStageActionOutputArtifact = New-Object Amazon.CodePipeline.Model.OutputArtifact $sourceStageActionOutputArtifact.Name = "MyApp" $sourceStageAction.ActionTypeId = @{"Category" = "Source"; "Owner" = "AWS"; "Provider" = "S3"; "Version" = 1} $sourceStageAction.Configuration.Add("S3Bucket", "amzn-s3-demo-bucket") $sourceStageAction.Configuration.Add("S3ObjectKey", "my-object-key-name.zip") $sourceStageAction.OutputArtifacts.Add($sourceStageActionOutputArtifact) $sourceStageAction.Name = "Source" $deployStageActionInputArtifact = New-Object Amazon.CodePipeline.Model.InputArtifact $deployStageActionInputArtifact.Name = "MyApp" $deployStageAction.ActionTypeId = @{"Category" = "Deploy"; "Owner" = "AWS"; "Provider" = "CodeDeploy"; "Version" = 1} $deployStageAction.Configuration.Add("ApplicationName", "CodePipelineDemoApplication") $deployStageAction.Configuration.Add("DeploymentGroupName", "CodePipelineDemoFleet") $deployStageAction.InputArtifacts.Add($deployStageActionInputArtifact) $deployStageAction.Name = "CodePipelineDemoFleet" $sourceStage = New-Object Amazon.CodePipeline.Model.StageDeclaration $deployStage = New-Object Amazon.CodePipeline.Model.StageDeclaration $sourceStage.Name = "MyInputFiles" $deployStage.Name = "MyTestDeployment" $sourceStage.Actions.Add($sourceStageAction) $deployStage.Actions.Add($deployStageAction) $pipeline.ArtifactStore = @{"Location" = "amzn-s3-demo-bucket"; "Type" = "S3"} $pipeline.Name = "CodePipelineDemo" $pipeline.RoleArn = "arn:aws:iam::80398EXAMPLE:role/CodePipelineServiceRole" $pipeline.Stages.Add($sourceStage) $pipeline.Stages.Add($deployStage) $pipeline.Version = 1 Update-CPPipeline -Pipeline $pipeline
출력:
ArtifactStore : Amazon.CodePipeline.Model.ArtifactStore Name : CodePipelineDemo RoleArn : arn:aws:iam::80398EXAMPLE:role/CodePipelineServiceRole Stages : {InputFiles, TestDeployment} Version : 2
-
API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조의 UpdatePipeline를 참조하세요.
-