Commiting docker files

This commit is contained in:
Darren McGhee 2020-04-17 12:12:33 +01:00
parent 66d4831c2c
commit 4e69fd4920
3 changed files with 66 additions and 2 deletions

0
Dockerfile Normal file
View file

View file

@ -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

64
codebuild.yml Normal file
View file

@ -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