codepipeline - fixes

This commit is contained in:
Edward Viaene
2020-02-27 18:09:36 +01:00
parent a939c15fb4
commit 520dd3ef53
4 changed files with 10 additions and 7 deletions
+2 -1
View File
@@ -10,10 +10,11 @@ phases:
post_build:
commands:
# push
- docker tag $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$CODEBUILD_RESOLVED_SOURCE_VERSION $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:latest
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$CODEBUILD_RESOLVED_SOURCE_VERSION
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:latest
# create new task definition
- ./create-new-task-def.sh $IMAGE_REPO_NAME
- ./set-network-configuration.sh $IMAGE_REPO_NAME
artifacts:
files:
@@ -15,4 +15,3 @@ REQUIRES_COMPATIBILITIES=$(echo $CURRENT_TASKDEF |jq '.taskDefinition.requiresCo
echo '{"family": "'${SERVICE_NAME}'", "taskRoleArn": "'${TASKDEF_ROLE_ARN}'", "executionRoleArn": "'${EXECUTION_ROLE_ARN}'", "containerDefinitions": '$TASKDEF', "cpu": "'$CPU'", "memory": "'$MEMORY'", "requiresCompatibilities": ['$REQUIRES_COMPATIBILITIES'], "networkMode": "'${NETWORK_MODE}'" }' > taskdef.json
#aws ecs register-task-definition --cli-input-json file://task-def-template.json.new > task-def-template.json.out
#NEW_TASKDEF_ARN=`cat task-def-template.json.out |jq -r '.taskDefinition.taskDefinitionArn'`
sed -i 's#$TASKDEF#'$NEW_TASKDEF_ARN'#' appspec.yaml
+6 -4
View File
@@ -10,10 +10,10 @@ resource "aws_codebuild_project" "demo" {
type = "CODEPIPELINE"
}
cache {
type = "S3"
location = aws_s3_bucket.codebuild-cache.bucket
}
#cache {
# type = "S3"
# location = aws_s3_bucket.codebuild-cache.bucket
#}
environment {
compute_type = "BUILD_GENERAL1_SMALL"
@@ -39,5 +39,7 @@ resource "aws_codebuild_project" "demo" {
type = "CODEPIPELINE"
buildspec = "buildspec.yml"
}
#depends_on = [aws_s3_bucket.codebuild-cache]
}
+2 -1
View File
@@ -28,7 +28,8 @@ resource "aws_ecs_task_definition" "demo" {
"healthCheck": {
"command": [ "CMD-SHELL", "curl -f http://localhost:3000/ || exit 1" ],
"interval": 30,
"retries": 3
"retries": 3,
"timeout": 5
},
"portMappings": [
{