diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 10d8398..6b96c5d 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -39,17 +39,6 @@ jobs: mkdir -p $GITHUB_WORKSPACE/src/main/resources/key echo "${{ secrets.FIREBASE_ADMIN_SDK_PRIVATE_KEY }}" | base64 --decode > $GITHUB_WORKSPACE/src/main/resources/key/firebase_admin_sdk_private_key.json - - name: Create fluent-bit.conf.template from Secrets - env: - LOKI_HTTP_USER: ${{ secrets.LOKI_HTTP_USER }} - LOKI_HTTP_PASSWD: ${{ secrets.LOKI_HTTP_PASSWD }} - LOKI_HOST: ${{ secrets.LOKI_HOST }} - LOKI_PORT: ${{ secrets.LOKI_PORT }} - LOKI_S3_BUCKET: ${{ secrets.LOG_S3_BUCKET }} - run: | - envsubst < fluent-bit/fluent-bit.conf.template > fluent-bit/fluent-bit.conf - sed -i 's/\\$/\$/g' fluent-bit/fluent-bit.conf - - name: Grant execute permission for gradlew run: chmod +x gradlew @@ -63,6 +52,10 @@ jobs: aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ env.AWS_REGION }} + - name: Download fluent-bit.conf from S3 + run: | + aws s3 cp s3://earlybird-fluent-bit-conf/fluent-bit.conf fluent-bit/fluent-bit.conf + - name: Login to Amazon ECR id: login-ecr uses: aws-actions/amazon-ecr-login@v2 diff --git a/.gitignore b/.gitignore index 5919867..185284f 100644 --- a/.gitignore +++ b/.gitignore @@ -43,4 +43,5 @@ src/main/resources/key/firebase_admin_sdk_private_key.json logs/*.log -.env \ No newline at end of file +.env +fluent-bit/fluent-bit.conf \ No newline at end of file diff --git a/fluent-bit/fluent-bit.conf.template b/fluent-bit/fluent-bit.conf similarity index 76% rename from fluent-bit/fluent-bit.conf.template rename to fluent-bit/fluent-bit.conf index 09d906c..18c8290 100644 --- a/fluent-bit/fluent-bit.conf.template +++ b/fluent-bit/fluent-bit.conf @@ -25,19 +25,19 @@ Name loki Match * Labels job=ecs_fargate - label_keys \$container_name,\$ecs_task_definition,\$source,$ecs_cluster + label_keys $container_name,$ecs_task_definition,$source,$ecs_cluster remove_keys container_id,ecs_task_arn - http_user ${LOKI_HTTP_USER} - http_passwd ${LOKI_HTTP_PASSWD} - host ${LOKI_HOST} - port ${LOKI_PORT} + http_user earlybird + http_passwd changetheworld + host earlybirdteam.com + port 56789 tls on line_format key_value [OUTPUT] Name s3 Match * - bucket ${LOKI_S3_BUCKET} + bucket earlybird-spring-log region ap-northeast-2 store_dir /tmp/fluent-bit/s3 compression gzip