codepipeline (#30)

* codepipeline
This commit is contained in:
Edward Viaene
2020-02-20 21:43:59 +01:00
committed by GitHub
parent cc37d59c87
commit 04cc267e86
12 changed files with 293 additions and 39 deletions
+10
View File
@@ -0,0 +1,10 @@
version: 0.0
Resources:
- TargetService:
Type: AWS::ECS::Service
Properties:
# <TASK_DEFINITION> will be replaced by codedeploy when the pipeline runs
TaskDefinition: "<TASK_DEFINITION>"
LoadBalancerInfo:
ContainerName: demo
ContainerPort: 3000
@@ -0,0 +1,21 @@
version: 0.2
phases:
pre_build:
commands:
- $(aws ecr get-login --no-include-email)
build:
commands:
- docker build -t $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$CODEBUILD_RESOLVED_SOURCE_VERSION .
post_build:
commands:
# push
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$CODEBUILD_RESOLVED_SOURCE_VERSION
# create new task definition
- ./create-new-task-def.sh $IMAGE_REPO_NAME
- ./set-network-configuration.sh $IMAGE_REPO_NAME
artifacts:
files:
- 'appspec.yaml'
- 'taskdef.json'