-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from DNXLabs/feature/update-to-python
Refactoring - update scripts to python
- Loading branch information
Showing
32 changed files
with
1,011 additions
and
995 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
AWS_ACCESS_KEY_ID | ||
AWS_SECRET_ACCESS_KEY | ||
AWS_SESSION_TOKEN | ||
|
||
CLUSTER_NAME | ||
APP_NAME | ||
AWS_DEFAULT_REGION | ||
SERVICE_TYPE | ||
IMAGE_NAME | ||
CPU | ||
MEMORY | ||
CONTAINER_PORT | ||
DEFAULT_COMMAND | ||
AWS_ACCOUNT_ID | ||
SUBNETS | ||
DEPLOYMENT_TIMEOUT | ||
SECURITY_GROUPS | ||
TPL_FILE_NAME | ||
ECR_ACCOUNT | ||
BUILD_VERSION | ||
SEVERITY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,16 +3,11 @@ name: Lint | |
on: [push] | ||
|
||
jobs: | ||
|
||
lint: | ||
|
||
name: hadolint | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: hadolint | ||
uses: hadolint/[email protected] | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.env | ||
*/__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,45 @@ | ||
IMAGE_NAME ?= dnxsolutions/ecs-deploy:latest | ||
|
||
.env: | ||
cp .env.template .env | ||
echo >> .env | ||
|
||
build: | ||
docker build -t $(IMAGE_NAME) . | ||
|
||
shell: | ||
docker run --rm -it --entrypoint=/bin/bash -v ~/.aws:/root/.aws -v $(PWD):/opt/app $(IMAGE_NAME) | ||
shell: .env | ||
docker run --rm -it --env-file=.env \ | ||
--entrypoint=/bin/bash -v ~/.aws:/root/.aws \ | ||
-v $(PWD)/src:/work $(IMAGE_NAME) | ||
|
||
scan: build | ||
docker run --rm \ | ||
--volume /var/run/docker.sock:/var/run/docker.sock \ | ||
--name Grype anchore/grype:v0.59.1 \ | ||
$(IMAGE_NAME) | ||
|
||
lint: | ||
docker run --rm -i -v $(PWD)/hadolint.yaml:/.config/hadolint.yaml hadolint/hadolint < Dockerfile | ||
docker run --rm -i \ | ||
-v $(PWD)/hadolint.yaml:/.config/hadolint.yaml \ | ||
hadolint/hadolint < Dockerfile | ||
|
||
deploy: .env | ||
@echo "make deploy" | ||
docker-compose -f docker-compose.yml run --rm deploy | ||
|
||
cutover: .env | ||
@echo "make cutover" | ||
docker-compose -f docker-compose.yml run --rm cutover | ||
|
||
run-task: .env | ||
@echo "make run-task" | ||
docker-compose -f docker-compose.yml run --rm run-task | ||
|
||
worker-deploy: | ||
@echo "make worker-deploy" | ||
docker-compose -f docker-compose.yml run --rm worker-deploy | ||
|
||
ecr-scan: | ||
@echo "make ecr-scan" | ||
docker-compose -f docker-compose.yml run --rm ecr-scan | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,43 @@ | ||
version: '3.4' | ||
|
||
services: | ||
app: | ||
deploy: | ||
build: . | ||
image: public.ecr.aws/dnxsolutions/ecs-deploy:latest | ||
env_file: | ||
- .env | ||
volumes: | ||
- ./templates/task-definition.tpl-default.json:/work/task-definition.tpl.json | ||
|
||
cutover: | ||
build: . | ||
image: public.ecr.aws/dnxsolutions/ecs-deploy:latest | ||
env_file: | ||
- .env | ||
command: /work/deploy-cutover.py | ||
|
||
run-task: | ||
build: . | ||
image: public.ecr.aws/dnxsolutions/ecs-deploy:latest | ||
env_file: | ||
- .env | ||
command: /work/run-task.py | ||
volumes: | ||
- ./templates/task-definition.tpl-default.json:/work/task-definition.tpl.json | ||
|
||
worker-deploy: | ||
build: . | ||
image: public.ecr.aws/dnxsolutions/ecs-deploy:latest | ||
env_file: | ||
- .env | ||
command: /work/worker-deploy.py | ||
volumes: | ||
- ./templates/task-definition.tpl-default.json:/work/task-definition.tpl.json | ||
|
||
ecr-scan: | ||
build: . | ||
image: public.ecr.aws/dnxsolutions/ecs-deploy:latest | ||
env_file: | ||
- .env | ||
command: /work/ecr-enhanced-scanning.py | ||
volumes: | ||
- .:/work | ||
environment: | ||
- AWS_ACCESS_KEY_ID | ||
- AWS_ACCOUNT_ID | ||
- AWS_DEFAULT_REGION | ||
- AWS_ROLE | ||
- AWS_SECRET_ACCESS_KEY | ||
- AWS_SECURITY_TOKEN | ||
- AWS_SESSION_EXPIRATION | ||
- AWS_SESSION_TOKEN | ||
entrypoint: "" | ||
command: /bin/bash | ||
- ./templates/task-definition.tpl-default.json:/work/task-definition.tpl.json |
Oops, something went wrong.