diff --git a/db/build.gradle b/db/build.gradle index 0a90411da..e5ade8b8b 100644 --- a/db/build.gradle +++ b/db/build.gradle @@ -12,10 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import com.google.common.collect.ImmutableList - plugins { id "org.flywaydb.flyway" version "6.0.1" + id 'maven-publish' } ext { @@ -75,6 +74,35 @@ ext { } } +task schemaJar(type: Jar) { + archiveBaseName = 'schema' + from(sourceSets.main.resources) { + include 'sql/flyway/**' + include 'sql/schema/nomulus.golden.sql' + } +} + +artifacts { + archives schemaJar +} + +publishing { + repositories { + maven { + url project.schema_jar_repo + } + } + publications { + schemaOrmPublication(MavenPublication) { + groupId 'google.registry' + artifactId 'schema' + version project.schema_version + artifact schemaJar + } + } +} + + flyway { def accessInfo = project.ext.getJdbcAccessInfo() diff --git a/gradle.properties b/gradle.properties index 9c64a627e..73510aea0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,3 +15,8 @@ dbServer= dbName=postgres dbUser= dbPassword= + +# Maven repository of the Cloud SQL schema jar, which contains the +# SQL DDL scripts. +schema_jar_repo= +schema_version=