mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-28 21:01:57 +03:00
@@ -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'
|
||||
Reference in New Issue
Block a user