Skip to content

Commit

Permalink
Add build and publish ssas images command (#190)
Browse files Browse the repository at this point in the history
## 🎫 Ticket

https://jira.cms.gov/browse/BCDA-8264

## 🛠 Changes

Added make commands to build and publish ssas image. Mostly copy-pasted
from https://github.com/CMSgov/bcda-app/pull/981/files.

## ℹ️ Context

<!-- Why were these changes made? Add background context suitable for a
non-technical audience. -->

<!-- If any of the following security implications apply, this PR must
not be merged without Stephen Walter's approval. Explain in this section
and add @SJWalter11 as a reviewer.
  - Adds a new software dependency or dependencies.
  - Modifies or invalidates one or more of our security controls.
  - Stores or transmits data that was not stored or transmitted before.
- Requires additional review of security implications for other reasons.
-->

## 🧪 Validation

The make commands were run locally.
  • Loading branch information
carlpartridge authored Oct 4, 2024
1 parent 3f6f9ac commit 8942a61
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 8942a61

Please sign in to comment.