Skip to content
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
24 changes: 24 additions & 0 deletions buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 0.2

phases:

pre_build:
commands:
- echo "Logging into Amazon ECR"
- aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin 452499883540.dkr.ecr.$AWS_REGION.amazonaws.com
- echo "Logging into DockerHub"
- docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD

build:
commands:
- echo "init submodules to add to git config"
- git submodule init

- echo "Configure submodule to pull with http"
- git config submodule.plugins/pushd-dither.url "https://github.com/pushd/pushd-dither.git"

- echo "Fetch submodule source"
- git submodule update

- echo "Building imgproxy started on $(date)"
- ./pushd_build.sh
7 changes: 6 additions & 1 deletion pushd_build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash -xe
# This script is for building and pushing to pushd ECR docker repo.

# # get aws account id from sts if not set
if [[ "${AWS_ACCOUNT_ID}x" == "x" ]]; then
AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
fi

docker buildx build --platform linux/amd64 -t $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/pushd/imgproxy:$(git rev-parse HEAD) -f docker/Dockerfile .
docker push $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/pushd/imgproxy:$(git rev-parse HEAD)
docker push $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/pushd/imgproxy:$(git rev-parse HEAD)
Loading