From 99d6545e17f36e03b59da34f5be2b26ce58749b0 Mon Sep 17 00:00:00 2001 From: javeriakhn <137407291+javeriakhn@users.noreply.github.com> Date: Thu, 24 Aug 2023 01:44:47 +0200 Subject: [PATCH] Update buildspec.yml --- buildspec.yml | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 855ca9e..8e2c443 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -3,31 +3,17 @@ version: 0.2 phases: install: runtime-versions: - nodejs: latest - commands: - - nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 & - - timeout 15 sh -c "until docker info; do echo .; sleep 1; done" + nodejs: 14 pre_build: commands: - - echo log in to Amazon ECR... - - aws --version - - echo $AWS_DEFAULT_REGION - - $(aws ecr get-login --no-include-email --region us-east-1) - - REPOSITORY_URI=.dkr.ecr.us-east-1.amazonaws.com/aws-ecs-docker - - COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7) - - IMAGE_TAG=${COMMIT_HASH:=latest} + - npm install build: commands: - - echo Build started on `date` - - echo Building the Docker image. - - docker build -t $REPOSITORY_URI:latest . - - docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG + - npm run build post_build: commands: - - echo Build completed on `date` - - docker push $REPOSITORY_URI:latest - - docker push $REPOSITORY_URI:$IMAGE_TAG - - echo write definitions file... - - printf '[{"name":"exp-code-pipeline","imageUri":"%s"}]' $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json + - echo "Build complete!" artifacts: - files: imagedefinitions.json + files: '**/*' + +