fix: refs #4409 Default schema & CI code clean
gitea/mylogger/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2024-04-05 11:33:50 +02:00
parent 225e5685d3
commit 2bb99bf093
5 changed files with 16 additions and 12 deletions

19
Jenkinsfile vendored
View File

@ -8,36 +8,39 @@ pipeline {
environment {
PROJECT_NAME = 'mylogger'
STACK_NAME = "${env.PROJECT_NAME}-${env.BRANCH_NAME}"
IMAGE = 'registry.verdnatura.es/mylogger'
}
stages {
stage('Checkout') {
stage('Build') {
when {branch 'master'}
steps {
script {
def packageJson = readJSON file: 'package.json'
env.VERSION = packageJson.version
}
setEnv()
sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel'
sh 'docker tag $IMAGE:$VERSION $IMAGE:latest'
}
}
stage('Build') {
stage('Push') {
when {branch 'master'}
environment {
IMAGE = 'registry.verdnatura.es/mylogger'
TAG = "${env.VERSION}"
CREDENTIALS = credentials('docker-registry')
}
steps {
script {
def packageJson = readJSON file: 'package.json'
env.VERSION = packageJson.version
}
sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY'
sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel'
sh 'docker-compose push'
sh 'docker tag $IMAGE:$TAG $IMAGE:latest'
sh 'docker push $IMAGE:latest'
}
}
}
post {
unsuccessful {
setEnv()
sendEmail()
}
}

View File

@ -9,6 +9,7 @@ showFields:
- name
- description
- nickname
- firstName
excludeFields:
- created
- updated

View File

@ -1,7 +1,7 @@
version: '3.7'
services:
main:
image: registry.verdnatura.es/mylogger:${TAG:-latest}
image: registry.verdnatura.es/mylogger:${VERSION:-latest}
build:
context: .
dockerfile: Dockerfile

View File

@ -23,7 +23,7 @@ module.exports = class ModelLoader {
for (const logName in conf.logs) {
const logConf = conf.logs[logName];
const schema = logConf.schema || logger.conf.srcDb.database;
const schema = logConf.schema || logger.conf.dstDb.database;
const logInfo = {
name: logName,
conf: logConf,

View File

@ -1,6 +1,6 @@
{
"name": "mylogger",
"version": "1.1.3",
"version": "1.1.4",
"author": "Verdnatura Levante SL",
"description": "MySQL and MariaDB logger using binary log",
"license": "GPL-3.0",