.gitlab-ci.yml and Dockerfile added
This commit is contained in:
parent
795eb7baae
commit
affc95d624
2 changed files with 69 additions and 0 deletions
33
.gitlab-ci.yml
Normal file
33
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
image:
|
||||||
|
name: maven:3-eclipse-temurin-21-alpine
|
||||||
|
pull_policy: if-not-present
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- test
|
||||||
|
- publish
|
||||||
|
|
||||||
|
build:
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- mvn clean compile -Dmaven.test.skip=true
|
||||||
|
resource_group: indic-search-service-test
|
||||||
|
|
||||||
|
test:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- mvn clean prepare-package
|
||||||
|
artifacts:
|
||||||
|
name: "$CI_COMMIT_REF_NAME"
|
||||||
|
expire_in: 1 day
|
||||||
|
paths:
|
||||||
|
- target/site
|
||||||
|
- target/jacoco.exec
|
||||||
|
resource_group: indic-search-service-test
|
||||||
|
|
||||||
|
publish:
|
||||||
|
stage: publish
|
||||||
|
when: manual
|
||||||
|
script:
|
||||||
|
- mvn -P with-docker-registry clean install -Dmaven.test.skip=true
|
||||||
|
resource_group: indic-search-service-test
|
||||||
36
Dockerfile
Normal file
36
Dockerfile
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
FROM eclipse-temurin:21-jre-alpine
|
||||||
|
|
||||||
|
ENV TZ="Europe/Moscow"
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
WORKDIR /opt/app
|
||||||
|
COPY maven/elastic-apm-agent-1.50.0.jar elastic-apm-agent.jar
|
||||||
|
COPY maven/indic-search-service*.jar indic-search-service.jar
|
||||||
|
COPY maven/application.properties application.properties
|
||||||
|
|
||||||
|
CMD java \
|
||||||
|
-javaagent:/opt/app/elastic-apm-agent.jar \
|
||||||
|
-Xmx${XMX_MB}m \
|
||||||
|
-XX:+UseZGC \
|
||||||
|
-XX:+ZGenerational \
|
||||||
|
-Dcom.sun.management.jmxremote=true \
|
||||||
|
-Dcom.sun.management.jmxremote.port=1234 \
|
||||||
|
-Dcom.sun.management.jmxremote.authenticate=false \
|
||||||
|
-Dcom.sun.management.jmxremote.ssl=false \
|
||||||
|
-Dnode_routing_suffix=${JVM_ROUTE} \
|
||||||
|
-Delastic.apm.service_name="${APM_SERVICE_NAME}" \
|
||||||
|
-Delastic.apm.server_urls="${APM_SERVER_URLS}" \
|
||||||
|
-Delastic.apm.application_packages=ru.nbch \
|
||||||
|
-Delastic.apm.environment="${APM_ENVIRONMENT}" \
|
||||||
|
-Delastic.apm.service_node_name="${APM_SERVICE_NODE_NAME}" \
|
||||||
|
-Delastic.apm.hostname="${APM_SERVICE_NODE_NAME}" \
|
||||||
|
-Delastic.apm.service_version=${APM_SERVICE_VERSION} \
|
||||||
|
-Delastic.apm.enable_log_correlation=true \
|
||||||
|
-Delastic.apm.stack_trace_limit=0 \
|
||||||
|
-Delastic.apm.span_stack_trace_min_duration=-1ms \
|
||||||
|
-Dlog4j2.formatMsgNoLookups=true \
|
||||||
|
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5555 \
|
||||||
|
${JAVA_OPTS} \
|
||||||
|
-jar indic-search-service.jar \
|
||||||
|
--spring.config.location=application.properties
|
||||||
Loading…
Add table
Reference in a new issue