diff --git a/.trigger b/.trigger new file mode 100644 index 00000000..e69de29b diff --git a/ci/codebuild/Dockerfile b/ci/codebuild/Dockerfile new file mode 100644 index 00000000..4ef576fa --- /dev/null +++ b/ci/codebuild/Dockerfile @@ -0,0 +1,2 @@ +FROM scratch +ADD sample_artifact . \ No newline at end of file diff --git a/ci/codebuild/sample_artifact b/ci/codebuild/sample_artifact new file mode 100644 index 00000000..a9a39d3c --- /dev/null +++ b/ci/codebuild/sample_artifact @@ -0,0 +1 @@ +this is the built artifact \ No newline at end of file diff --git a/ci/codebuild/test.yml b/ci/codebuild/test.yml new file mode 100644 index 00000000..ac856ac7 --- /dev/null +++ b/ci/codebuild/test.yml @@ -0,0 +1,19 @@ +version: 0.2 + +phases: + pre_build: + commands: + - echo Logging in to Amazon ECR... + - aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com + build: + commands: + - echo Build started on `date` + - export DOCKER_IMAGE_NAME="$AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$IMAGE_REPO_NAME:${CODEBUILD_WEBHOOK_TRIGGER//\//-}" + - echo Image name is $DOCKER_IMAGE_NAME + - cd $CODEBUILD_SRC_DIR/ci/codebuild + - docker build -t $DOCKER_IMAGE_NAME . + post_build: + commands: + - echo Build completed on `date` + - echo Pushing the Docker image + - docker push $DOCKER_IMAGE_NAME