Set up JpaTransactionManager in BEAM pipelines (#639)

* Set up JpaTransactionManager in BEAM pipelines

Added modules and utilities to create JpaTransactionManager in BEAM
pipelines.

Not wanting to set up AppEngine Remote API to access Keyring in the
Datastore, we instead use the credential files in GCS, which are
used by Spinnaker/Cloud Build and desktop access. Added utility
to download, decrypt, and parse the file. Also added/modified dagger
modules.
This commit is contained in:
Weimin Yu 2020-06-23 11:04:52 -04:00 committed by GitHub
parent ec9ca23507
commit 92f579ce24
12 changed files with 550 additions and 8 deletions

View file

@ -76,6 +76,27 @@ test {
useJUnitPlatform()
}
// Sets up integration test with a registry environment. The target environment is
// passed by the 'test.gcp_integration.env' property. Test runner must have been
// authorized to access the corresponding GCP project, e.g., by running 'gcloud auth'
// or placing a credential file at a well known place.
//
// A typical use case is to run tests from desktop that accesses Cloud resources. See
// core/src/test/java/google/registry/beam/initsql/BeamJpaModuleTest.java for an example.
tasks.withType(Test).configureEach {
def gcp_integration_env_property = 'test.gcp_integration.env'
if (project.hasProperty(gcp_integration_env_property)) {
String targetEnv = project.property(gcp_integration_env_property)
if (targetEnv in ['sandbox', 'production']) {
throw new RuntimeException("Integration test with production or sandbox not allowed.")
}
systemProperty gcp_integration_env_property, targetEnv
}
}
tasks.withType(JavaCompile).configureEach {
// The -Werror flag causes Intellij to fail on deprecated api use.
// Allow IDE user to turn off this flag by specifying a Gradle VM