Skip to content

Commit

Permalink
split profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
liweinan committed Nov 7, 2024
1 parent 48835d2 commit b17f374
Show file tree
Hide file tree
Showing 2 changed files with 186 additions and 31 deletions.
2 changes: 1 addition & 1 deletion deployment/add-h2-ds.cli
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
xa-data-source add --name=batch_db --enabled=true --use-java-context=true --use-ccm=true --jndi-name=java:jboss/jsr352/batch_db --xa-datasource-properties={"URL"=>"jdbc:h2:/tmp/batch_db"} --driver-name=h2 --password=sa --user-name=sa --same-rm-override=false --no-recovery=true
xa-data-source add --name=batch_db --enabled=true --use-java-context=true --use-ccm=true --jndi-name=java:jboss/jsr352/batch_db --xa-datasource-properties={"URL"=>"jdbc:h2:/tmp/batch_db;DB_CLOSE_ON_EXIT=FALSE"} --driver-name=h2 --password=sa --user-name=sa --same-rm-override=false --no-recovery=true
/subsystem=batch-jberet/jdbc-job-repository=batch_db:add(data-source=batch_db)
/subsystem=batch-jberet/:write-attribute(name=default-job-repository, value=batch_db)
215 changes: 185 additions & 30 deletions deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,28 @@
<warName>batch-deployment</warName>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<testClassesDirectory>${project.build.testOutputDirectory}</testClassesDirectory>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*IT.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.maven.wildfly.plugin}</version>
<configuration>
<!-- These environment variables are required if you are using the `postgresql-datasource` layer instead of the `postgresql-driver` layer in below.-->
<!-- <env>-->
<!-- <POSTGRESQL_DATABASE>batch_db</POSTGRESQL_DATABASE>-->
<!-- <POSTGRESQL_PASSWORD>123</POSTGRESQL_PASSWORD>-->
<!-- <POSTGRESQL_URL>jdbc:postgresql://localhost:5432/batch_db</POSTGRESQL_URL>-->
<!-- <POSTGRESQL_USER>batch_user</POSTGRESQL_USER>-->
<!-- </env>-->
<provisioning-dir>${jboss.home}</provisioning-dir>
<galleon-options>
<jboss-fork-embedded>${galleon.fork.embedded}</jboss-fork-embedded>
Expand All @@ -108,13 +118,10 @@
</feature-pack>
</feature-packs>
<layers>
<!-- The `postgresql-datasource` layer provides a `PostgreSQLDS` datasource by default.-->
<!-- <layer>postgresql-datasource</layer>-->
<layer>core-tools</layer>
<layer>batch-jberet</layer>
<layer>h2-driver</layer>
<layer>jaxrs-server</layer>
<layer>postgresql-driver</layer>
<layer>h2-driver</layer>
</layers>
<channels>
<channel>
Expand Down Expand Up @@ -162,23 +169,6 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<testClassesDirectory>${project.build.testOutputDirectory}</testClassesDirectory>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*IT.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

Expand All @@ -192,9 +182,174 @@
</activation>
<properties>
<configure.ds.script>${project.basedir}/add-postgresql-ds.cli</configure.ds.script>
<!-- Using this script instead with the `postgresql-datasource` layer-->
<!-- <configure.ds.script>${project.basedir}/add-postgresql-ds-default.cli</configure.ds.script>-->
</properties>
<build>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.maven.wildfly.plugin}</version>
<configuration>
<provisioning-dir>${jboss.home}</provisioning-dir>
<galleon-options>
<jboss-fork-embedded>${galleon.fork.embedded}</jboss-fork-embedded>
</galleon-options>
<feature-packs>
<feature-pack>
<groupId>${server.test.feature.pack.groupId}</groupId>
<artifactId>${server.test.feature.pack.artifactId}</artifactId>
<version>${wildfly.version}</version>
</feature-pack>
<feature-pack>
<location>org.wildfly:wildfly-datasources-galleon-pack:8.0.1.Final</location>
</feature-pack>
</feature-packs>
<layers>
<layer>core-tools</layer>
<layer>batch-jberet</layer>
<layer>jaxrs-server</layer>
<layer>postgresql-driver</layer>
</layers>
<channels>
<channel>
<manifest>
<groupId>org.wildfly.channels</groupId>
<artifactId>wildfly-ee</artifactId>
<version>${wildfly.version}</version>
</manifest>
</channel>
<channel>
<manifest>
<groupId>org.jberet</groupId>
<artifactId>jberet-channel-manifest</artifactId>
<version>${version.jberet}</version>
</manifest>
</channel>
</channels>
<scripts>
<script>${configure.ds.script}</script>
</scripts>
</configuration>
<executions>
<execution>
<id>server-provisioning</id>
<phase>generate-test-resources</phase>
<goals>
<goal>provision</goal>
</goals>
</execution>
<execution>
<id>wildfly-start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
<goal>execute-commands</goal>
<goal>deploy</goal>
</goals>
</execution>
<execution>
<phase>post-integration-test</phase>
<id>wildfly-stop</id>
<goals>
<goal>shutdown</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>postgres-default-ds</id>
<activation>
<property>
<name>postgres-default-ds</name>
</property>
</activation>
<properties>
<configure.ds.script>${project.basedir}/add-postgresql-ds-default.cli</configure.ds.script>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.maven.wildfly.plugin}</version>
<configuration>
<env>
<POSTGRESQL_DATABASE>batch_db</POSTGRESQL_DATABASE>
<POSTGRESQL_PASSWORD>123</POSTGRESQL_PASSWORD>
<POSTGRESQL_URL>jdbc:postgresql://localhost:5432/batch_db</POSTGRESQL_URL>
<POSTGRESQL_USER>batch_user</POSTGRESQL_USER>
</env>
<provisioning-dir>${jboss.home}</provisioning-dir>
<galleon-options>
<jboss-fork-embedded>${galleon.fork.embedded}</jboss-fork-embedded>
</galleon-options>
<feature-packs>
<feature-pack>
<groupId>${server.test.feature.pack.groupId}</groupId>
<artifactId>${server.test.feature.pack.artifactId}</artifactId>
<version>${wildfly.version}</version>
</feature-pack>
<feature-pack>
<location>org.wildfly:wildfly-datasources-galleon-pack:8.0.1.Final</location>
</feature-pack>
</feature-packs>
<layers>
<layer>postgresql-datasource</layer>
<layer>core-tools</layer>
<layer>batch-jberet</layer>
<layer>jaxrs-server</layer>
</layers>
<channels>
<channel>
<manifest>
<groupId>org.wildfly.channels</groupId>
<artifactId>wildfly-ee</artifactId>
<version>${wildfly.version}</version>
</manifest>
</channel>
<channel>
<manifest>
<groupId>org.jberet</groupId>
<artifactId>jberet-channel-manifest</artifactId>
<version>${version.jberet}</version>
</manifest>
</channel>
</channels>
<scripts>
<script>${configure.ds.script}</script>
</scripts>
</configuration>
<executions>
<execution>
<id>server-provisioning</id>
<phase>generate-test-resources</phase>
<goals>
<goal>provision</goal>
</goals>
</execution>
<execution>
<id>wildfly-start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
<goal>execute-commands</goal>
<goal>deploy</goal>
</goals>
</execution>
<execution>
<phase>post-integration-test</phase>
<id>wildfly-stop</id>
<goals>
<goal>shutdown</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit b17f374

Please sign in to comment.