feat(cicd): в cicd добавлен template matcher
This commit is contained in:
@@ -16,6 +16,7 @@ variables:
|
||||
PROD_TEMPLATE_GENERATOR: "parr/parr-template-generator"
|
||||
PROD_TEMPLATE_TASK_GENERATOR: "parr/parr-template-task-generator"
|
||||
PROD_JOB_AUTO_CONTROL: "parr/parr-job-auto-control"
|
||||
PROD_TEMPLATE_MATCHER: "parr/parr-template-matcher"
|
||||
|
||||
stages:
|
||||
- build
|
||||
@@ -801,3 +802,53 @@ prod_job_auto_control_deploy:
|
||||
- RUNNER: shell-api-swarm-01
|
||||
tags:
|
||||
- ${RUNNER}
|
||||
|
||||
|
||||
|
||||
### TEMPLATE MATCHER PROD ###
|
||||
prod_template_matcher_build:
|
||||
stage: build
|
||||
only:
|
||||
- /^tm[0-9]+\.[0-9]+\.[0-9]+$/
|
||||
except:
|
||||
- branches
|
||||
services:
|
||||
- name: docker:20.10.21-dind
|
||||
command: [
|
||||
"--insecure-registry=10.99.253.167:8090",
|
||||
"--registry-mirror=http://10.99.253.167:8090",
|
||||
"--insecure-registry=harbor.dvgd.rzd",
|
||||
"--tls=false"
|
||||
]
|
||||
variables:
|
||||
DOCKER_HOST: tcp://docker:2375
|
||||
DOCKER_DRIVER: overlay2
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
script:
|
||||
- APP_VERSION=$(echo $CI_COMMIT_TAG | tr -d tm)
|
||||
- IMAGE_VERSION=$(echo $CI_COMMIT_TAG | sed 's/tm/v/g')
|
||||
- docker build -t $REPO/$PROD_TEMPLATE_MATCHER:$IMAGE_VERSION -t $REPO/$PROD_TEMPLATE_MATCHER:latest -t $PROD_TEMPLATE_MATCHER:$IMAGE_VERSION -t $PROD_TEMPLATE_MATCHER:latest --build-arg app_version=$APP_VERSION -f PARR.TemplateMatcherWorker/Dockerfile .
|
||||
- docker login -u $HARBOR_PUSH_USER -p $HARBOR_PUSH_PASS $REPO
|
||||
- docker push --all-tags $REPO/$PROD_TEMPLATE_MATCHER
|
||||
tags:
|
||||
- docker
|
||||
|
||||
|
||||
prod_template_matcher_deploy:
|
||||
stage: deploy
|
||||
environment:
|
||||
name: parr-template-activator
|
||||
only:
|
||||
- /^tm[0-9]+\.[0-9]+\.[0-9]+$/
|
||||
except:
|
||||
- branches
|
||||
script:
|
||||
- IMAGE_VERSION=$(echo $CI_COMMIT_TAG | sed 's/tm/v/g')
|
||||
- docker login -u $HARBOR_PULL_USER -p $HARBOR_PULL_PASS $REPO
|
||||
- tag=$IMAGE_VERSION docker stack deploy -c docker-compose.template-matcher.yml parr-template-matcher --with-registry-auth
|
||||
parallel:
|
||||
matrix:
|
||||
- RUNNER: shell-api-swarm-01
|
||||
tags:
|
||||
- ${RUNNER}
|
||||
|
||||
|
||||
@@ -7,5 +7,8 @@
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
}
|
||||
},
|
||||
"MqSettings": {
|
||||
"HostName": "10.99.253.216"
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@
|
||||
"RepeatEvery": "00:10:00"
|
||||
},
|
||||
"MqSettings": {
|
||||
"HostName": "10.99.253.216",
|
||||
"HostName": "parr-rabbitmq",
|
||||
"QueueName": "parr-aihit-data",
|
||||
"User": "aihit_syncer",
|
||||
"Password": "afsdgDGjhfiU76496as42!@",
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using PARR.DAL.Models.Job;
|
||||
|
||||
namespace PARR.API.Contracts.V1.Responses
|
||||
namespace PARR.API.Contracts.V1.Responses
|
||||
{
|
||||
public class JobGroupBaseResponse
|
||||
{
|
||||
@@ -20,7 +18,7 @@ namespace PARR.API.Contracts.V1.Responses
|
||||
|
||||
public DateTimeOffset ReferenceDate { get; set; }
|
||||
|
||||
public JobGroupTypeResponse GroupType { get; set; }
|
||||
public required JobGroupTypeResponse GroupType { get; set; }
|
||||
|
||||
// public bool IsAutoDistributionEnabled { get; set; }
|
||||
|
||||
|
||||
@@ -46,7 +46,8 @@ namespace PARR.TemplateMatcher
|
||||
|
||||
var msg = JsonSerializer.Serialize(mqRequest);
|
||||
|
||||
var result = new MqSendResult { IsSuccess = true };//TODO await mqService.SendAsync(mqSettings.TemplateGenerator, new[] { msg });
|
||||
//var result = new MqSendResult { IsSuccess = true };
|
||||
var result = await mqService.SendAsync(mqSettings.TemplateGenerator, new[] { msg });
|
||||
|
||||
if (result.IsSuccess)
|
||||
logger.LogInformation($"Отправлен запрос на создание шаблона: {msg}");
|
||||
|
||||
28
docker-compose.template-matcher.yml
Normal file
28
docker-compose.template-matcher.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
version: '3.9'
|
||||
|
||||
#TEMPLATE MATCHER
|
||||
services:
|
||||
parr-template-matcher:
|
||||
image: harbor.dvgd.rzd/parr/parr-template-matcher:${tag:-latest}
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Production
|
||||
- TZ=Europe/Moscow
|
||||
logging:
|
||||
driver: fluentd
|
||||
options:
|
||||
fluentd-address: dvgd-efk-01.dvgd.oao.rzd:24224
|
||||
fluentd-retry-wait: '10s'
|
||||
fluentd-max-retries: '30'
|
||||
fluentd-async: 'true'
|
||||
fluentd-buffer-limit: '52428800'
|
||||
tag: parr.template-matcher.serilog
|
||||
deploy:
|
||||
replicas: 4
|
||||
networks:
|
||||
- parr-network
|
||||
|
||||
|
||||
networks:
|
||||
parr-network:
|
||||
driver: overlay
|
||||
external: true
|
||||
Reference in New Issue
Block a user