Adding additional cores for development and testing should be easier. The goal here is to make this easier by utilizing docker arguments.
The solr user is also abstracted into an argument for possible arg-based changes, if ever.
The default core is abstracted into MAIN_CORE docker build argument, with a default of sage-discovery. The additional cores are abstracted into EXTRA_CORES docker build argument. This is done primarily because docker has very poor (non-existent) loop and conditional handling. The COPY command needs to be performed in a loop or in conditions but such support is unavailable.
This takes the approach of checking if EXTRA_CORES is empty and if not loop over space separated core names. The MAIN_CORE must be pre-created so that the configuration can be copied. The copying of the configuration in this way avoids needing to use COPY and instead uses the system cp command.
The loops can continue on even in error so &&, ||, and exit 1 are used to guarantee that the loop fails on any error.
The two chmod commands are merged into a single command.
[x] New feature (non-breaking change which adds functionality)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
[x] Manual
Checklist:
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my code
[x] I have made corresponding changes to the documentation
Coverage: 45.217% (-0.02%) from 45.24% when pulling 457550a8933b463166d34c669a5e17a2dac7e866 on additional_solr_cores into f55ca6e8b480efad415c6a60a2a31d20c2ff29a5 on staging.
Description
Adding additional cores for development and testing should be easier. The goal here is to make this easier by utilizing docker arguments.
The solr user is also abstracted into an argument for possible arg-based changes, if ever.
The default core is abstracted into
MAIN_CORE
docker build argument, with a default ofsage-discovery
. The additional cores are abstracted intoEXTRA_CORES
docker build argument. This is done primarily because docker has very poor (non-existent) loop and conditional handling. TheCOPY
command needs to be performed in a loop or in conditions but such support is unavailable.This takes the approach of checking if
EXTRA_CORES
is empty and if not loop over space separated core names. TheMAIN_CORE
must be pre-created so that the configuration can be copied. The copying of the configuration in this way avoids needing to useCOPY
and instead uses the systemcp
command.The loops can continue on even in error so
&&
,||
, andexit 1
are used to guarantee that the loop fails on any error.The two chmod commands are merged into a single command.
Example docker build usage:
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: