Skip to content
Snippets Groups Projects
Commit 0c57b415 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

remove accent sync from app

parent 52c9f78e
No related branches found
No related tags found
No related merge requests found
Pipeline #7787 failed
variables: variables:
NODE_IMAGE: node:19-bullseye NODE_IMAGE: node:19-bullseye
ACCENT_IMAGE: mirego/accent:v1.14.2
DOCKER_HOST: "tcp://docker-dind.gitlab-suma:2375" DOCKER_HOST: "tcp://docker-dind.gitlab-suma:2375"
DOCKER_BUILD_IMAGE: docker:20.10.15 DOCKER_BUILD_IMAGE: docker:20.10.15
DOCKER_IMAGE_NAME: keymanager DOCKER_IMAGE_NAME: keymanager
...@@ -33,26 +32,6 @@ npm_deps: ...@@ -33,26 +32,6 @@ npm_deps:
only: only:
- main - main
lang_files:
stage: build
image: ${NODE_IMAGE}
variables:
npm_config_cache: ${CI_PROJECT_DIR}/pass/.npm
cache:
key: npm-cache
paths:
- pass/.npm
artifacts:
public: false
paths:
- pass/lang
script:
- cd pass
- npm i -g cli-ux accent-cli
- accent sync
only:
- main
build: build:
stage: build stage: build
image: ${DOCKER_BUILD_IMAGE} image: ${DOCKER_BUILD_IMAGE}
......
...@@ -8,7 +8,7 @@ RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc ...@@ -8,7 +8,7 @@ RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc
RUN apt update && apt install -y borgbackup postgresql-client-15 && rm -rf /var/lib/apt/lists/* RUN apt update && apt install -y borgbackup postgresql-client-15 && rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND= ENV DEBIAN_FRONTEND=
RUN npm i -g cli-ux accent-cli knex nodemon RUN npm i -g cli-ux knex nodemon
RUN mkdir /data && chown 1000:1000 /data RUN mkdir /data && chown 1000:1000 /data
VOLUME ["/data"] VOLUME ["/data"]
......
{
"apiUrl": "https://translate.metager.de",
"files": [
{
"language": "de",
"format": "json",
"source": "lang/de/*.json",
"target": "lang/%slug%/%original_file_name%.json",
"hooks": {}
}
]
}
...@@ -25,35 +25,12 @@ let cronjobs = async () => { ...@@ -25,35 +25,12 @@ let cronjobs = async () => {
"YYYY-MM-DD HH:mm:ss" "YYYY-MM-DD HH:mm:ss"
)}] Written ${written_logs} key changes.` )}] Written ${written_logs} key changes.`
); );
//await accentSync();
console.log(`[${now.format("YYYY-MM-DD HH:mm:ss")}] Finish`); console.log(`[${now.format("YYYY-MM-DD HH:mm:ss")}] Finish`);
}; };
console.log("Start"); console.log("Start");
let interval = setInterval(cronjobs, 60000); let interval = setInterval(cronjobs, 60000);
cronjobs(); cronjobs();
async function accentSync() {
if (process.env.NODE_ENV !== "development") {
return;
}
return new Promise((resolve) => {
exec("accent sync", (error, stdout, stderr) => {
if (error) {
console.error(error);
}
if (stderr) {
console.error(stderr);
}
console.log(stdout);
let now = dayjs();
console.log(
`[${now.format("YYYY-MM-DD HH:mm:ss")}] Synced language files.`
);
resolve();
});
});
}
async function writeLogsToOrder() { async function writeLogsToOrder() {
let redis_lock_key = "cron:writeLogsToOrder"; let redis_lock_key = "cron:writeLogsToOrder";
let interval_seconds = 60; // Will execute every minute let interval_seconds = 60; // Will execute every minute
......
...@@ -29,19 +29,6 @@ ...@@ -29,19 +29,6 @@
"url": "<ZAMMAD_URL>", "url": "<ZAMMAD_URL>",
"api_key": "<ZAMMAD_API_KEY>", "api_key": "<ZAMMAD_API_KEY>",
"notification_ticket_id": "0" "notification_ticket_id": "0"
},
"accent": {
"apiUrl": "https://translate.metager.de",
"apiKey": "",
"files": [
{
"language": "de",
"format": "json",
"source": "lang/de/*.json",
"target": "lang/%slug%/%original_file_name%.json",
"hooks": {}
}
]
} }
}, },
"price": { "price": {
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
"node_modules", "node_modules",
".git", ".git",
"package.json", "package.json",
"package-lock.json", "package-lock.json"
"accent.json"
] ]
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment