mirror of
https://github.com/Sheldan/OnePlusBot.git
synced 2026-03-14 20:12:32 +00:00
[OPB-3] adding initial structure of oneplus bot with deployment and selected modules
adding volume configuration to grafana and postgres adding .env file for variables in docker compose adding handling of password for prometheus adding port configuration for more services adding custom starboard notifications updating readme and adding release job adding settings.xml for build
This commit is contained in:
36
deployment/docker-compose/pom.xml
Normal file
36
deployment/docker-compose/pom.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.deployment</groupId>
|
||||
<artifactId>deployment</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
<artifactId>docker-compose</artifactId>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>assembly-docker-compose-configuration</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/docker-compose.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,19 @@
|
||||
<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">
|
||||
<id>docker-compose</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<outputDirectory>./docker-compose</outputDirectory>
|
||||
<directory>${project.basedir}/src/main/resources/</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
<filtered>true</filtered>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
27
deployment/docker-compose/src/main/resources/.env
Normal file
27
deployment/docker-compose/src/main/resources/.env
Normal file
@@ -0,0 +1,27 @@
|
||||
# database configuration
|
||||
DATABASE_HOST=database
|
||||
DATABASE_PORT=5432
|
||||
DATABASE_USER=abstracto
|
||||
DATABASE_NAME=abstracto
|
||||
DATABASE_PASSWORD=abstracto
|
||||
# deployment configuration, whether or not the container should execute the parts on startup
|
||||
EXECUTE_DEPLOYMENT=true
|
||||
EXECUTE_LIQUIBASE=true
|
||||
EXECUTE_TEMPLATES=true
|
||||
# whether or not remote debug should be enabled on the application
|
||||
REMOTE_DEBUG=false
|
||||
DEBUG_PORT=5005
|
||||
TOMCAT_PORT=8080
|
||||
# authentication for actuator endpoints
|
||||
REST_USER_NAME=abstracto
|
||||
REST_PASSWORD=password
|
||||
# port grafana will be reachable
|
||||
GRAFANA_PORT=3000
|
||||
# port prometheus will be reachable
|
||||
PROMETHEUS_PORT=9090
|
||||
# port pg admin will be reachable
|
||||
PGADMIN_PORT=5050
|
||||
# default authentication for pg admin
|
||||
PGADMIN_DEFAULT_EMAIL=sheldan@sheldan.dev
|
||||
PGADMIN_DEFAULT_PASSWORD=admin
|
||||
TOKEN=<INSERT TOKEN>
|
||||
10
deployment/docker-compose/src/main/resources/README.md
Normal file
10
deployment/docker-compose/src/main/resources/README.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# Setup for local docker-compose deployment
|
||||
|
||||
* Install docker [here](https://docs.docker.com/get-docker/)
|
||||
* Install docker-compose [here](https://docs.docker.com/compose/install/).
|
||||
* Execute `docker-compose build` in `image-packaging`.
|
||||
* Fill out values in `.env` for token and database password. There are some default values, but token is required to be changed.
|
||||
* Execute `fill-prometheus-file-sh` in order to populate the prometheus config with the correct password (https://github.com/prometheus/prometheus/issues/2357)
|
||||
* Execute `docker-compose up` in this directory and wait for completion.
|
||||
* Per default pgAdmin is available on `localhost:5050` with the configured user and password. It will contain a configuration in the servers list.
|
||||
|
||||
105
deployment/docker-compose/src/main/resources/docker-compose.yml
Normal file
105
deployment/docker-compose/src/main/resources/docker-compose.yml
Normal file
@@ -0,0 +1,105 @@
|
||||
version: '3.7'
|
||||
|
||||
services:
|
||||
db:
|
||||
image: ${REGISTRY_PREFIX}oneplus_bot_database
|
||||
container_name: database
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
|
||||
POSTGRES_USER: ${DATABASE_USER}
|
||||
ports:
|
||||
- "${DATABASE_PORT}:5432"
|
||||
networks:
|
||||
- oneplusbot
|
||||
volumes:
|
||||
- db-data:/var/lib/postgresql/data
|
||||
deployment_container:
|
||||
container_name: deployment
|
||||
image: ${REGISTRY_PREFIX}oneplus_bot_deployment
|
||||
depends_on:
|
||||
- db
|
||||
environment:
|
||||
DB_PASS: ${DATABASE_PASSWORD}
|
||||
DB_HOST: ${DATABASE_HOST}
|
||||
DB_PORT: ${DATABASE_PORT}
|
||||
DB_USER: ${DATABASE_USER}
|
||||
DB_NAME: ${DATABASE_NAME}
|
||||
EXECUTE_DEPLOYMENT: ${EXECUTE_DEPLOYMENT}
|
||||
EXECUTE_LIQUIBASE: ${EXECUTE_LIQUIBASE}
|
||||
EXECUTE_TEMPLATES: ${EXECUTE_TEMPLATES}
|
||||
LIQUIBASE_PATH: ${LIQUIBASE_PATH:-/liquibase}
|
||||
POSTGRES_DRIVER_PATH: ${EXECUTE_DEPLOYMENT:-/postgres/driver.jar}
|
||||
WAIT_HOSTS: database:5432
|
||||
networks:
|
||||
- oneplusbot
|
||||
bot:
|
||||
image: ${REGISTRY_PREFIX}oneplus_bot
|
||||
depends_on:
|
||||
- db
|
||||
- deployment_container
|
||||
restart: on-failure
|
||||
container_name: oneplusbot
|
||||
environment:
|
||||
TOKEN: ${TOKEN}
|
||||
REMOTE_DEBUG: ${REMOTE_DEBUG}
|
||||
DB_PASS: ${DATABASE_PASSWORD}
|
||||
DB_HOST: ${DATABASE_HOST}
|
||||
DB_PORT: ${DATABASE_PORT}
|
||||
DB_USER: ${DATABASE_USER}
|
||||
DB_NAME: ${DATABASE_NAME}
|
||||
REST_USER_NAME: ${REST_USER_NAME}
|
||||
REST_PASSWORD: ${REST_PASSWORD}
|
||||
command: sh -c "while ping -c1 deployment_container &>/dev/null; do sleep 1; done; echo 'Liquibase finished!' && ./start.sh"
|
||||
ports:
|
||||
- "${DEBUG_PORT}:5005"
|
||||
- "${TOMCAT_PORT}:8080"
|
||||
networks:
|
||||
- oneplusbot
|
||||
pgadmin:
|
||||
container_name: pgadmin
|
||||
image: ${REGISTRY_PREFIX}oneplus_bot_pg_admin
|
||||
depends_on:
|
||||
- db
|
||||
environment:
|
||||
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
|
||||
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
|
||||
ports:
|
||||
- "${PGADMIN_PORT}:80"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- oneplusbot
|
||||
prometheus:
|
||||
container_name: prometheus
|
||||
image: ${REGISTRY_PREFIX}oneplus_bot_prometheus
|
||||
depends_on:
|
||||
- bot
|
||||
ports:
|
||||
- "${PROMETHEUS_PORT}:9090"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- oneplusbot
|
||||
volumes:
|
||||
- ./res/prometheus-scrapper-password-filled:/etc/prometheus/micrometer_password
|
||||
grafana:
|
||||
container_name: grafana
|
||||
image: ${REGISTRY_PREFIX}oneplus_bot_grafana
|
||||
depends_on:
|
||||
- prometheus
|
||||
- bot
|
||||
ports:
|
||||
- "${GRAFANA_PORT}:3000"
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- grafana-user-data:/var/lib/grafana
|
||||
networks:
|
||||
- oneplusbot
|
||||
|
||||
networks:
|
||||
oneplusbot:
|
||||
driver: bridge
|
||||
name: oneplusbot-network
|
||||
|
||||
volumes:
|
||||
db-data:
|
||||
grafana-user-data:
|
||||
5
deployment/docker-compose/src/main/resources/fill-prometheus-file.sh
Executable file
5
deployment/docker-compose/src/main/resources/fill-prometheus-file.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -o allexport
|
||||
source .env
|
||||
set +o allexport
|
||||
envsubst < res/prometheus-scrapper-password > res/prometheus-scrapper-password-filled
|
||||
@@ -0,0 +1 @@
|
||||
${REST_PASSWORD}
|
||||
266
deployment/image-packaging/pom.xml
Normal file
266
deployment/image-packaging/pom.xml
Normal file
@@ -0,0 +1,266 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>dev.sheldan.oneplus.bot.deployment</groupId>
|
||||
<artifactId>deployment</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>image-packaging</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<properties>
|
||||
<file.basedir>${project.basedir}/src/main/docker/</file.basedir>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
|
||||
<!-- backend jar -->
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.oneplus.bot.application</groupId>
|
||||
<artifactId>executable</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>exec</classifier>
|
||||
<type>jar</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/oneplusbot/bot</outputDirectory>
|
||||
<destFileName>app.jar</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<!-- template artefacts -->
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.templates</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<destFileName>core.zip</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.templates</groupId>
|
||||
<artifactId>entertainment</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<destFileName>entertainment.zip</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.templates</groupId>
|
||||
<artifactId>link-embed</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<destFileName>link-embed.zip</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.templates</groupId>
|
||||
<artifactId>starboard</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<destFileName>starboard.zip</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.templates</groupId>
|
||||
<artifactId>utility</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<destFileName>utility.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.modules</groupId>
|
||||
<artifactId>starboard-custom-templates</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/template-artifacts/</outputDirectory>
|
||||
<destFileName>starboard-custom.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<!-- translation artefacts -->
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.translations</groupId>
|
||||
<artifactId>utility</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<destFileName>utility.zip</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.translations</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<destFileName>core.zip</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.translations</groupId>
|
||||
<artifactId>entertainment</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<destFileName>entertainment.zip</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.translations</groupId>
|
||||
<artifactId>link-embed</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<destFileName>link-embed.zip</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.translations</groupId>
|
||||
<artifactId>starboard</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<destFileName>starboard.zip</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto-templates.translations</groupId>
|
||||
<artifactId>utility</artifactId>
|
||||
<version>${abstracto.templates.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<destFileName>utility.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.oneplus.bot.templates.translations</groupId>
|
||||
<artifactId>starboard-custom</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/translation-artifacts/</outputDirectory>
|
||||
<destFileName>starboard-custom.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<!-- liquibase artifacts -->
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto.scheduling</groupId>
|
||||
<artifactId>scheduling-impl</artifactId>
|
||||
<version>${abstracto.version}</version>
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>scheduling.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto.core</groupId>
|
||||
<artifactId>core-impl</artifactId>
|
||||
<version>${abstracto.version}</version>
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>core.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>utility-impl</artifactId>
|
||||
<version>${abstracto.version}</version>
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>utility.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>entertainment-impl</artifactId>
|
||||
<version>${abstracto.version}</version>
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>entertainment.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>link-embed-impl</artifactId>
|
||||
<version>${abstracto.version}</version>
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>link-embed.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>starboard-impl</artifactId>
|
||||
<version>${abstracto.version}</version>
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>starboard.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.abstracto.modules</groupId>
|
||||
<artifactId>utility-impl</artifactId>
|
||||
<version>${abstracto.version}</version>
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>utility.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
<artifactItem>
|
||||
<groupId>dev.sheldan.oneplus.bot.application.custom</groupId>
|
||||
<artifactId>starboard-custom</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>liquibase</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${file.basedir}/deployment/liquibase-artifacts/</outputDirectory>
|
||||
<destFileName>starboard-custom.zip</destFileName>
|
||||
</artifactItem>
|
||||
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,4 @@
|
||||
FROM postgres
|
||||
MAINTAINER Sheldan
|
||||
VOLUME /tmp
|
||||
ADD sql/init.sql /docker-entrypoint-initdb.d/init.sql
|
||||
@@ -0,0 +1 @@
|
||||
CREATE SCHEMA abstracto
|
||||
@@ -0,0 +1,6 @@
|
||||
FROM abstracto_deployment:latest
|
||||
MAINTAINER Sheldan
|
||||
ADD template-artifacts /templates
|
||||
ADD translation-artifacts /translations
|
||||
ADD liquibase-artifacts /liquibase-zips
|
||||
ADD config /
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"template_artifacts": ["utility", "core", "entertainment", "starboard", "link-embed", "starboard-custom"],
|
||||
"translation_artifacts": ["utility", "core", "entertainment", "starboard", "link-embed", "starboard-custom"],
|
||||
"liquibase_artifacts": [
|
||||
{ "zip": "scheduling", "file": "scheduling-changeLog.xml" },
|
||||
{ "zip": "core", "file": "core-changeLog.xml" },
|
||||
{ "zip": "utility", "file": "utility-changeLog.xml"},
|
||||
{ "zip": "entertainment", "file": "entertainment-changeLog.xml"},
|
||||
{ "zip": "link-embed", "file": "link-embed-changeLog.xml"},
|
||||
{ "zip": "starboard", "file": "starboard-changeLog.xml"},
|
||||
{ "zip": "starboard-custom", "file": "starboard-custom-changeLog.xml"}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
bot:
|
||||
build: oneplusbot
|
||||
image: ${REGISTRY_PREFIX}oneplus_bot:${VERSION:-latest}
|
||||
database:
|
||||
build: database
|
||||
image: ${REGISTRY_PREFIX}oneplus_bot_database:${VERSION:-latest}
|
||||
pg_admin:
|
||||
build: pgAdmin
|
||||
image: ${REGISTRY_PREFIX}oneplus_bot_pg_admin:${VERSION:-latest}
|
||||
deployment_container:
|
||||
build: deployment
|
||||
image: ${REGISTRY_PREFIX}oneplus_bot_deployment:${VERSION:-latest}
|
||||
prometheus:
|
||||
build: prometheus
|
||||
image: ${REGISTRY_PREFIX}oneplus_bot_prometheus:${VERSION:-latest}
|
||||
grafana:
|
||||
build: grafana
|
||||
image: ${REGISTRY_PREFIX}oneplus_bot_grafana:${VERSION:-latest}
|
||||
@@ -0,0 +1,5 @@
|
||||
FROM grafana/grafana
|
||||
MAINTAINER Sheldan
|
||||
ADD ./provisioning /etc/grafana/provisioning
|
||||
ADD ./config.ini /etc/grafana/config.ini
|
||||
ADD ./dashboards /var/lib/grafana/dashboards
|
||||
@@ -0,0 +1,2 @@
|
||||
[paths]
|
||||
provisioning = conf/provisioning
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
- name: 'oneplus-dashboards'
|
||||
org_id: 1
|
||||
folder: ''
|
||||
type: 'file'
|
||||
options:
|
||||
folder: '/var/lib/grafana/dashboards'
|
||||
@@ -0,0 +1,9 @@
|
||||
datasources:
|
||||
- access: 'proxy'
|
||||
editable: true
|
||||
is_default: true
|
||||
name: 'prometheus'
|
||||
org_id: 1
|
||||
type: 'prometheus'
|
||||
url: 'http://prometheus:9090'
|
||||
version: 1
|
||||
@@ -0,0 +1,8 @@
|
||||
FROM openjdk:8-jdk-alpine
|
||||
MAINTAINER Sheldan
|
||||
VOLUME /tmp
|
||||
ADD bot/app.jar /app.jar
|
||||
ADD config/* /config/
|
||||
ADD wrapper/*.sh /
|
||||
RUN chmod +x /start.sh
|
||||
CMD ["/start.sh"]
|
||||
@@ -0,0 +1,2 @@
|
||||
logging.config=config/logback.xml
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="30 seconds">
|
||||
<property name="LOG_PATH" value="logs"/>
|
||||
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>
|
||||
%d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="logFileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
|
||||
<file>${LOG_PATH}/log.log</file>
|
||||
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<Pattern>
|
||||
%d{dd-MM-yyyy HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
||||
</Pattern>
|
||||
</encoder>
|
||||
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>
|
||||
${LOG_PATH}/archived/log_%d{dd-MM-yyyy}.log
|
||||
</fileNamePattern>
|
||||
<maxHistory>10</maxHistory>
|
||||
<totalSizeCap>1GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
|
||||
</appender>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="logFileAppender"/>
|
||||
<appender-ref ref="stdout"/>
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
DEBUG_PARAMS=""
|
||||
if [ "x$REMOTE_DEBUG" = 'xtrue' ]; then
|
||||
DEBUG_PARAMS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
|
||||
echo "Starting with remote debugging on port 5005"
|
||||
fi;
|
||||
java ${DEBUG_PARAMS} -jar app.jar
|
||||
@@ -0,0 +1,4 @@
|
||||
FROM dpage/pgadmin4
|
||||
MAINTAINER Sheldan
|
||||
VOLUME /tmp
|
||||
ADD config/servers.json /pgadmin4/servers.json
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"Servers": {
|
||||
"1": {
|
||||
"Name": "OnePlusBot database",
|
||||
"Group": "Server Group 1",
|
||||
"Port": 5432,
|
||||
"Username": "abstracto",
|
||||
"Host": "db",
|
||||
"SSLMode": "prefer",
|
||||
"MaintenanceDB": "postgres"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
FROM prom/prometheus
|
||||
MAINTAINER Sheldan
|
||||
ADD prometheus.yml /etc/prometheus/prometheus.yml
|
||||
@@ -0,0 +1,17 @@
|
||||
global:
|
||||
scrape_interval: 10s
|
||||
scrape_timeout: 10s
|
||||
evaluation_interval: 1m
|
||||
scrape_configs:
|
||||
- job_name: oneplus_bot_micrometer
|
||||
honor_timestamps: true
|
||||
scrape_interval: 5s
|
||||
scrape_timeout: 5s
|
||||
metrics_path: /actuator/prometheus
|
||||
scheme: http
|
||||
static_configs:
|
||||
- targets:
|
||||
- 172.17.0.1:8080
|
||||
basic_auth:
|
||||
username: "abstracto"
|
||||
password_file: /etc/prometheus/micrometer_password
|
||||
21
deployment/pom.xml
Normal file
21
deployment/pom.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>oneplusbot</artifactId>
|
||||
<groupId>dev.sheldan.oneplus.bot</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>dev.sheldan.oneplus.bot.deployment</groupId>
|
||||
<artifactId>deployment</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>docker-compose</module>
|
||||
<module>image-packaging</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
Reference in New Issue
Block a user