diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml new file mode 100644 index 0000000..ee5174a --- /dev/null +++ b/.github/workflows/dev-build.yml @@ -0,0 +1,24 @@ +### This is the Terraform-generated dev-build.yml workflow for the marimo-launcher-dev app repository ### +### If this is a Lambda repo, uncomment the FUNCTION line at the end of the document ### +### If the container requires any additional pre-build commands, uncomment and edit ### +### the PREBUILD line at the end of the document. ### +name: Dev Container Build and Deploy +on: + workflow_dispatch: + pull_request: + branches: + - main + paths-ignore: + - '.github/**' + +jobs: + deploy: + name: Dev Container Deploy + uses: mitlibraries/.github/.github/workflows/ecr-shared-deploy-dev.yml@main + secrets: inherit + with: + AWS_REGION: "us-east-1" + GHA_ROLE: "marimo-launcher-gha-dev" + ECR: "marimo-launcher-dev" + # FUNCTION: "" + # PREBUILD: diff --git a/.github/workflows/prod-promote.yml b/.github/workflows/prod-promote.yml new file mode 100644 index 0000000..d524d43 --- /dev/null +++ b/.github/workflows/prod-promote.yml @@ -0,0 +1,21 @@ +### This is the Terraform-generated prod-promote.yml workflow for the marimo-launcher-prod repository. ### +### If this is a Lambda repo, uncomment the FUNCTION line at the end of the document. ### +name: Prod Container Promote +on: + workflow_dispatch: + release: + types: [published] + +jobs: + deploy: + name: Prod Container Promote + uses: mitlibraries/.github/.github/workflows/ecr-shared-promote-prod.yml@main + secrets: inherit + with: + AWS_REGION: "us-east-1" + GHA_ROLE_STAGE: marimo-launcher-gha-stage + GHA_ROLE_PROD: marimo-launcher-gha-prod + ECR_STAGE: "marimo-launcher-stage" + ECR_PROD: "marimo-launcher-prod" + # FUNCTION: "" + \ No newline at end of file diff --git a/.github/workflows/stage-build.yml b/.github/workflows/stage-build.yml new file mode 100644 index 0000000..0d27077 --- /dev/null +++ b/.github/workflows/stage-build.yml @@ -0,0 +1,24 @@ +### This is the Terraform-generated dev-build.yml workflow for the marimo-launcher-stage app repository ### +### If this is a Lambda repo, uncomment the FUNCTION line at the end of the document ### +### If the container requires any additional pre-build commands, uncomment and edit ### +### the PREBUILD line at the end of the document. ### +name: Stage Container Build and Deploy +on: + workflow_dispatch: + push: + branches: + - main + paths-ignore: + - '.github/**' + +jobs: + deploy: + name: Stage Container Deploy + uses: mitlibraries/.github/.github/workflows/ecr-shared-deploy-stage.yml@main + secrets: inherit + with: + AWS_REGION: "us-east-1" + GHA_ROLE: "marimo-launcher-gha-stage" + ECR: "marimo-launcher-stage" + # FUNCTION: "" + # PREBUILD: diff --git a/Makefile b/Makefile index 36061ff..3a1ea7e 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,16 @@ SHELL=/bin/bash DATETIME:=$(shell date -u +%Y%m%dT%H%M%SZ) +### This is the Terraform-generated header for marimo-launcher-dev. ### +ECR_NAME_DEV:=marimo-launcher-dev +ECR_URL_DEV:=222053980223.dkr.ecr.us-east-1.amazonaws.com/marimo-launcher-dev +### End of Terraform-generated header ### help: # Preview Makefile commands @awk 'BEGIN { FS = ":.*#"; print "Usage: make \n\nTargets:" } \ /^[-_[:alpha:]]+:.?*#/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST) # ensure OS binaries aren't called if naming conflict with Make recipes -.PHONY: help venv install update test coveralls lint black mypy ruff safety lint-apply black-apply ruff-apply +.PHONY: help dist-dev publish-dev dist-stage publish-stage venv install update test coveralls lint black mypy ruff safety lint-apply black-apply ruff-apply ############################################## # Python Environment and Dependency commands @@ -73,4 +77,33 @@ build: # Build local image for testing docker build -t marimo-launcher:latest . shell: # Shell into local container for testing - docker run -it --entrypoint='bash' marimo-launcher:latest \ No newline at end of file + docker run -it --entrypoint='bash' marimo-launcher:latest + + +### Terraform-generated Developer Deploy Commands for Dev environment ### +dist-dev: ## Build docker container (intended for developer-based manual build) + docker build --platform linux/amd64 \ + -t $(ECR_URL_DEV):latest \ + -t $(ECR_URL_DEV):`git describe --always` \ + -t $(ECR_NAME_DEV):latest . + +publish-dev: dist-dev ## Build, tag and push (intended for developer-based manual publish) + docker login -u AWS -p $$(aws ecr get-login-password --region us-east-1) $(ECR_URL_DEV) + docker push $(ECR_URL_DEV):latest + docker push $(ECR_URL_DEV):`git describe --always` + +### Terraform-generated manual shortcuts for deploying to Stage. This requires ### +### that ECR_NAME_STAGE, ECR_URL_STAGE, and FUNCTION_STAGE environment ### +### variables are set locally by the developer and that the developer has ### +### authenticated to the correct AWS Account. The values for the environment ### +### variables can be found in the stage_build.yml caller workflow. ### +dist-stage: ## Only use in an emergency + docker build --platform linux/amd64 \ + -t $(ECR_URL_STAGE):latest \ + -t $(ECR_URL_STAGE):`git describe --always` \ + -t $(ECR_NAME_STAGE):latest . + +publish-stage: ## Only use in an emergency + docker login -u AWS -p $$(aws ecr get-login-password --region us-east-1) $(ECR_URL_STAGE) + docker push $(ECR_URL_STAGE):latest + docker push $(ECR_URL_STAGE):`git describe --always`