Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(git): merge in production to staging #46

Merged
merged 10 commits into from
Nov 13, 2024
6 changes: 4 additions & 2 deletions .github/workflows/terraform_build.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Run tests and apply terraform changes for current branch

on: [push]
on:
push:
workflow_dispatch:

jobs:
build:
Expand Down Expand Up @@ -59,4 +61,4 @@ jobs:
./scripts/infra plan -var "s3_access_key_id=${EXPORTS_S3_ACCESS_KEY_ID}" \
-var "s3_secret_access_key=${EXPORTS_S3_SECRET_ACCESS_KEY}" \
-var "SPARKPOST_API_KEY=${SPARKPOST_API_KEY}"
./scripts/infra apply
./scripts/infra apply
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.PHONY:

up-and-build:
docker-compose up -d --build
docker compose up -d --build

up:
docker-compose up -d
docker compose up -d

down:
docker-compose down
docker compose down

lint:
docker-compose run develop yarn run lint
docker compose run develop yarn run lint

logs:
docker logs -f fw-exports-develop
Expand Down
Binary file not shown.
6 changes: 6 additions & 0 deletions app/src/services/reportFile.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const PDFDocument = require("pdfkit");
const ConvertService = require("./convert.service");
//const GeostoreService = require("./geostore.service");
import logger from "../logger";
import { isBurmese } from "../utils/isBurmese";

const allowedFields = [
"reportName",
Expand Down Expand Up @@ -497,6 +498,7 @@ class ReportFileService {

doc.registerFont("Regular", "./app/src/services/font/NotoSansCJKjp-Regular.otf");
doc.registerFont("Bold", "./app/src/services/font/NotoSansCJKjp-Bold.otf");
doc.registerFont("Burmese", "./app/src/services/font/NotoSansMyanmar-Regular.otf");

doc.fontSize(14).text("Monitoring Report", 50, 80);
doc.font("Bold").fontSize(14).text(record.attributes.reportName.toUpperCase(), 50, 105);
Expand Down Expand Up @@ -537,8 +539,12 @@ class ReportFileService {
textToPrint = `POINT (${value[0]?.toString().substring(0, 9)} ${value[1]?.toString().substring(0, 9)})`;
}
} else textToPrint = value;

doc.font(isBurmese(textToPrint) ? "Burmese" : "Regular");
doc.fontSize(13).text(textToPrint, 80 + 250 * (i % 2), 170 + ((i - (i % 2)) / 2) * 50);
doc.font("Regular");
});

doc.moveDown(1);
doc.moveTo(50, doc.y).lineTo(500, doc.y).stroke();
doc.moveDown(1);
Expand Down
8 changes: 8 additions & 0 deletions app/src/utils/isBurmese.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Check if the text contains only Burmese characters
* @param {String} text The text to check
* @returns {Boolean} True if the text contains only Burmese characters, false otherwise
*/
export function isBurmese(text) {
return /^[\u1000-\u109F]$/.test(text);
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions scripts/delete_workspace
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters

docker-compose -f terraform/docker/docker-compose.yml build
docker-compose -f terraform/docker/docker-compose.yml run --entrypoint delete_workspace --rm terraform -w default "$@" -var="git_sha=${GIT_SHA}"
docker compose -f terraform/docker/docker-compose.yml build
docker compose -f terraform/docker/docker-compose.yml run --entrypoint delete_workspace --rm terraform -w default "$@" -var="git_sha=${GIT_SHA}"
4 changes: 2 additions & 2 deletions scripts/infra
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ set -e

GIT_SHA=$(git rev-parse HEAD)

docker-compose -f terraform/docker/docker-compose.yml build
docker-compose -f terraform/docker/docker-compose.yml run --rm terraform "$@" -w default -var="git_sha=${GIT_SHA}"
docker compose -f terraform/docker/docker-compose.yml build
docker compose -f terraform/docker/docker-compose.yml run --rm terraform "$@" -w default -var="git_sha=${GIT_SHA}"
2 changes: 1 addition & 1 deletion scripts/setup
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -e

docker-compose -f terraform/docker/docker-compose.yml build
docker compose -f terraform/docker/docker-compose.yml build
2 changes: 1 addition & 1 deletion scripts/terraform
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -e

docker-compose -f terraform/docker/docker-compose.yml run -e --rm --entrypoint terraform --workdir /usr/local/src/terraform terraform "$@"
docker compose -f terraform/docker/docker-compose.yml run -e --rm --entrypoint terraform --workdir /usr/local/src/terraform terraform "$@"
Loading
Loading