Commit bf4440ee authored by Marco Ortiz's avatar Marco Ortiz

.

parent aff54663
...@@ -5,7 +5,7 @@ pipeline { ...@@ -5,7 +5,7 @@ pipeline {
tag_name = "192.168.27.148:5000" tag_name = "192.168.27.148:5000"
credentials = "admin-docker-hub" credentials = "admin-docker-hub"
dockerImage = '' dockerImage = ''
PACKAGE_VERSION = '.' PACKAGE_VERSION = sh returnStdout: true, script: '''grep 'version' package.json | cut -d '"' -f4 | tr '\n' '\0''''
} }
agent any agent any
parameters { parameters {
...@@ -16,77 +16,67 @@ pipeline { ...@@ -16,77 +16,67 @@ pipeline {
steps { steps {
echo "Branch is ${env.BRANCH_NAME}..." echo "Branch is ${env.BRANCH_NAME}..."
nodejs(nodeJSInstallationName: 'NodeJS13', configId: '77600a18-f968-4cca-83e4-a9f76d165336') { nodejs(nodeJSInstallationName: 'NodeJS13', configId: '77600a18-f968-4cca-83e4-a9f76d165336') {
echo "Current package version: $PACKAGE_VERSION"
sh 'PACKAGE_VERSION=$(node -p -e "require(\'./package.json\').version")' sh 'PACKAGE_VERSION=$(node -p -e "require(\'./package.json\').version")'
echo "Branch1112211 is ${PACKAGE_VERSION}" sh 'npm config ls'
echo "Branch1112211 is $PACKAGE_VERSION" sh 'npm install'
// sh 'npm config ls' sh 'npm i -D typescript@3.4.3'
// sh 'npm install'
// sh 'npm i -D typescript@3.4.3'
} }
echo "Branch11111 is ${PACKAGE_VERSION}..." echo "Branch is ${PACKAGE_VERSION}..."
} }
} }
stage('Install2') { stage('Test') {
parallel {
stage('Static code analysis') {
steps {
nodejs(nodeJSInstallationName: 'NodeJS13', configId: '77600a18-f968-4cca-83e4-a9f76d165336') {
sh 'npm run-script lint'
}
}
}
}
}
stage('Build') {
steps { steps {
echo "Branch is ${PACKAGE_VERSION}..." nodejs(nodeJSInstallationName: 'NodeJS13', configId: '77600a18-f968-4cca-83e4-a9f76d165336') {
sh 'ng build'
}
} }
} }
stage('Build Docker Image') {
// stage('Test') { when {
// parallel { expression { params.include_docker == 'yes' }
// stage('Static code analysis') { }
// steps { steps {
// nodejs(nodeJSInstallationName: 'NodeJS13', configId: '77600a18-f968-4cca-83e4-a9f76d165336') { nodejs(nodeJSInstallationName: 'NodeJS13', configId: '77600a18-f968-4cca-83e4-a9f76d165336') {
// sh 'npm run-script lint' sh 'PACKAGE_VERSION=$(node -p -e "require(\'./package.json\').version")'
// } }
// } script {
// } dockerImage = docker.build imagename
// } }
// } }
// stage('Build') { }
// steps { stage('Deploy Image') {
// nodejs(nodeJSInstallationName: 'NodeJS13', configId: '77600a18-f968-4cca-83e4-a9f76d165336') { when {
// sh 'ng build' expression { params.include_docker == 'yes' }
// } }
// } steps{
// } script {
// stage('Build Docker Image') { docker.withRegistry(url, credentials ) {
// when { dockerImage.push("$PACKAGE_VERSION")
// expression { params.include_docker == 'yes' } dockerImage.push('latest')
// } }
// steps { }
// nodejs(nodeJSInstallationName: 'NodeJS13', configId: '77600a18-f968-4cca-83e4-a9f76d165336') { }
// sh 'PACKAGE_VERSION=$(node -p -e "require(\'./package.json\').version")' }
// } stage('Remove Unused docker image') {
// script { when {
// dockerImage = docker.build imagename expression { params.include_docker == 'yes' }
// } }
// } steps{
// } sh "docker rmi $tag_name/$imagename:$PACKAGE_VERSION"
// stage('Deploy Image') { sh "docker rmi $tag_name/$imagename:latest"
// when { }
// expression { params.include_docker == 'yes' } }
// }
// steps{
// script {
// docker.withRegistry(url, credentials ) {
// dockerImage.push("$PACKAGE_VERSION")
// dockerImage.push('latest')
// }
// }
// }
// }
// stage('Remove Unused docker image') {
// when {
// expression { params.include_docker == 'yes' }
// }
// steps{
// sh "docker rmi $tag_name/$imagename:$PACKAGE_VERSION"
// sh "docker rmi $tag_name/$imagename:latest"
// }
// }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment