feat: ci/cd - validate translations (#109)
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Reviewed-on: #109
This commit is contained in:
parent
09ffc7644a
commit
0cc1f1637a
22
.drone.yml
22
.drone.yml
|
@ -67,6 +67,26 @@ trigger:
|
||||||
branch:
|
branch:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: translations
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: validate
|
||||||
|
image: golang:1.20
|
||||||
|
pull: always
|
||||||
|
commands:
|
||||||
|
- apt update && apt -y install jq
|
||||||
|
- make validate-translations
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
|
@ -372,6 +392,6 @@ depends_on:
|
||||||
- migrations-manifest
|
- migrations-manifest
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: adb6f2a2d07f26eb833ea4cac0f54bb6aea7bc53a38d423afe7408701b270ac2
|
hmac: 4fa2583c281aacc0e4d0dc87296a2ce6ff7facf71d1ce2e9f5d4157b35635d4f
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -47,3 +47,7 @@ create-sql-migration: install-goose
|
||||||
.PHONY: validate-migrations
|
.PHONY: validate-migrations
|
||||||
validate-migrations: install-goose
|
validate-migrations: install-goose
|
||||||
@goose -dir migrations -v validate
|
@goose -dir migrations -v validate
|
||||||
|
|
||||||
|
.PHONY: validate-translations
|
||||||
|
validate-translations:
|
||||||
|
@./validate_translations.sh
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
LOCALE_EN_PATH="./internal/discord/internal/discordi18n/locale.en.json"
|
||||||
|
|
||||||
|
status=0
|
||||||
|
|
||||||
|
for path in ./internal/discord/internal/discordi18n/locale.*.json; do
|
||||||
|
if [ "$path" = $LOCALE_EN_PATH ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
echo "----- ${path}"
|
||||||
|
if diff <(jq 'keys' $LOCALE_EN_PATH) <(jq 'keys' "$path"); then
|
||||||
|
echo "----- Success"
|
||||||
|
else
|
||||||
|
status=1
|
||||||
|
echo "----- Failed"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
exit "$status"
|
Loading…
Reference in New Issue