Skip to content

Commit

Permalink
Add build and publish ssas images command
Browse files Browse the repository at this point in the history
  • Loading branch information
carlpartridge committed Oct 1, 2024
1 parent aada99c commit c86c389
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,16 @@ dbdocs: start-db load-fixtures
docker run --rm -v $PWD:/work -w /work --network bcda-ssas-app_default ghcr.io/k1low/tbls doc --rm-dist "postgres://postgres:toor@db:5432/bcda?sslmode=disable" dbdocs/bcda

.PHONY: docker-build docker-bootstrap load-fixtures test package release smoke-test postman unit-test lint migrations-test start-db dbdocs

# Build and publish images to ECR
build-ssas:
$(eval ACCOUNT_ID =$(shell aws sts get-caller-identity --output text --query Account))
$(eval CURRENT_COMMIT=$(shell git log -n 1 --pretty=format:'%h'))
$(eval DOCKER_REGISTRY_URL=${ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com/bcda-ssas)
docker build -t ${DOCKER_REGISTRY_URL}:latest -t '${DOCKER_REGISTRY_URL}:${CURRENT_COMMIT}' -f Dockerfiles/Dockerfile.ssas .

publish-ssas:
$(eval ACCOUNT_ID =$(shell aws sts get-caller-identity --output text --query Account))
$(eval DOCKER_REGISTRY_URL=${ACCOUNT_ID}.dkr.ecr.us-east-1.amazonaws.com/bcda-ssas)
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin '${DOCKER_REGISTRY_URL}'
docker image push ${DOCKER_REGISTRY_URL} -a

0 comments on commit c86c389

Please sign in to comment.