Skip to content

Commit

Permalink
Add mybatis runtime feature v2.2 (#1100)
Browse files Browse the repository at this point in the history
* use corretto tomcat image

* add mybatis runtime feature

* update Dockerfile to remove mybatis

* update opensrp server core

* update configs module

* update snapshot version
  • Loading branch information
bennsimon authored Jun 15, 2022
1 parent d335ce2 commit e9494e4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
18 changes: 2 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,11 @@ RUN mvn clean package -Dmaven.test.skip=true -P $opensrp_maven_package_profiles
WORKDIR /tmp/opensrp-server-web-exploded
RUN jar -xvf /tmp/opensrp-server-web/target/opensrp.war

FROM tomcat:9-jre11-openjdk-slim
FROM tomcat:9-jdk11-corretto
# Copy the exploded directory
COPY --from=build /tmp/opensrp-server-web-exploded /usr/local/tomcat/webapps/opensrp

# copy the migration files
COPY --from=build /tmp/opensrp-server-web/configs/assets/migrations /migrations

# Download mybatis
RUN apt update && apt install -y unzip wget

# setup mybatis
RUN mkdir -p /opt/mybatis \
&& wget --quiet --no-cookies https://github.com/mybatis/migrations/releases/download/mybatis-migrations-3.3.4/mybatis-migrations-3.3.4-bundle.zip -O /opt/mybatis/mybatis-migrations-3.3.4.zip \
&& unzip /opt/mybatis/mybatis-migrations-3.3.4.zip -d /opt/mybatis/ \
&& rm -f /opt/mybatis/mybatis-migrations-3.3.4.zip \
&& chmod +x /opt/mybatis/mybatis-migrations-3.3.4/bin/migrate

# Run migrations (mybatis)
# RUN /opt/mybatis/mybatis-migrations-3.3.4/bin/migrate up --path=/migrations --env=deployment
RUN yum update -y

EXPOSE 8080
# Start app
Expand Down
12 changes: 10 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<artifactId>opensrp-server-web</artifactId>
<packaging>war</packaging>
<version>2.9.6-SNAPSHOT</version>
<version>2.10.0-SNAPSHOT</version>
<name>opensrp-server-web</name>
<description>OpenSRP Server Web Application</description>
<url>https://github.com/OpenSRP/opensrp-server-web</url>
Expand All @@ -24,7 +24,7 @@
<redis.jedis.version>3.8.0</redis.jedis.version>
<opensrp.updatePolicy>always</opensrp.updatePolicy>
<nexus-staging-maven-plugin.version>1.5.1</nexus-staging-maven-plugin.version>
<opensrp.core.version>2.13.4-SNAPSHOT</opensrp.core.version>
<opensrp.core.version>2.14.0-SNAPSHOT</opensrp.core.version>
<opensrp.connector.version>2.4.1-SNAPSHOT</opensrp.connector.version>
<opensrp.interface.version>2.0.1-SNAPSHOT</opensrp.interface.version>
<powermock.version>2.0.5</powermock.version>
Expand Down Expand Up @@ -431,6 +431,14 @@
<resource>
<directory>configs/assets/config</directory>
</resource>
<resource>
<directory>configs/assets/migrations/environments</directory>
<targetPath>mybatis/environments</targetPath>
</resource>
<resource>
<directory>configs/assets/migrations/scripts</directory>
<targetPath>mybatis/scripts</targetPath>
</resource>
<resource>
<directory>configs/build</directory>
<filtering>true</filtering>
Expand Down

0 comments on commit e9494e4

Please sign in to comment.