Skip to content

Commit

Permalink
environment variables added
Browse files Browse the repository at this point in the history
  • Loading branch information
EsubalewAmenu authored Nov 29, 2024
1 parent 8fadcb3 commit 7003576
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 15 deletions.
97 changes: 88 additions & 9 deletions .aws/task-definition.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand All @@ -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": {
Expand All @@ -29,8 +109,7 @@
"max-buffer-size": "25m",
"awslogs-region": "us-east-1",
"awslogs-stream-prefix": "ecs"
},
"secretOptions": []
}
},
"systemControls": []
}
Expand All @@ -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": [
Expand Down Expand Up @@ -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/[email protected]",
"tags": []
}
27 changes: 21 additions & 6 deletions .github/workflows/aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7003576

Please sign in to comment.