Require explict tag when starting psql docker (#368)

* Require explict tag when starting psql docker

Defined a util class to return docker tag of desired PSQL version.
Class is defined in ':db' and shared by ':db' and ':core'. Used
an artifact declaration to exclude unnecesary compile dependencies.

Added a presubmit check for instantiations without explicit tag.
This commit is contained in:
Weimin Yu
2019-11-18 11:33:26 -05:00
committed by GitHub
parent 2cc2571375
commit 365c5da942
10 changed files with 69 additions and 7 deletions
@@ -20,6 +20,7 @@ import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.google.common.annotations.VisibleForTesting;
import google.registry.persistence.HibernateSchemaExporter;
import google.registry.persistence.NomulusPostgreSql;
import google.registry.persistence.PersistenceXmlUtility;
import java.io.File;
import java.io.IOException;
@@ -83,7 +84,7 @@ public class GenerateSqlSchemaCommand implements Command {
// Start the container and store the address information.
postgresContainer =
new PostgreSQLContainer()
new PostgreSQLContainer(NomulusPostgreSql.getDockerTag())
.withDatabaseName(DB_NAME)
.withUsername(DB_USERNAME)
.withPassword(DB_PASSWORD);