diff --git a/.aws/task-definition.json b/.aws/task-definition.json index 7da95c9..4f9988b 100644 --- a/.aws/task-definition.json +++ b/.aws/task-definition.json @@ -1,9 +1,9 @@ { - "taskDefinitionArn": "arn:aws:ecs:us-east-1:521520215337:task-definition/poultry:1", + "taskDefinitionArn": "arn:aws:ecs:us-east-1:521520215337:task-definition/poultry:3", "containerDefinitions": [ { "name": "poultry", - "image": "521520215337.dkr.ecr.us-east-1.amazonaws.com/poultry", + "image": "521520215337.dkr.ecr.us-east-1.amazonaws.com/poultry:4b87a0f6dbbd1c7e9fee6229d3053ed9e3aa5dff", "cpu": 0, "portMappings": [ { @@ -15,11 +15,91 @@ } ], "essential": true, - "environment": [], - "environmentFiles": [], + "command": [ + "bash", + "-c", + "python manage.py collectstatic --noinput &&python manage.py makemigrations && python manage.py migrate && python manage.py seed_hrms && python manage.py init_item_types && python manage.py runserver 0.0.0.0:8080" + ], + "environment": [ + { + "name": "EMAIL_USE_TLS", + "value": "REPLACE_ME_EMAIL_USE_TLS" + }, + { + "name": "EMAIL_HOST", + "value": "REPLACE_ME_EMAIL_HOST" + }, + { + "name": "EMAIL_PORT", + "value": "REPLACE_ME_EMAIL_PORT" + }, + { + "name": "EMAIL_HOST_USER", + "value": "REPLACE_ME_EMAIL_HOST_USER" + }, + { + "name": "EMAIL_HOST_PASSWORD", + "value": "REPLACE_ME_EMAIL_HOST_PASSWORD" + }, + + { + "name": "DB_NAME", + "value": "REPLACE_ME_DB_NAME" + }, + { + "name": "DB_HOST", + "value": "REPLACE_ME_DB_HOST" + }, + { + "name": "DB_PASSWORD", + "value": "REPLACE_ME_DB_PASSWORD" + }, + { + "name": "DB_PORT", + "value": "REPLACE_ME_DB_PORT" + }, + { + "name": "DB_USER", + "value": "REPLACE_ME_DB_USER" + }, + { + "name": "BASE_URL", + "value": "REPLACE_ME_BASE_URL" + }, + + { + "name": "OFFCHAIN_BASE_URL", + "value": "REPLACE_ME_OFFCHAIN_BASE_URL" + }, + { + "name": "blockfrostKey", + "value": "REPLACE_ME_blockfrostKey" + }, + { + "name": "secretSeed", + "value": "REPLACE_ME_secretSeed" + }, + { + "name": "cborHex", + "value": "REPLACE_ME_cborHex" + }, + + { + + "name": "data_encryption", + "value": "REPLACE_ME_data_encryption" + }, + { + "name": "encryption_key", + "value": "REPLACE_ME_encryption_key" + }, + { + "name": "IPFS_BLOCKFROST", + "value": "REPLACE_ME_IPFS_BLOCKFROST" + } + ], "mountPoints": [], "volumesFrom": [], - "ulimits": [], "logConfiguration": { "logDriver": "awslogs", "options": { @@ -29,8 +109,7 @@ "max-buffer-size": "25m", "awslogs-region": "us-east-1", "awslogs-stream-prefix": "ecs" - }, - "secretOptions": [] + } }, "systemControls": [] } @@ -39,7 +118,7 @@ "taskRoleArn": "arn:aws:iam::521520215337:role/FileSystemAccess", "executionRoleArn": "arn:aws:iam::521520215337:role/ecsTaskExecutionRole", "networkMode": "awsvpc", - "revision": 1, + "revision": 3, "volumes": [], "status": "ACTIVE", "requiresAttributes": [ @@ -88,7 +167,7 @@ "cpuArchitecture": "X86_64", "operatingSystemFamily": "LINUX" }, - "registeredAt": "2024-11-29T12:56:34.374Z", + "registeredAt": "2024-11-29T14:12:22.237Z", "registeredBy": "arn:aws:sts::521520215337:assumed-role/AWSReservedSSO_mindplex-system-administrator_5eca8704282cca01/esubalew.amenu@singularitynet.io", "tags": [] } \ No newline at end of file diff --git a/.github/workflows/aws.yml b/.github/workflows/aws.yml index 4763a9c..665d5cb 100644 --- a/.github/workflows/aws.yml +++ b/.github/workflows/aws.yml @@ -80,12 +80,27 @@ jobs: - name: Replace env values in task definition run: | - sed -i 's|REPLACE_ME_DEBUG|${{ secrets.DEBUG }}|g' .aws/task-definition.json - sed -i 's|REPLACE_ME_ALLOWED_HOSTS|*|g' .aws/task-definition.json - sed -i 's|REPLACE_ME_SECRET_KEY|${{ secrets.SECRET_KEY }}|g' .aws/task-definition.json - sed -i 's|REPLACE_ME_COM_ID|${{ secrets.COM_ID }}|g' .aws/task-definition.json - sed -i 's|REPLACE_ME_EXTERNAL_USER_API_URL|${{ secrets.STAGINGREP_USER_API_URL }}|g' .aws/task-definition.json - sed -i 's|REPLACE_ME_X_API_KEY|${{ secrets.X_API_KEY }}|g' .aws/task-definition.json + sed -i 's|REPLACE_ME_EMAIL_USE_TLS|${{ secrets.EMAIL_USE_TLS }}|g' .aws/task-definition.json + sed -i 's|REPLACE_ME_EMAIL_HOST|${{ secrets.EMAIL_HOST }}|g' .aws/task-definition.json + sed -i 's|REPLACE_ME_EMAIL_PORT|${{ secrets.EMAIL_PORT }}|g' .aws/task-definition.json + sed -i 's|REPLACE_ME_EMAIL_HOST_USER|${{ secrets.EMAIL_HOST_USER }}|g' .aws/task-definition.json + sed -i 's|REPLACE_ME_EMAIL_HOST_PASSWORD|${{ secrets.EMAIL_HOST_PASSWORD }}|g' .aws/task-definition.json + + sed -i 's|REPLACE_ME_DB_NAME|${{ secrets.DB_NAME }}|g' .aws/task-definition.json + sed -i 's|REPLACE_ME_DB_HOST|${{ secrets.DB_HOST }}|g' .aws/task-definition.json + sed -i 's|REPLACE_ME_DB_PASSWORD|${{ secrets.DB_PASSWORD }}|g' .aws/task-definition.json + sed -i 's|REPLACE_ME_DB_PORT|${{ secrets.DB_PORT }}|g' .aws/task-definition.json + sed -i 's|REPLACE_ME_DB_USER|${{ secrets.DB_USER }}|g' .aws/task-definition.json + sed -i 's|REPLACE_ME_BASE_URL|${{ secrets.BASE_URL }}|g' .aws/task-definition.json + + sed -i 's|REPLACE_ME_OFFCHAIN_BASE_URL|${{ secrets.OFFCHAIN_BASE_URL }}|g' .aws/task-definition.json + sed -i 's|REPLACE_ME_blockfrostKey|${{ secrets.blockfrostKey }}|g' .aws/task-definition.json + sed -i 's|REPLACE_ME_secretSeed|${{ secrets.secretSeed }}|g' .aws/task-definition.json + sed -i 's|REPLACE_ME_cborHex|${{ secrets.cborHex }}|g' .aws/task-definition.json + + sed -i 's|REPLACE_ME_data_encryption|${{ secrets.data_encryption }}|g' .aws/task-definition.json + sed -i 's|REPLACE_ME_encryption_key|${{ secrets.encryption_key }}|g' .aws/task-definition.json + sed -i 's|REPLACE_ME_IPFS_BLOCKFROST|${{ secrets.IPFS_BLOCKFROST }}|g' .aws/task-definition.json - name: Fill in the new image ID in the Amazon ECS task definition id: task-def