This commit is contained in:
Ruberoid 2025-07-14 14:46:53 +03:00
commit 79322cc9dc
4 changed files with 243 additions and 182 deletions

View File

@ -1,180 +1,211 @@
--- ---
kind: pipeline kind: pipeline
type: kubernetes type: kubernetes
name: Nocr name: Nocr
metadata: metadata:
namespace: musk-drone namespace: musk-drone
trigger: trigger:
branch: ref:
- main - refs/heads/main
# event: - refs/tags/*
# - tag
clone: clone:
disable: true disable: true
steps: steps:
- name: clone
image: alpine/git - name: debug
settings: image: alpine
tags: true commands:
commands: - printenv
- pwd
- git clone https://gitea.musk.fun/nocr/flea - name: clone
- cd flea image: alpine/git
- git submodule update --init --recursive settings:
tags: true
- name: nocr telegram listener build & push commands:
image: plugins/docker - pwd
privileged: true - git clone https://gitea.musk.fun/nocr/flea
settings: - cd flea
repo: hub.musk.fun/k8s/nocr/telegram_listener - git submodule update --init --recursive
registry: hub.musk.fun
context: ./flea/telegram-listener - name: kaniko nocr telegram listener build & push
dockerfile: ./flea/telegram-listener/src/Nocr.TelegramListener.Host/Dockerfile image: plugins/kaniko
tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"] settings:
username: registry: hub.musk.fun
from_secret: hub_username repo: hub.musk.fun/k8s/nocr/telegram_listener
password: tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"]
from_secret: hub_password context: ./flea/telegram-listener
depends_on: dockerfile: ./flea/telegram-listener/src/Nocr.TelegramListener.Host/Dockerfile
- clone cache: true
username:
- name: nocr telegram listener nuget package make & push from_secret: hub_username
image: mcr.microsoft.com/dotnet/sdk:8.0 password:
volumes: from_secret: hub_password
- name: dotnet-cache # build_args:
path: /app/ # - --cache=true --cache-dir=/cache
environment: volumes:
VERSION: ${DRONE_TAG} - name: local-cache
NUGETAPIKEY: path: /cache
from_secret: nuget_musk_api_key # depends_on:
commands: # - clone
- dotnet nuget add source --name musk https://gitea.musk.fun/api/packages/nocr/nuget/index.json
- dotnet pack ./flea/telegram-listener/Nocr.TelegramListener.sln -o ./flea/telegram-listener/bin - name: kaniko nocr text matcher build & push
- dotnet nuget push ./flea/telegram-listener/bin/*Contract*.nupkg --api-key $NUGETAPIKEY --source musk --skip-duplicate image: plugins/kaniko
depends_on: settings:
- nocr telegram listener build & push registry: hub.musk.fun
repo: hub.musk.fun/k8s/nocr/text_matcher
- name: nocr text matcher build & push tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"]
image: plugins/docker context: ./flea/text-matcher
privileged: true dockerfile: ./flea/text-matcher/src/Nocr.TextMatcher.Host/Dockerfile
settings: username:
repo: hub.musk.fun/k8s/nocr/text_matcher from_secret: hub_username
registry: hub.musk.fun password:
context: ./flea/text-matcher from_secret: hub_password
dockerfile: ./flea/text-matcher/src/Nocr.TextMatcher.Host/Dockerfile build_args:
tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"] - --cache=true --cache-dir=/cache
username: volumes:
from_secret: hub_username - name: local-cache
password: path: /cache
from_secret: hub_password # depends_on:
depends_on: # - clone
- clone
- name: kaniko nocr users build & push
- name: nocr text matcher nuget package make & push image: plugins/kaniko
image: mcr.microsoft.com/dotnet/sdk:8.0 settings:
volumes: registry: hub.musk.fun
- name: dotnet-cache repo: hub.musk.fun/k8s/nocr/users
path: /app/ tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"]
environment: context: ./flea/users
VERSION: ${DRONE_TAG} dockerfile: ./flea/users/src/Nocr.Users.Host/Dockerfile
NUGETAPIKEY: username:
from_secret: nuget_musk_api_key from_secret: hub_username
commands: password:
- dotnet nuget add source --name musk https://gitea.musk.fun/api/packages/nocr/nuget/index.json from_secret: hub_password
- dotnet pack ./flea/text-matcher/Nocr.TextMatcher.sln -o ./flea/text-matcher/bin build_args:
- dotnet nuget push ./flea/text-matcher/bin/*Contract*.nupkg --api-key $NUGETAPIKEY --source musk --skip-duplicate - --cache=true --cache-dir=/cache
depends_on: volumes:
- nocr text matcher build & push - name: local-cache
path: /cache
- name: nocr users build & push # depends_on:
image: plugins/docker # - clone
privileged: true
settings: - name: kaniko nocr telegram client build & push
repo: hub.musk.fun/k8s/nocr/users image: plugins/kaniko
registry: hub.musk.fun settings:
context: ./flea/users registry: hub.musk.fun
dockerfile: ./flea/users/src/Nocr.Users.Host/Dockerfile repo: hub.musk.fun/k8s/nocr/telegram_client
tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"] tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"]
username: context: ./flea/telegram-client
from_secret: hub_username dockerfile: ./flea/telegram-client/src/Nocr.TelegramClient.Host/Dockerfile
password: username:
from_secret: hub_password from_secret: hub_username
depends_on: password:
- clone from_secret: hub_password
build_args:
- name: nocr users nuget package make & push - --cache=true --cache-dir=/cache
image: mcr.microsoft.com/dotnet/sdk:8.0 volumes:
volumes: - name: local-cache
- name: dotnet-cache path: /cache
path: /app/ # depends_on:
environment: # - clone
VERSION: ${DRONE_TAG}
NUGETAPIKEY: - name: kaniko nocr text matcher migrator build & push
from_secret: nuget_musk_api_key image: plugins/kaniko
commands: settings:
- dotnet nuget add source --name musk https://gitea.musk.fun/api/packages/nocr/nuget/index.json registry: hub.musk.fun
- dotnet pack ./flea/users/Nocr.Users.sln -o ./flea/users/bin repo: hub.musk.fun/k8s/nocr/text_matcher_migrator
- dotnet nuget push ./flea/users/bin/*Contract*.nupkg --api-key $NUGETAPIKEY --source musk --skip-duplicate tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"]
depends_on: context: ./flea/text-matcher/
- nocr users build & push dockerfile: ./flea/text-matcher/src/Nocr.TextMatcher.Migrator/Dockerfile
username:
- name: nocr telegram client build & push from_secret: hub_username
image: plugins/docker password:
privileged: true from_secret: hub_password
settings: build_args:
repo: hub.musk.fun/k8s/nocr/telegram_client - --cache=true --cache-dir=/cache
registry: hub.musk.fun volumes:
context: ./flea/telegram-client - name: local-cache
dockerfile: ./flea/telegram-client/src/Nocr.TelegramClient.Host/Dockerfile path: /cache
tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"] # depends_on:
username: # - clone
from_secret: hub_username
password: - name: kaniko nocr users migrator build & push
from_secret: hub_password image: plugins/kaniko
depends_on: settings:
- clone registry: hub.musk.fun
repo: hub.musk.fun/k8s/nocr/users_migrator
- name: nocr text matcher migrator build & push tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"]
image: plugins/docker context: ./flea/users/
privileged: true dockerfile: ./flea/users/src/Nocr.Users.Migrator/Dockerfile
settings: username:
repo: hub.musk.fun/k8s/nocr/text_matcher_migrator from_secret: hub_username
registry: hub.musk.fun password:
context: ./flea/text-matcher/ from_secret: hub_password
dockerfile: ./flea/text-matcher/src/Nocr.TextMatcher.Migrator/Dockerfile build_args:
tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"] - --cache=true --cache-dir=/cache
username: volumes:
from_secret: hub_username - name: local-cache
password: path: /cache
from_secret: hub_passwordi # depends_on:
depends_on: # - kaniko nocr users build & push
- nocr text matcher build & push
- name: nocr telegram listener nuget package make & push
- name: nocr users migrator build & push image: mcr.microsoft.com/dotnet/sdk:8.0
image: plugins/docker volumes:
privileged: true - name: local-cache
settings: path: /app/
repo: hub.musk.fun/k8s/nocr/users_migrator environment:
registry: hub.musk.fun VERSION: ${DRONE_TAG}
context: ./flea/users/ NUGETAPIKEY:
dockerfile: ./flea/users/src/Nocr.Users.Migrator/Dockerfile from_secret: nuget_musk_api_key
tags: ["${DRONE_COMMIT_SHA:0:7}", "latest"] commands:
username: - dotnet nuget add source --name musk https://gitea.musk.fun/api/packages/nocr/nuget/index.json
from_secret: hub_username - dotnet pack ./flea/telegram-listener/Nocr.TelegramListener.sln -o ./flea/telegram-listener/bin
password: - dotnet nuget push ./flea/telegram-listener/bin/*Contract*.nupkg --api-key $NUGETAPIKEY --source musk --skip-duplicate
from_secret: hub_password # depends_on:
depends_on: # - kaniko nocr telegram listener build & push
- nocr users build & push
- name: nocr text matcher nuget package make & push
volumes: image: mcr.microsoft.com/dotnet/sdk:8.0
- name: dotnet-cache volumes:
claim: - name: local-cache
name: dotnet-cache-claim path: /app/
- name: kaniko-cache environment:
claim: VERSION: ${DRONE_TAG}
name: kaniko-cache-claim NUGETAPIKEY:
from_secret: nuget_musk_api_key
commands:
- dotnet nuget add source --name musk https://gitea.musk.fun/api/packages/nocr/nuget/index.json
- dotnet pack ./flea/text-matcher/Nocr.TextMatcher.sln -o ./flea/text-matcher/bin
- dotnet nuget push ./flea/text-matcher/bin/*Contract*.nupkg --api-key $NUGETAPIKEY --source musk --skip-duplicate
# depends_on:
# - kaniko nocr text matcher migrator build & push
- name: nocr users nuget package make & push
image: mcr.microsoft.com/dotnet/sdk:8.0
volumes:
- name: local-cache
path: /app/
environment:
VERSION: ${DRONE_TAG}
NUGETAPIKEY:
from_secret: nuget_musk_api_key
commands:
- dotnet nuget add source --name musk https://gitea.musk.fun/api/packages/nocr/nuget/index.json
- dotnet pack ./flea/users/Nocr.Users.sln -o ./flea/users/bin
- dotnet nuget push ./flea/users/bin/*Contract*.nupkg --api-key $NUGETAPIKEY --source musk --skip-duplicate
# depends_on:
# - kaniko nocr users build & push
volumes:
- name: nfs-cache
claim:
name: nfs-cache-claim
- name: local-cache
claim:
name: local-cache-claim

View File

@ -2,4 +2,18 @@
Аккумуляция всех вложенных проектов. Аккумуляция всех вложенных проектов.
[![Build Status](https://drone.musk.fun/api/badges/nocr/flea/status.svg?ref=refs/heads/main)](https://drone.musk.fun/nocr/flea) [telegram-listener](https://gitea.musk.fun/nocr/telegram-listener)
Модуль, отвечающий за скан открытых каналов и чатов.
[telegram-client](https://gitea.musk.fun/nocr/telegram-client)
Модуль, отвечающий за клиентский интерфейс самого бота взаимодействия с пользователем.
[users](https://gitea.musk.fun/nocr/users)
Модуль, отвечающий за управление пользователями сервиса и их предпочтениями.
[text-matcher](https://gitea.musk.fun/nocr/text-matcher)
Модуль, отвечающий за сравнивание всего объема подписанных сообщений через listener по пересечению с пользовательскими интересами.
Статус сборки drone:
[![Build Status](https://drone.musk.fun/api/badges/nocr/flea/status.svg?ref=refs/heads/main)](https://drone.musk.fun/nocr/flea)

View File

@ -79,6 +79,22 @@ spec:
mountPath: /app/.secrets mountPath: /app/.secrets
- name: rw-files - name: rw-files
mountPath: /tmp/rw-files mountPath: /tmp/rw-files
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
volumes: volumes:
- name: secrets - name: secrets
secret: secret:

@ -1 +1 @@
Subproject commit 04fff13fef788c81470d12726124d4738dedc117 Subproject commit 269826b70fdf8d1b09402eab40af60074ac74f0a