mirror of
https://github.com/InsanusMokrassar/BooruGrabberTelegramBot.git
synced 2024-11-24 17:08:43 +00:00
final preparings to test
This commit is contained in:
parent
d33e8971eb
commit
e764358929
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,5 +10,6 @@ build/
|
|||||||
out/
|
out/
|
||||||
|
|
||||||
local.*
|
local.*
|
||||||
|
local/
|
||||||
local.*/
|
local.*/
|
||||||
secret.gradle
|
secret.gradle
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
FROM adoptopenjdk/openjdk11
|
|
||||||
|
|
||||||
USER 1000
|
|
||||||
|
|
||||||
ENTRYPOINT ["/telegram_bot/bin/telegram_bot", "/telegram_bot/local.config.json"]
|
|
||||||
|
|
||||||
ADD ./build/distributions/telegram_bot.tar /
|
|
||||||
ADD ./local.config.json /telegram_bot/
|
|
@ -17,10 +17,10 @@ ExtendedBot(id=ChatId(chatId=1234567890), username=Username(username=@username_o
|
|||||||
|
|
||||||
### Docker
|
### Docker
|
||||||
|
|
||||||
In this template there is template-like [docker-compose](docker-compose.yml) and [docker](Dockerfile) files. Besides,
|
In this template there is template-like [docker-compose](docker-compose.yml) and [docker](sample.Dockerfile) files. Besides,
|
||||||
there is [Makefile](Makefile) and you may use something like `make buildAndStartCompose` to start your bot.
|
there is [Makefile](Makefile) and you may use something like `make buildAndStartCompose` to start your bot.
|
||||||
|
|
||||||
It is important to replace `"TOKEN"` in [Dockerfile](Dockerfile) or remove and add some config as a volume.
|
It is important to replace `"TOKEN"` in [Dockerfile](sample.Dockerfile) or remove and add some config as a volume.
|
||||||
|
|
||||||
## What next?
|
## What next?
|
||||||
|
|
||||||
|
7
sample.Dockerfile
Normal file
7
sample.Dockerfile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
FROM adoptopenjdk/openjdk11
|
||||||
|
|
||||||
|
USER 1000
|
||||||
|
|
||||||
|
ENTRYPOINT ["/booru_grabber_bot/bin/booru_grabber_bot", "/booru_grabber_bot/local.config.json"]
|
||||||
|
|
||||||
|
ADD ./build/distributions/booru_grabber_bot.tar /
|
26
sample.deploy.sh
Normal file
26
sample.deploy.sh
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function send_notification() {
|
||||||
|
echo "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
function assert_success() {
|
||||||
|
"${@}"
|
||||||
|
local status=${?}
|
||||||
|
if [ ${status} -ne 0 ]; then
|
||||||
|
send_notification "### Error ${status} at: ${BASH_LINENO[*]} ###"
|
||||||
|
exit ${status}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
app=booru_grabber_bot
|
||||||
|
version=0.0.1
|
||||||
|
server=hub.docker.com
|
||||||
|
|
||||||
|
assert_success ../gradlew build
|
||||||
|
# scp ./build/distributions/AutoPostTestTelegramBot-1.0.0.zip ./config.json developer@insanusmokrassar.dev:/tmp/
|
||||||
|
assert_success sudo docker build -t $app:"$version" .
|
||||||
|
assert_success sudo docker tag $app:"$version" $server/$app:$version
|
||||||
|
assert_success sudo docker tag $app:"$version" $server/$app:latest
|
||||||
|
assert_success sudo docker push $server/$app:$version
|
||||||
|
assert_success sudo docker push $server/$app:latest
|
22
sample.docker-compose.yml
Normal file
22
sample.docker-compose.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
version: "3.4"
|
||||||
|
|
||||||
|
services:
|
||||||
|
booru_grabber_bot_postgres:
|
||||||
|
image: postgres
|
||||||
|
container_name: "booru_grabber_bot_postgres"
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: "${PG_USER}"
|
||||||
|
POSTGRES_PASSWORD: "${PG_PASSWORD}"
|
||||||
|
POSTGRES_DB: "${PG_DB}"
|
||||||
|
volumes:
|
||||||
|
- "${DATA_PATH}/db/:/var/lib/postgresql/"
|
||||||
|
booru_grabber_bot:
|
||||||
|
image: hub.docker.com/booru_grabber_bot
|
||||||
|
container_name: "booru_grabber_bot"
|
||||||
|
restart: "unless-stopped"
|
||||||
|
volumes:
|
||||||
|
- "${DATA_PATH}/config.json:/config.json"
|
||||||
|
links:
|
||||||
|
- "booru_grabber_bot_postgres:postgres"
|
||||||
|
depends_on:
|
||||||
|
- "booru_grabber_bot_postgres"
|
Loading…
Reference in New Issue
Block a user