fix(migrations): preConditions ДО comment в changelog (XSD), relative include paths
- 0001-extensions.xml: переставил <preConditions> перед <comment> (XSD требует preConditions первым в changeSet) - master.xml: include paths сделаны relative к самому master.xml (changes/... вместо db/changelog/changes/...) — CWD inside Docker image это /liquibase, Liquibase searchPath = /liquibase/changelog где master.xml лежит, includes должны идти от него CI: insecure-registry: registry.k8s.265.nstart.local (HTTP без auth для internal cluster), REGISTRY_USER/PASSWORD optional (skip docker login если не заданы)
This commit is contained in:
+7
-1
@@ -54,8 +54,14 @@ maven-package:
|
|||||||
services: [docker:27-dind]
|
services: [docker:27-dind]
|
||||||
variables:
|
variables:
|
||||||
DOCKER_TLS_CERTDIR: "/certs"
|
DOCKER_TLS_CERTDIR: "/certs"
|
||||||
|
# registry.k8s.265.nstart.local — internal insecure HTTP registry, без auth
|
||||||
|
DOCKER_OPTS: "--insecure-registry=registry.k8s.265.nstart.local"
|
||||||
before_script:
|
before_script:
|
||||||
- echo "$REGISTRY_PASSWORD" | docker login $REGISTRY -u "$REGISTRY_USER" --password-stdin
|
# Если REGISTRY_USER/PASSWORD заданы — login. Иначе registry без auth (default для internal)
|
||||||
|
- |
|
||||||
|
if [ -n "$REGISTRY_USER" ] && [ -n "$REGISTRY_PASSWORD" ]; then
|
||||||
|
echo "$REGISTRY_PASSWORD" | docker login $REGISTRY -u "$REGISTRY_USER" --password-stdin
|
||||||
|
fi
|
||||||
|
|
||||||
docker-app:
|
docker-app:
|
||||||
<<: *docker-image
|
<<: *docker-image
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.27.xsd">
|
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.27.xsd">
|
||||||
|
|
||||||
<changeSet id="0001-1-extensions" author="ordinis" runAlways="true">
|
<changeSet id="0001-1-extensions" author="ordinis" runAlways="true">
|
||||||
<comment>Verify required PostgreSQL extensions are present (created by CNPG initdb).</comment>
|
|
||||||
<preConditions onFail="HALT">
|
<preConditions onFail="HALT">
|
||||||
<sqlCheck expectedResult="t">
|
<sqlCheck expectedResult="t">
|
||||||
SELECT EXISTS (SELECT 1 FROM pg_extension WHERE extname = 'postgis')
|
SELECT EXISTS (SELECT 1 FROM pg_extension WHERE extname = 'postgis')
|
||||||
@@ -15,6 +14,7 @@
|
|||||||
SELECT EXISTS (SELECT 1 FROM pg_extension WHERE extname = 'btree_gist')
|
SELECT EXISTS (SELECT 1 FROM pg_extension WHERE extname = 'btree_gist')
|
||||||
</sqlCheck>
|
</sqlCheck>
|
||||||
</preConditions>
|
</preConditions>
|
||||||
|
<comment>Verify required PostgreSQL extensions are present (created by CNPG initdb).</comment>
|
||||||
<sql>SELECT 1;</sql>
|
<sql>SELECT 1;</sql>
|
||||||
</changeSet>
|
</changeSet>
|
||||||
|
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
|
||||||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.27.xsd">
|
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.27.xsd">
|
||||||
|
|
||||||
<include file="db/changelog/changes/0001-extensions.xml"/>
|
<include file="changes/0001-extensions.xml"/>
|
||||||
<include file="db/changelog/changes/0002-dictionary-definitions.xml"/>
|
<include file="changes/0002-dictionary-definitions.xml"/>
|
||||||
<include file="db/changelog/changes/0003-dictionary-records.xml"/>
|
<include file="changes/0003-dictionary-records.xml"/>
|
||||||
<include file="db/changelog/changes/0004-audit-log.xml"/>
|
<include file="changes/0004-audit-log.xml"/>
|
||||||
<include file="db/changelog/changes/0005-outbox-events.xml"/>
|
<include file="changes/0005-outbox-events.xml"/>
|
||||||
<include file="db/changelog/changes/0006-idempotency-keys.xml"/>
|
<include file="changes/0006-idempotency-keys.xml"/>
|
||||||
|
|
||||||
</databaseChangeLog>
|
</databaseChangeLog>
|
||||||
|
|||||||
Reference in New Issue
Block a user