gerrit/gerrit-pgm/BUCK
Dariusz Luksza 256ec34af2 Enable SecureStore configuration during init
Add new flag for the init program:

 * --secure-store-lib

That enables configuration of SecureStore during init. It will
automatically discover implementations of SecureStore interface inside
jar file. If there is not exactly one implementation the init will fail.

During init the SecureStore jar file will be added to Gerrit classpath.
Then after init this file will be copied to $gerrit_site/lib directory.
The discovered value of 'secureStoreImpl' will be saved in the
gerrit.config file.

This change also introduces a @SecureStoreClassName String binding early
in the startup so that this can be injected anywhere without worrying
about having the @GerritServerConfig bound (which itself requires an
injection of the SecureStore).

If an already initialized site with a custom secure store is init-ed
again and the --secure-store-lib option is not specified then the
gerrit.secureStoreClass is honored to ensure we use the same secure
store implementation. If the --secure-store-lib option is specified then
the gerrit.secureStoreClass is ignored during init and will be
overwritten with the new secure store.

Without this modification schema updates will fail because of wrong
password when custom SecureStore is used.

Change-Id: Iae22bbdace0d9c7e7db0690c4bf522176fc3308e
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
2015-02-17 11:15:01 +09:00

136 lines
2.8 KiB
Python

SRCS = 'src/main/java/com/google/gerrit/pgm/'
RSRCS = 'src/main/resources/com/google/gerrit/pgm/'
INIT_API_SRCS = glob([SRCS + 'init/api/*.java'])
DEPS = [
'//gerrit-common:server',
'//gerrit-extension-api:api',
'//gerrit-gwtexpui:linker_server',
'//gerrit-gwtexpui:server',
'//gerrit-httpd:httpd',
'//gerrit-server:server',
'//gerrit-sshd:sshd',
'//gerrit-reviewdb:server',
'//lib:guava',
'//lib/guice:guice',
'//lib/guice:guice-assistedinject',
'//lib/guice:guice-servlet',
'//lib/jgit:jgit',
'//lib/log:api',
'//lib/log:log4j',
]
java_library(
name = 'init-api',
srcs = INIT_API_SRCS,
deps = DEPS + ['//gerrit-common:annotations'],
visibility = ['PUBLIC'],
)
java_sources(
name = 'init-api-src',
srcs = INIT_API_SRCS,
visibility = ['PUBLIC'],
)
java_library(
name = 'init',
srcs = glob([SRCS + 'init/*.java']),
resources = glob([RSRCS + 'init/*']),
deps = DEPS + [
':init-api',
':util',
'//gerrit-common:annotations',
'//gerrit-lucene:lucene',
'//lib:args4j',
'//lib:gwtjsonrpc',
'//lib:gwtorm',
'//lib:h2',
'//lib/commons:validator',
'//lib/mina:sshd',
],
provided_deps = ['//gerrit-launcher:launcher'],
visibility = [
'//gerrit-acceptance-tests/...',
'//gerrit-war:',
],
)
java_library(
name = 'util',
srcs = glob([SRCS + 'util/*.java']),
deps = DEPS + [
'//gerrit-cache-h2:cache-h2',
'//gerrit-util-cli:cli',
'//lib:args4j',
'//lib:gwtorm',
'//lib/commons:dbcp',
],
visibility = [
'//gerrit-acceptance-tests/...',
'//gerrit-gwtdebug:gwtdebug',
'//gerrit-war:',
],
)
java_library(
name = 'http',
srcs = glob([SRCS + 'http/**/*.java']),
deps = DEPS + [
'//lib/jetty:jmx',
'//lib/jetty:server',
'//lib/jetty:servlet',
],
provided_deps = [
'//gerrit-launcher:launcher',
'//lib:servlet-api-3_1',
],
visibility = ['//gerrit-war:'],
)
java_library(
name = 'pgm',
srcs = glob([SRCS + '*.java']),
resources = glob([RSRCS + '*']),
deps = DEPS + [
':http',
':init',
':init-api',
':util',
'//gerrit-cache-h2:cache-h2',
'//gerrit-lucene:lucene',
'//gerrit-openid:openid',
'//gerrit-solr:solr',
'//lib:args4j',
'//lib:gwtorm',
'//lib:servlet-api-3_1',
'//lib/prolog:prolog-cafe',
],
provided_deps = ['//gerrit-launcher:launcher'],
visibility = [
'//:',
'//gerrit-acceptance-tests/...',
'//gerrit-gwtdebug:gwtdebug',
'//tools/eclipse:classpath',
'//Documentation:licenses.txt',
],
)
java_test(
name = 'pgm_tests',
srcs = glob(['src/test/java/**/*.java']),
deps = [
':init',
':init-api',
':pgm',
'//gerrit-server:server',
'//lib:junit',
'//lib/easymock:easymock',
'//lib/guice:guice',
'//lib/jgit:jgit',
'//lib/jgit:junit',
],
source_under_test = [':pgm'],
)