Commit c19a9a4f authored by Aleksandra Tsys's avatar Aleksandra Tsys
Browse files

Merge branch 'plugin-devops' into 'master'

Plugin devops

See merge request !2
parents ae27bc84 8bbca8d9
data
var-solr
\ No newline at end of file
var-solr
.idea
solr_gradle/.idea
solr_gradle/.gradle
solr_gradle/build/*
......@@ -6,3 +6,9 @@
Загрузить данные в solr проект:
`curl 'http://localhost:8983/solr/demo/update?commit=true' --data-binary @/home/sasha/yelp/final.json -H 'Content-type:application/json'`
## Инструкция к run
* Собрать `./run build`
* Скачать yelp (достаточно выполнить один раз) `./run get-yelp`
* Залить данные `./run reindex-yelp`
\ No newline at end of file
version: '3'
services:
solr:
image: solr:8
build:
context: .
dockerfile: docker/Dockerfile_solr
ports:
- "8983:8983"
volumes:
- ./var-solr:/var/solr
- ./demo:/opt/solr/server/solr/configsets/demo
command: solr-precreate demo /opt/solr/server/solr/configsets/demo
\ No newline at end of file
command: init-suggest.sh
FROM gradle:6.5.1-jdk11 AS builder
# build target jar
WORKDIR /solr_gradle
COPY solr_gradle/build.gradle solr_gradle/settings.gradle ./
RUN gradle
COPY solr_gradle/src/ src/
RUN gradle jar
FROM solr:8.5
# solr build with our plugin
USER root
RUN mkdir /opt/solr/custom_plugins/
RUN chown -R solr:solr /opt/solr/custom_plugins/
RUN chown -R solr:solr /opt/solr/server/solr/configsets
USER solr
COPY --chown=solr:solr yelp /opt/solr/server/solr/configsets/yelp
COPY --from=builder --chown=solr:solr /solr_gradle/build/libs/my-fuzzy.jar /opt/solr/custom_plugins/my-fuzzy.jar
COPY docker/init-suggest.sh /opt/docker-solr/scripts
#!/bin/bash
#
# Hacked solr-precreate version
set -e
echo "Executing $0" "$@"
if [[ "${VERBOSE:-}" == "yes" ]]; then
set -x
fi
# init script for handling an empty /var/solr
/opt/docker-solr/scripts/init-var-solr
. /opt/docker-solr/scripts/run-initdb
/opt/docker-solr/scripts/precreate-core "yelp" "/opt/solr/server/solr/configsets/yelp"
# Provide path to custom_plugins location.
exec solr-fg -Dsolr.sharedLib=/opt/solr/custom_plugins/
......@@ -18,11 +18,14 @@ case "$1" in
# start
$0 all
# index all data (decompress on the fly and pass to index)
tar xzf data/$YELP_DATA final.json -O | curl 'http://localhost:8983/solr/demo/update?commit=true' --data-binary @- -H 'Content-type:application/json'
tar xzf data/$YELP_DATA final.json -O | curl 'http://localhost:8983/solr/yelp/update?commit=true' --data-binary @- -H 'Content-type:application/json'
else
echo "Please use ./run get-yelp to obtain yelp data"
fi
;;
"build")
sudo docker-compose build
;;
"all")
sudo docker-compose down && sudo docker-compose up -d
;;
......
#Thu Aug 06 12:23:52 MSK 2020
gradle.version=6.5.1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment