Skip to content

Commit

Permalink
feat: ECS task deployment config file added (#217)
Browse files Browse the repository at this point in the history
* new ci/cd setup; repo cleanup & refactor

* refactor

* license added

* merged main; changed depandabot check to weekly

* added ecs task config file

* fix: release action cleanup
  • Loading branch information
priom authored Oct 26, 2022
1 parent f6d5dc9 commit bf3c570
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 32 deletions.
33 changes: 1 addition & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,4 @@ jobs:
id: release
with:
release-type: go
- name: Checkout code
uses: actions/checkout@v3
if: ${{ steps.release.outputs.release_created }}
- uses: kciter/aws-ecr-action@v4
with:
access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
account_id: ${{ secrets.AWS_ACCOUNT_ID }}
region: ${{ secrets.PROD_AWS_REGION }}
repo: ${{ secrets.PROD_ECR_REPOSITORY }}
tags: ${{ steps.release.outputs.tag_name }}
create_repo: false
if: ${{ steps.release.outputs.release_created }}
- run: 'echo "$PROD_HELM_VALUES" > helm/values.yaml'
shell: bash
env:
PROD_HELM_VALUES: ${{secrets.PROD_HELM_VALUES}}
if: ${{ steps.release.outputs.release_created }}
- name: AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.PROD_AWS_REGION }}
if: ${{ steps.release.outputs.release_created }}
- name: helm deploy
uses: koslib/helm-eks-action@master
env:
KUBE_CONFIG_DATA: ${{ secrets.PROD_KUBE_CONFIG_DATA }}
with:
command: helm upgrade --install --create-namespace --namespace ${{ secrets.PROD_KUBE_NAMESPACE }} --set image.tag=${{ steps.release.outputs.tag_name }} -f helm/values.yaml crawler helm/crawler
if: ${{ steps.release.outputs.release_created }}

102 changes: 102 additions & 0 deletions infra/aws-ecs/nodewatch-prod-task-def.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"taskDefinitionArn": "arn:aws:ecs:us-east-2:381177214925:task-definition/nodewatch-prod-task:4",
"containerDefinitions": [
{
"name": "nodewatch-prod-container",
"image": "381177214925.dkr.ecr.us-east-2.amazonaws.com/nodewatch-prod-ecr:v1.3.1",
"cpu": 256,
"portMappings": [
{
"containerPort": 8080,
"hostPort": 8080,
"protocol": "tcp"
}
],
"essential": true,
"environment": [
{
"name": "env",
"value": "prod"
}
],
"mountPoints": [],
"volumesFrom": [],
"secrets": [
{
"name": "MONGODB_URI",
"valueFrom": "arn:aws:secretsmanager:us-east-2:381177214925:secret:nodewatch-prod-8FCCGw:MONGODB_URI::"
},
{
"name": "RESOLVER_API_KEY",
"valueFrom": "arn:aws:secretsmanager:us-east-2:381177214925:secret:nodewatch-prod-8FCCGw:RESOLVER_API_KEY::"
}
],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "nodewatch-prod-logs",
"awslogs-region": "us-east-2",
"awslogs-stream-prefix": "ecs"
}
}
}
],
"family": "nodewatch-prod-task",
"executionRoleArn": "arn:aws:iam::381177214925:role/nodewatch-prod-role",
"networkMode": "awsvpc",
"revision": 4,
"volumes": [],
"status": "ACTIVE",
"requiresAttributes": [
{
"name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
},
{
"name": "ecs.capability.execution-role-awslogs"
},
{
"name": "com.amazonaws.ecs.capability.ecr-auth"
},
{
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
},
{
"name": "ecs.capability.secrets.asm.environment-variables"
},
{
"name": "ecs.capability.execution-role-ecr-pull"
},
{
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
},
{
"name": "ecs.capability.task-eni"
}
],
"placementConstraints": [],
"compatibilities": [
"EC2",
"FARGATE"
],
"requiresCompatibilities": [
"FARGATE"
],
"cpu": "256",
"memory": "512",
"registeredAt": "2022-04-27T15:23:12.288Z",
"registeredBy": "arn:aws:sts::381177214925:assumed-role/AWSReservedSSO_AWSAdministratorAccess_8acb862b989cc854/[email protected]",
"tags": [
{
"key": "Terraform",
"value": "true"
},
{
"key": "Env",
"value": "PROD"
},
{
"key": "Project",
"value": "Nodewatch"
}
]
}

0 comments on commit bf3c570

Please sign in to comment.