8 Commits

8 changed files with 99 additions and 21 deletions

84
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,84 @@
pipeline {
agent any
environment {
REGISTRY = 'src.red-soft.biz'
PRODUCT_NAME = 'sample'
PRODUCT_GROUP = 'biz.redsoft.sample'
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Extract VERSION') {
steps {
script {
env.VERSION = sh(
script: '''
set -e
VERSION_FILE=src/main/resources/META-INF/ncore-product/$PRODUCT_GROUP/version.properties
VERSION=$(sed -n 's/^version=//p' "$VERSION_FILE")
if [[ ! "$VERSION" =~ ^[0-9]+(.[0-9]+)*(-[A-Za-z]+)?$ ]]; then
echo "Invalid version format: $VERSION" >&2
exit 1
fi
echo "$VERSION"
''',
returnStdout: true
).trim()
}
}
}
stage('Make gradlew executable') {
steps {
sh 'chmod +x ./gradlew'
}
}
stage('Build with Gradle') {
steps {
sh './gradlew clean'
sh './gradlew nTDC nbackup build copyDist publish dockerFile dockerUD rdbDockerFile'
}
}
stage('Build and Push Docker Images') {
steps {
script {
withCredentials([usernamePassword(credentialsId: 'build', usernameVariable: 'USER', passwordVariable: 'PASS')]) {
sh '''
echo "$PASS" | docker login --username "$USER" --password-stdin $REGISTRY
'''
def REPO_NAME = "${env.PRODUCT_GROUP.toLowerCase()}/${env.PRODUCT_NAME.toLowerCase()}"
def appImage = "${env.REGISTRY}/${REPO_NAME}:${env.VERSION}"
sh "cd build/docker && docker build -t ${appImage} ."
sh "docker push ${appImage}"
def rdbImage = "${env.REGISTRY}/${REPO_NAME}-db:${env.VERSION}"
sh "cd build/docker && docker build -t ${rdbImage} ."
sh "docker push ${rdbImage}"
def udbImage = "${env.REGISTRY}/${REPO_NAME}-update-db:${env.VERSION}"
sh "cd build/docker && docker build -t ${udbImage} ."
sh "docker push ${udbImage}"
}
}
}
}
}
post {
success {
echo "Проект ${env.PRODUCT_NAME} успешно собран на версии ${env.VERSION}"
}
failure {
echo "Проект ${env.PRODUCT_NAME} не собрался на версии ${env.VERSION}!"
}
}
}

View File

@ -14,10 +14,6 @@ java {
sourceCompatibility = project.properties.'java.version' ?: 17
}
test {
failOnNoDiscoveredTests = false
}
ncore {
coreVersion = project.properties.'biz.redsoft.ncore.version'
sourceEncoding = 'UTF-8'
@ -144,7 +140,7 @@ publishing {
}
}
def suffix = project.findProperty('biz.redsoft.release') ? 'releases' : 'snapshots'
url "https://ncore-repo.red-soft.ru/repository/${suffix}"
url "https://nexus.red-soft.ru/repository/${suffix}"
}
}
publications {

Binary file not shown.

View File

@ -1,10 +1,7 @@
dependencies {
implementation("biz.redsoft.ncore:ncore-JDK17:1.10.339.68")
updates("biz.redsoft.ncore:ncore-JDK17:1.10.339.68:updates")
codemaker("biz.redsoft.ncore:ncore-JDK17:1.10.339.68")
implementation("biz.redsoft.ncore:ncore-util-JDK17:1.10.339.68")
implementation("biz.redsoft.ncore:ncore-cryptoapisec-JDK17:1.10.339.68")
implementation("biz.redsoft.ncore:ncore-jna-JDK17:1.10.339.68")
codemaker("biz.redsoft.ncore:ncore-JDK17:1.10.339.68:gen")
testImplementation("biz.redsoft.ncore:ncore-JDK17:1.10.339.68:tests")
implementation("biz.redsoft.ncore:ncore-JDK17:1.10.339.178")
updates("biz.redsoft.ncore:ncore-JDK17:1.10.339.178:updates")
codemaker("biz.redsoft.ncore:ncore-JDK17:1.10.339.178")
codemaker("biz.redsoft.ncore:ncore-JDK17:1.10.339.178:gen")
testImplementation("biz.redsoft.ncore:ncore-JDK17:1.10.339.178:tests")
}

View File

@ -1,7 +1,7 @@
biz.redsoft.ncore.version=1.10.339.68
biz.redsoft.ncore.version=1.10.339.178
org.gradle.jvmargs=-Xmx4g -XX:+HeapDumpOnOutOfMemoryError
org.gradle.daemon=false
org.gradle.configureondemand=true
pluginVersion=4.0.18
biz.redsoft.public.repo=https://ncore-repo.red-soft.ru/repository/public
biz.redsoft.private.repo=https://ncore-repo.red-soft.ru/repository/ncorez
pluginVersion=3.1.10
biz.redsoft.public.repo=https://nexus.red-soft.ru/repository/public
biz.redsoft.private.repo=https://nexus.red-soft.ru/repository/ncore

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -1,4 +1,4 @@
{
"dependencies": [],
"register": {}
}
"dependencies" : [ ],
"register" : { }
}

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Manager pathname="" />
<CookieProcessor sameSiteCookies="strict"/>
</Context>