добавлен package.json

This commit is contained in:
r_minaeva 2022-10-25 10:14:05 +05:00
parent 20c68d585f
commit 898749d61a
2 changed files with 58 additions and 0 deletions

52
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,52 @@
node {
checkout scm
docker_tag = 'latest'
projectname ='app'
packagejson = readJSON file: 'package.json'
docker_tag = packagejson['version']
projectname = packagejson['name']
}
pipeline {
agent any
options {
timestamps()
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')
ansiColor('xterm')
}
stages {
stage('Check') {
steps {
echo 'Checking..'
sh label: '', script: 'docker --version'
//sh "printenv | sort"
}
}
stage('Docker build') {
steps {
echo 'Docker build....'
sh label: '', script: 'docker build -f ./docker/Dockerfile --build-arg docker_registry=dhub.lex.lan:5000 -t dhub.lex.lan:5001/app/'+projectname+':'+docker_tag+' .'
}
}
stage('docker push'){
steps {
script {
docker.withRegistry('http://dhub.lex.lan:5001/', '6173afa3-27b0-4357-8b97-9d1ee071784c') {
docker.image("dhub.lex.lan:5001/app/"+projectname+":${docker_tag}").push()
}
}
}
}
stage('docker cleanup'){
steps {
sh label: '', script: 'docker rmi dhub.lex.lan:5001/app/'+projectname+':'+docker_tag
}
}
}
}

6
package.json Normal file
View File

@ -0,0 +1,6 @@
{
"name": "erp_manual",
"version": "0.0.1",
"description": "lexema erp docs"
}