Skip to content

Commit

Permalink
Merge pull request #26 from Flagsmith/release/v2.1.2
Browse files Browse the repository at this point in the history
Release v2.1.2
  • Loading branch information
gagantrivedi authored Sep 21, 2022
2 parents d399a05 + e8dc7f4 commit d907a36
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 9 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/sse-deploy-production-ecs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy SSE to Production ECS

on:
push:
tags:
- "*"
paths:
- "src/**"
- ".github/**"
- "infrastructure/aws/production/**"
jobs:
deploy-production-ecs:
runs-on: ubuntu-latest
name: Deploy SSE to Production ECS
environment: production

steps:
- name: Cloning repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Deploy SSE to Production
uses: ./.github/actions/sse-deploy-ecs
with:
aws_access_key_id: AKIARHES7IUAY422LL5W
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_ecs_cluster_name: flagsmith-api-cluster-eu-west-2-f0b0108
aws_ecs_service_name: flagsmith-sse-svc-eu-west-2-2dd73e1
aws_ecr_repository_arn: 084060095745.dkr.ecr.eu-west-2.amazonaws.com/flagsmith-sse-ecr-27095a4
aws_task_definitions_directory_path: infrastructure/aws/production

8 changes: 4 additions & 4 deletions .github/workflows/sse-deploy-staging-ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ on:
branches:
- main
paths:
- "api/**"
- "src/**"
- ".github/**"
- 'infrastructure/aws/staging/**'
- "infrastructure/aws/staging/**"

jobs:
deploy-staging-ecs:
Expand All @@ -24,8 +24,8 @@ jobs:
- name: Deploy SSE to Staging
uses: ./.github/actions/sse-deploy-ecs
with:
aws_access_key_id: AKIAUM26IRCPH7BHBLVE
aws_secret_access_key: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }}
aws_access_key_id: AKIAUM26IRCPKP5BWQSJ
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_ecs_cluster_name: flagsmith-api-cluster-eu-west-2-f241261
aws_ecs_service_name: flagsmith-sse-svc-eu-west-2-43f7af2
aws_ecr_repository_arn: 302456015006.dkr.ecr.eu-west-2.amazonaws.com/flagsmith-sse-ecr-fa16ac8
Expand Down
44 changes: 44 additions & 0 deletions infrastructure/aws/production/ecs-task-definition-sse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"family": "flagsmith-sse",
"networkMode": "awsvpc",
"executionRoleArn": "arn:aws:iam::084060095745:role/task-sse-role-bb6bdb2",
"taskRoleArn": "arn:aws:iam::084060095745:role/task-sse-role-bb6bdb2",
"containerDefinitions": [
{
"name": "flagsmith-sse",
"command": [
"uvicorn",
"src.main:app",
"--host",
"0.0.0.0",
"--port",
"8000",
"--no-access-log"
],
"cpu": 0,
"portMappings": [
{
"containerPort": 8000,
"hostPort": 8000,
"protocol": "tcp"
}
],
"essential": true,
"environment": [],
"secrets": [],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "flagsmith-sse-eu-west-2-0c3eaaf",
"awslogs-region": "eu-west-2",
"awslogs-stream-prefix": "awslogs-flagsmith-sse"
}
}
}
],
"requiresCompatibilities": [
"FARGATE"
],
"cpu": "1024",
"memory": "2048"
}
7 changes: 2 additions & 5 deletions src/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def json_config_settings_source(settings: BaseSettings) -> Dict[str, Any]:
A simple settings source that loads variables from a JSON file
at the project's root.
"""
encoding = settings.__config__.env_file_encoding
env_file = settings.__config__.env_file
encoding = "utf-8"
env_file = "config.json"
return json.loads(Path(env_file).read_text(encoding))


Expand All @@ -38,9 +38,6 @@ class Settings(BaseSettings):
allow_origins: List[str] = ["*"]

class Config:
env_file = "config.json"
env_file_encoding = "utf-8"

@classmethod
def customise_sources(
cls,
Expand Down

0 comments on commit d907a36

Please sign in to comment.