Add CI check for chart of accounts
This commit is contained in:
@@ -194,6 +194,26 @@ check-template-modules:
|
||||
script:
|
||||
- .gitlab-scripts/check-template-modules.sh
|
||||
|
||||
check-account-chart:
|
||||
extends: .check
|
||||
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/alpine
|
||||
before_script:
|
||||
- apk add --no-cache libxslt
|
||||
script:
|
||||
- .gitlab-scripts/check-account-chart.sh
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG == null
|
||||
changes:
|
||||
- modules/*/localize.xsl
|
||||
- modules/account/account_chart*.xml
|
||||
- modules/account_be/account_be*.xml
|
||||
- modules/account_be/tax_be*.xml
|
||||
- modules/account_es/account*.xml
|
||||
- modules/account_es/tax*.xml
|
||||
- modules/account_syscohada/account_syscohada*.xml
|
||||
when: on_success
|
||||
- when: never
|
||||
|
||||
.test:
|
||||
stage: test
|
||||
rules:
|
||||
|
||||
Executable
+57
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
OUTPUT=`mktemp -d`
|
||||
|
||||
module="modules/account"
|
||||
mkdir -p "${OUTPUT}/${module}"
|
||||
for lang in en
|
||||
do
|
||||
printf "Check ${module} ${lang} ..."
|
||||
file="${module}/account_chart_${lang}.xml"
|
||||
xsltproc --stringparam lang "${lang}" "${module}/localize.xsl" "${module}/account_chart.xml" > "${OUTPUT}/${file}"
|
||||
cmp "${file}" "${OUTPUT}/${file}"
|
||||
printf "OK\n"
|
||||
done
|
||||
|
||||
module="modules/account_be"
|
||||
mkdir -p "${OUTPUT}/${module}"
|
||||
for lang in fr nl
|
||||
do
|
||||
printf "Check ${module} ${lang} ..."
|
||||
for template in account tax
|
||||
do
|
||||
file="${module}/${template}_be_${lang}.xml"
|
||||
xsltproc --stringparam lang "${lang}" "${module}/localize.xsl" "${module}/${template}_be.xml" > "${OUTPUT}/${file}"
|
||||
cmp "${file}" "${OUTPUT}/${file}"
|
||||
done
|
||||
printf "OK\n"
|
||||
done
|
||||
|
||||
module="modules/account_es"
|
||||
mkdir -p "${OUTPUT}/${module}"
|
||||
for chart in normal pyme
|
||||
do
|
||||
printf "Check ${module} ${chart} ..."
|
||||
for template in account tax
|
||||
do
|
||||
file="${module}/${template}_${chart}.xml"
|
||||
xsltproc --stringparam chart "${chart}" "${module}/create_chart.xsl" "${module}/${template}.xml" > "${OUTPUT}/${file}"
|
||||
cmp "${file}" "${OUTPUT}/${file}"
|
||||
done
|
||||
printf "OK\n"
|
||||
done
|
||||
|
||||
module="modules/account_syscohada"
|
||||
mkdir -p "${OUTPUT}/${module}"
|
||||
for chart in 2001 2016
|
||||
do
|
||||
for lang in fr
|
||||
do
|
||||
printf "Check ${module} ${chart} ${lang} ..."
|
||||
file="${module}/account_syscohada_${chart}_${lang}.xml"
|
||||
xsltproc --stringparam chart "${chart}" --stringparam lang "${lang}" "${module}/localize.xsl" "${module}/account_syscohada.xml" | sed -e "s/\$country/SYSCOHADA/" > "${OUTPUT}/${file}"
|
||||
cmp "${file}" "${OUTPUT}/${file}"
|
||||
printf "OK\n"
|
||||
done
|
||||
done
|
||||
Reference in New Issue
Block a user