Add maven-publish task for SQL schema jar (#289)

* Add maven-publish task for SQL schema jar

Add task to publish SQL schema jar with flyway scripts and
golden schema to a maven repo. This will be used
for pre-release testing in the future.

This task is not part of build and needs to be invoked explicitly.

User needs to provide schema_jar_repo and schema_version
properties.

* Merge branch 'master' of https://github.com/google/nomulus into publish-schema-jar

* Add maven-publish task for SQL schema jar

Add task to publish SQL schema jar with flyway scripts and
golden schema to a maven repo. This will be used
for pre-release testing in the future.

This task is not part of build and needs to be invoked explicitly.

User needs to provide schema_jar_repo and schema_version
properties.
This commit is contained in:
Weimin Yu 2019-10-02 14:27:36 -04:00 committed by GitHub
parent cc018a6dac
commit 964f264c9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 2 deletions

View file

@ -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()

View file

@ -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=