Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
feat: add buildspec to setup CD (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
honglu authored Oct 13, 2019
1 parent d4e24e9 commit 282af15
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
15 changes: 15 additions & 0 deletions buildspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 0.2

phases:
install:
runtime-versions:
python: 3.7
commands:
- pip install cfn-lint
build:
commands:
- cfn-lint -t sam/app/template.yaml
- aws cloudformation package --template-file sam/app/template.yaml --s3-bucket ${PACKAGE_BUCKET} --output-template-file packaged-template.yaml
artifacts:
files:
- packaged-template.yaml
12 changes: 6 additions & 6 deletions sam/app/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Resources:
StackName: !Ref DeployStackName
TemplatePath: "BuildArtifact::packaged-template.yaml"
ChangeSetName: !Sub a-${DeployStackName}-Deploy
RunOrder: '1'
RunOrder: 1
- Name: ExecuteChangeSet
ActionTypeId:
Category: Deploy
Expand All @@ -214,7 +214,7 @@ Resources:
ActionMode: CHANGE_SET_EXECUTE
StackName: !Ref DeployStackName
ChangeSetName: !Sub a-${DeployStackName}-Deploy
RunOrder: '2'
RunOrder: 2
- !Ref AWS::NoValue
- !If
- HasPublishStage
Expand All @@ -230,7 +230,7 @@ Resources:
FunctionName: !GetAtt SARPublishApp.Outputs.ServerlessRepoPublishFunctionName
InputArtifacts:
- Name: BuildArtifact
RunOrder: '1'
RunOrder: 1
- !Ref AWS::NoValue
PipelineRole:
Type: AWS::IAM::Role
Expand Down Expand Up @@ -345,7 +345,7 @@ Resources:
TargetPipeline: !Ref Pipeline
TargetAction: GitHubSource
TargetPipelineVersion: !GetAtt Pipeline.Version
RegisterWithThirdParty: 'true'
RegisterWithThirdParty: true
IntegrationTestsProject:
Condition: HasTestStage
Type: AWS::CodeBuild::Project
Expand All @@ -366,7 +366,7 @@ Resources:
CodeBuildPolicy:
Type: AWS::IAM::Policy
Properties:
PolicyName: codebuild-access-${AWS::StackName}
PolicyName: !Sub codebuild-access-${AWS::StackName}
Roles:
- !Ref BuildProjectRole
- !If
Expand Down Expand Up @@ -413,7 +413,7 @@ Resources:
Condition: HasDeployStage
Type: AWS::IAM::Policy
Properties:
PolicyName: deploy-stage-access-${AWS::StackName}
PolicyName: !Sub deploy-stage-access-${AWS::StackName}
Roles:
- !Ref DeployRoleName
PolicyDocument:
Expand Down

0 comments on commit 282af15

Please sign in to comment.