-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add maven integration tests
- Loading branch information
Showing
34 changed files
with
1,324 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
invoker.goals=clean process-resources | ||
invoker.description = Generate AsciiDoc with Liquibase Extension | ||
invoker.name = Liquibase-Extension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.example</groupId> | ||
<artifactId>asciidoctor-liquibase-extension-example</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
|
||
<build> | ||
<defaultGoal>clean process-resources</defaultGoal> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.asciidoctor</groupId> | ||
<artifactId>asciidoctor-maven-plugin</artifactId> | ||
<version>2.0.0-RC.1</version> | ||
<configuration> | ||
<backend>html</backend> | ||
<sourceDirectory>${basedir}/src/docs</sourceDirectory> | ||
<sourceDocumentName>index.adoc</sourceDocumentName> | ||
<attributes> | ||
<liquibase-dir>${project.build.directory}/generated-docs/liquibase</liquibase-dir> | ||
</attributes> | ||
<resources> | ||
<resource> | ||
<directory>${basedir}/src/main/resources</directory> | ||
<targetPath>liquibase</targetPath> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>process-resources</phase> | ||
<goals><goal>process-asciidoc</goal></goals> | ||
</execution> | ||
</executions> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.uniqueck</groupId> | ||
<artifactId>asciidoctorj-liquibase-extension</artifactId> | ||
<version>@project.version@</version> | ||
</dependency> | ||
</dependencies> | ||
</plugin> | ||
</plugins> | ||
|
||
</build> | ||
|
||
|
||
<repositories> | ||
<repository> | ||
<snapshots> | ||
<enabled> | ||
false | ||
</enabled> | ||
</snapshots> | ||
<id> | ||
bintray-uniqueck-asciidoctorj | ||
</id> | ||
<name> | ||
bintray | ||
</name> | ||
<url> | ||
https://dl.bintray.com/uniqueck/asciidoctorj | ||
</url> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<snapshots> | ||
<enabled> | ||
false | ||
</enabled> | ||
</snapshots> | ||
<id> | ||
bintray-uniqueck-asciidoctorj | ||
</id> | ||
<name> | ||
bintray-plugins | ||
</name> | ||
<url> | ||
https://dl.bintray.com/uniqueck/asciidoctorj | ||
</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
= AsciiDoc Liquibase Extension Example | ||
|
||
ifndef::liquibase-dir[:liquibase-dir: ../main/resources] | ||
|
||
liquibase::{liquibase-dir}/db.changelog-master.xml[] |
87 changes: 87 additions & 0 deletions
87
...-with-copy-resources/src/main/resources/changelog/1.0/1.0_create-deployment_job_table.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<databaseChangeLog | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"> | ||
|
||
<!-- Deployment_Job Seq - Start --> | ||
<changeSet author="author@x.de" id="create_Deployment_Job_SEQ"> | ||
<preConditions onFail="MARK_RAN"> | ||
<not> | ||
<sequenceExists sequenceName="DEPLOYMENTJOB_SEQ"/> | ||
</not> | ||
</preConditions> | ||
<createSequence incrementBy="1" sequenceName="DEPLOYMENTJOB_SEQ" startValue="1"/> | ||
</changeSet> | ||
<!-- Deployment_Job Seq - Ende --> | ||
|
||
<!-- Deployment_Job Table - Start --> | ||
<changeSet author="author@x.de" id="create_Deployment_Job_TAB"> | ||
<preConditions onFail="MARK_RAN"> | ||
<not> | ||
<tableExists tableName="DEPLOYMENT_JOB"/> | ||
</not> | ||
</preConditions> | ||
<createTable tableName="DEPLOYMENT_JOB"> | ||
<column name="ID" type="number"> | ||
<constraints nullable="false" /> | ||
</column> | ||
|
||
<column name="NAME" type="varchar(100)" /> | ||
<column name="PROJEKTNAME" type="varchar(100)" /> | ||
<column name="DEPLOYMENTART" type="varchar(20)" /> | ||
|
||
<column name="STATUS" type="varchar(10)" defaultValue="AKTIV"> | ||
<constraints nullable="false" /> | ||
</column> | ||
</createTable> | ||
|
||
<addUniqueConstraint tableName="DEPLOYMENT_JOB" columnNames="PROJEKTNAME" constraintName="DEPLOYMENT_JOB_UK1" /> | ||
|
||
<sql>ALTER TABLE DEPLOYMENT_JOB ADD CONSTRAINT DEPLOYMENT_JOB_CHK2 CHECK (STATUS IN ('AKTIV', 'INAKTIV'))</sql> | ||
<sql>ALTER TABLE DEPLOYMENT_JOB ADD CONSTRAINT DEPLOYMENT_JOB_CHK1 CHECK (DEPLOYMENTART IN ('SERVER', 'CLIENT'))</sql> | ||
|
||
</changeSet> | ||
<!-- Deployment_Job Table - Ende --> | ||
|
||
<!-- Deployment_Job Primary Key - Start --> | ||
<changeSet author="author@x.de" id="create_Deployment_Job_PK"> | ||
<preConditions onFail="MARK_RAN"> | ||
<not> | ||
<primaryKeyExists tableName="DEPLOYMENT_JOB" primaryKeyName="DEPLOYMENTJOB_PK"/> | ||
</not> | ||
</preConditions> | ||
<addPrimaryKey tableName="DEPLOYMENT_JOB" columnNames="ID" constraintName="DEPLOYMENTJOB_PK" /> | ||
</changeSet> | ||
<!-- DeploymentLog Primary Key - Ende --> | ||
|
||
|
||
<!-- Deployment_Job Trigger - Start --> | ||
<changeSet author="author@x.de" id="create_Deployment_Job_TRG"> | ||
<sql dbms="hsqldb">CREATE TRIGGER DEPLOYMENT_JOB_TRIGGER BEFORE INSERT ON DEPLOYMENT_JOB REFERENCING NEW ROW AS newrow FOR EACH ROW SET newrow.ID = NEXT VALUE FOR DEPLOYMENTJOB_SEQ</sql> | ||
<createProcedure dbms="oracle"> | ||
create or replace TRIGGER DEPLOYMENT_JOB_TRIGGER | ||
before insert on DEPLOYMENT_JOB | ||
for each row | ||
begin | ||
if inserting then | ||
if :NEW."ID" is null then | ||
select DEPLOYMENTJOB_SEQ.nextval into :NEW."ID" from dual; | ||
end if; | ||
end if; | ||
end; | ||
</createProcedure> | ||
</changeSet> | ||
<!-- DeploymentLog Trigger - Ende --> | ||
|
||
|
||
|
||
|
||
|
||
<changeSet author="author@x.de" id="tag-1.0"> | ||
<tagDatabase tag="1.0"/> | ||
</changeSet> | ||
|
||
|
||
</databaseChangeLog> |
94 changes: 94 additions & 0 deletions
94
...-with-copy-resources/src/main/resources/changelog/1.0/1.0_create-deployment_log_table.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<databaseChangeLog | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"> | ||
|
||
<!-- Deployment_Log Seq - Start --> | ||
<changeSet author="author@x.de" id="create_Deployment_Log_SEQ"> | ||
<preConditions onFail="MARK_RAN"> | ||
<not> | ||
<sequenceExists sequenceName="DEPLOYMENT_LOG_SEQ"/> | ||
</not> | ||
</preConditions> | ||
<createSequence incrementBy="1" sequenceName="DEPLOYMENT_LOG_SEQ" startValue="1"/> | ||
</changeSet> | ||
<!-- Deployment_Log Seq - Ende --> | ||
|
||
<!-- Deployment_Log Table - Start --> | ||
<changeSet author="author@x.de" id="create_Deployment_Log_TAB"> | ||
<preConditions onFail="MARK_RAN"> | ||
<not> | ||
<tableExists tableName="DEPLOYMENT_LOG"/> | ||
</not> | ||
</preConditions> | ||
<createTable tableName="DEPLOYMENT_LOG"> | ||
<column name="ID" type="number"> | ||
<constraints nullable="false" /> | ||
</column> | ||
|
||
<column name="DEPLOYMENTTRIGGER_ID" type="number"> | ||
<constraints nullable="false" /> | ||
</column> | ||
|
||
<column name="ZEITPUNKT" type="datetime(6)"> | ||
<constraints nullable="false" /> | ||
</column> | ||
|
||
<column name="DEPLOYMENTLOG_ID" type="number" /> | ||
</createTable> | ||
</changeSet> | ||
<!-- Deployment_Log Table - Ende --> | ||
|
||
<!-- Deployment_Log Primary Key - Start --> | ||
<changeSet author="author@x.de" id="create_Deployment_Log_PK"> | ||
<preConditions onFail="MARK_RAN"> | ||
<not> | ||
<primaryKeyExists tableName="DEPLOYMENT_LOG" primaryKeyName="DEPLOYMENT_LOG_PK"/> | ||
</not> | ||
</preConditions> | ||
<addPrimaryKey tableName="DEPLOYMENT_LOG" columnNames="ID" constraintName="DEPLOYMENT_LOG_PK" /> | ||
</changeSet> | ||
<!-- Deployment_Log Primary Key - Ende --> | ||
|
||
<!-- Deployment_Log Add Foreign Key - Start --> | ||
<changeSet author="author@x.de" id="add_Deployment_Log_ForeignKey_Deployment_Trigger"> | ||
<preConditions onFail="MARK_RAN"> | ||
<not> | ||
<foreignKeyConstraintExists foreignKeyName="DEPLOYMENT_LOG_DEPLOYMENT_FK1"></foreignKeyConstraintExists> | ||
</not> | ||
</preConditions> | ||
<addForeignKeyConstraint baseTableName="DEPLOYMENT_LOG" baseColumnNames="DEPLOYMENTTRIGGER_ID" referencedTableName="DEPLOYMENT_TRIGGER" referencedColumnNames="ID" constraintName="DEPLOYMENT_LOG_DEPLOYMENT_FK1" /> | ||
</changeSet> | ||
|
||
<changeSet author="author@x.de" id="add_Deployment_Log_ForeignKey_Deployment_Log"> | ||
<preConditions onFail="MARK_RAN"> | ||
<not> | ||
<foreignKeyConstraintExists foreignKeyName="DEPLOYMENT_LOG_DEPLOYMENT_FK2" /> | ||
</not> | ||
</preConditions> | ||
<addForeignKeyConstraint baseTableName="DEPLOYMENT_LOG" baseColumnNames="DEPLOYMENTLOG_ID" referencedTableName="DEPLOYMENT_LOG" referencedColumnNames="ID" constraintName="DEPLOYMENT_LOG_DEPLOYMENT_FK2" /> | ||
</changeSet> | ||
<!-- Deployment_Log Add Foreign Key - Ende --> | ||
|
||
|
||
<!-- Deployment_Log Trigger - Start --> | ||
<changeSet author="author@x.de" id="create_Deployment_Log_TRG"> | ||
<sql dbms="hsqldb">CREATE TRIGGER DEPLOYMENT_LOG_TRIGGER BEFORE INSERT ON DEPLOYMENT_LOG REFERENCING NEW ROW AS newrow FOR EACH ROW SET newrow.ID = NEXT VALUE FOR DEPLOYMENT_LOG_SEQ</sql> | ||
<createProcedure dbms="oracle"> | ||
create or replace TRIGGER DEPLOYMENT_LOG_TRIGGER | ||
before insert on DEPLOYMENT_LOG | ||
for each row | ||
begin | ||
if inserting then | ||
if :NEW."ID" is null then | ||
select DEPLOYMENT_LOG_SEQ.nextval into :NEW."ID" from dual; | ||
end if; | ||
end if; | ||
end; | ||
</createProcedure> | ||
</changeSet> | ||
<!-- Deployment_Log Trigger - Ende --> | ||
|
||
</databaseChangeLog> |
Oops, something went wrong.