Commit 0e9ff3a1 authored by Eliott Paillard's avatar Eliott Paillard
Browse files

initialisation by default in deployment

parent 5cbe40d5
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ RUN apt-get update && apt-get install -y \
    python3-pip \
    git \
    zip \
    curl \
    && rm -rf /var/lib/apt/lists/*

COPY requirements.txt /tmp/requirements.txt
@@ -29,12 +30,14 @@ RUN mkdir -p /opt/robot-tests/working-repo /opt/robot-tests/listeners && \
COPY itb/robot-processing/test-runner-service/src/main/resources/listeners /opt/robot-tests/listeners

ENV PYTHONPATH="/opt/robot-tests"

ENV PATH="/opt/venv/bin:$PATH"

WORKDIR /app

COPY --from=builder /app/target/test-runner-service-*.jar app.jar

COPY itb/robot-processing/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

EXPOSE 8080
CMD ["java", "-jar", "app.jar"]
 No newline at end of file
ENTRYPOINT ["/entrypoint.sh"]
 No newline at end of file
+17 −0
Original line number Diff line number Diff line
#!/bin/sh

java -jar /app/app.jar &
APP_PID=$!

echo "Waiting for service to be ready..."
until curl -sf http://localhost:8080/actuator/health; do
  sleep 2
done
echo "Service ready"

echo "Running init..."
curl -X POST http://localhost:8080/api/init \
     -H "Content-Type: application/json" \
     -d '{}'

wait $APP_PID
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
@@ -58,6 +58,11 @@
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-freemarker</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
    </dependencies>
  	
    <build>