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

21
Jenkinsfile vendored
View File

@ -7,37 +7,40 @@ pipeline {
} }
environment { environment {
PROJECT_NAME = 'mylogger' PROJECT_NAME = 'mylogger'
STACK_NAME = "${env.PROJECT_NAME}-${env.BRANCH_NAME}" STACK_NAME = "${env.PROJECT_NAME}-${env.BRANCH_NAME}"
IMAGE = 'registry.verdnatura.es/mylogger'
} }
stages { stages {
stage('Checkout') { stage('Build') {
when {branch 'master'}
steps { steps {
script { script {
def packageJson = readJSON file: 'package.json' def packageJson = readJSON file: 'package.json'
env.VERSION = packageJson.version 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'} when {branch 'master'}
environment { environment {
IMAGE = 'registry.verdnatura.es/mylogger'
TAG = "${env.VERSION}"
CREDENTIALS = credentials('docker-registry') CREDENTIALS = credentials('docker-registry')
} }
steps { steps {
script {
def packageJson = readJSON file: 'package.json'
env.VERSION = packageJson.version
}
sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' 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-compose push'
sh 'docker tag $IMAGE:$TAG $IMAGE:latest'
sh 'docker push $IMAGE:latest' sh 'docker push $IMAGE:latest'
} }
} }
} }
post { post {
unsuccessful { unsuccessful {
setEnv()
sendEmail() sendEmail()
} }
} }

View File

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

View File

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

View File

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

View File

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