Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mybatis runtime feature #1102

Merged
merged 4 commits into from
Jun 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>3.1.4-SNAPSHOT</version>
<version>3.2.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 @@ -25,7 +25,7 @@
<redis.lettuce.version>6.1.6.RELEASE</redis.lettuce.version>
<opensrp.updatePolicy>always</opensrp.updatePolicy>
<nexus-staging-maven-plugin.version>1.5.1</nexus-staging-maven-plugin.version>
<opensrp.core.version>3.1.1-SNAPSHOT</opensrp.core.version>
<opensrp.core.version>3.2.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