added liquibase for setup of databases and initial values

fixed some table names to be singular
migrated templates to separate repository
added seed data to initial version in liquibase migrations instead of property files (post targets, emotes etc) and created some default tables containing those default values
added separate artifacts to be used containing only the liquibase config
added shell script as a wrapper for ansible deployment, to handle an environment variable defining whether or not the deployment should be executed
added logback scan period
added licenses for ansible, liquibase, docker and docker-compose
This commit is contained in:
Sheldan
2020-07-01 20:44:21 +02:00
parent e8767429bf
commit 9374dfb912
965 changed files with 15775 additions and 2935 deletions

View File

@@ -0,0 +1,37 @@
FROM ubuntu as base
MAINTAINER Sheldan
ENV DEBIAN_FRONTEND=noninteractive
ARG maven_version=3.6.3
ARG liquibase_version=3.8.9
ARG postgres_driver_version=42.2.14
# Install prerequisities for Ansible
RUN apt-get update \
&& apt-get install -y unzip wget \
&& rm -rf /var/lib/apt/lists/
# Install liquibase
RUN mkdir -p /liqiubase \
&& wget https://github.com/liquibase/liquibase/releases/download/v${liquibase_version}/liquibase-${liquibase_version}.zip -O /tmp/liquibase.zip \
&& unzip /tmp/liquibase.zip -d /liquibase
RUN mkdir -p /java \
&& wget https://corretto.aws/downloads/latest/amazon-corretto-8-x64-linux-jdk.tar.gz -O /tmp/java.tar.gz \
&& tar -xf /tmp/java.tar.gz --strip-components=1 -C /java
# Install postgres driver
RUN mkdir -p /postgres \
&& wget https://jdbc.postgresql.org/download/postgresql-${postgres_driver_version}.jar -O /postgres/driver.jar
# Install ansible and required libraries
FROM python:3.7-slim-buster as runtime
RUN pip3 install --no-cache-dir ansible psycopg2-binary SQLAlchemy lxml
RUN apt-get update && apt-get install unzip && rm -rf /var/lib/apt/lists/
COPY --from=base /liquibase /liquibase
COPY --from=base /postgres /postgres
COPY --from=base /java /java
ENV JAVA_HOME=/java/jre
ADD resources/ /
RUN chmod +x /deploy.sh
ENTRYPOINT ["/deploy.sh"]

View File

@@ -0,0 +1,28 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<outputDirectory>.</outputDirectory>
<directory>${project.basedir}/src/main/resources/ansible</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet>
<outputDirectory>.</outputDirectory>
<directory>${project.basedir}/src/main/resources/python</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
<fileSet>
<outputDirectory>.</outputDirectory>
<directory>${project.basedir}/src/main/resources/wrapper</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileSets>
</assembly>