Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Build on CodeBuild instead of CircleCI #117

Open
wants to merge 1 commit into
base: qiitadon
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 0.2

env:
variables:
IMAGE_REPO_NAME: qiitadon
phases:
pre_build:
commands:
- echo Logging in to Amazon ECR...
- $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION)
- AWS_ACCOUNT_ID=`aws sts get-caller-identity --query 'Account' --output text`;
- REPOSITORY_URI=${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/${IMAGE_REPO_NAME}
- IMAGE_TAG=$(echo ${CODEBUILD_RESOLVED_SOURCE_VERSION:-${CODEBUILD_SOURCE_VERSION}} | cut -c 1-10)
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}
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker image with ${IMAGE_TAG} and latest tag...
- docker push ${REPOSITORY_URI}:${IMAGE_TAG}
- docker push ${REPOSITORY_URI}:latest
30 changes: 0 additions & 30 deletions circle.yml

This file was deleted.