diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..e69de29bb diff --git a/buildspec.yml b/buildspec.yml index e61902384..defd69462 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -9,11 +9,11 @@ phases: - echo Nothing to do in prebuild build: commands: - - echo Build started on 'date' + - echo Build started on `date` - mvn package post_build: commands: - - echo Build completed on 'date' + - echo Build completed on `date` artifacts: files: - target/spring-petclinic-2.2.0.BUILD-SNAPSHOT.jar \ No newline at end of file diff --git a/codebuild.yml b/codebuild.yml new file mode 100644 index 000000000..73d839e17 --- /dev/null +++ b/codebuild.yml @@ -0,0 +1,64 @@ +--- +AWSTemplateFormatVersion: 2010-09-09 + + +Parameters: + GitHubUrl: + Type: String + LogGroup: + Type: String + LogStream: + Type: String + +Resources: + CodeBuildProject: + Type: AWS::CodeBuild::Project + Properties: + Artifacts: + Type: NO_ARTIFACTS + Source: + Type: GITHUB + Location: !Ref GitHubUrl + Auth: + Type: OAUTH + Environment: + ComputeType: BUILD_GENERAL1_SMALL + Image: aws/codebuild/standard:latest + Type: LINUX_CONTAINER + LogsConfig: + CloudWatchLogs: + GroupName: !Ref LogGroup + Status: ENABLED + StreamName: !Ref LogStream + Triggers: + FilterGroups: + - - Type: EVENT + Pattern: PUSH + Webhook: True + Name: !Ref AWS::StackName + ServiceRole: !Ref CodeBuildServiceRole + + CodeBuildServiceRole: + Type: AWS::IAM::Role + Properties: + Path: / + AssumeRolePolicyDocument: + Version: 2012-10-17 + Statement: + - Effect: Allow + Principal: + Service: codebuild.amazonaws.com + Action: sts:AssumeRole + Policies: + - PolicyName: root + PolicyDocument: + Version: 2012-10-17 + Statement: + - Resource: "*" + Effect: Allow + Action: + - logs:CreateLogGroup + - logs:CreateLogStream + - logs:PutLogEvents + +