-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated the version number in java project and also in the deployment Jenkinsfiles * Changed distribution management * Updated Jenkinsfile
- Loading branch information
1 parent
34fe3b3
commit ff13d59
Showing
12 changed files
with
323 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,141 +1,141 @@ | ||
pipeline{ | ||
agent any | ||
|
||
options { | ||
buildDiscarder(logRotator(artifactDaysToKeepStr: '1', artifactNumToKeepStr: '1', daysToKeepStr: '5', numToKeepStr: '50')) | ||
// Disable concurrent builds. It will wait until the pipeline finish before start a new one | ||
disableConcurrentBuilds() | ||
} | ||
|
||
tools { | ||
nodejs "NodeJS 10.14.0" | ||
} | ||
|
||
environment { | ||
// Script for build the application. Defined at package.json | ||
buildScript = 'build --configuration=docker' | ||
// Script for lint the application. Defined at package.json | ||
lintScript = 'lint' | ||
// Script for test the application. Defined at package.json | ||
testScript = 'test:ci' | ||
// Angular directory | ||
angularDir = 'angular' | ||
// SRC folder. It will be angularDir/srcDir | ||
srcDir = 'src' | ||
// Name of the custom tool for chrome stable | ||
chrome = 'Chrome-stable' | ||
|
||
// sonarQube | ||
// Name of the sonarQube tool | ||
sonarTool = 'SonarQube' | ||
// Name of the sonarQube environment | ||
sonarEnv = "SonarQube" | ||
|
||
// Nexus | ||
// Artifact groupId | ||
groupId = 'com.devonfw.mythaistar' | ||
// Nexus repository ID | ||
repositoryId = 'pl-nexus' | ||
// Nexus internal URL | ||
repositoryUrl = 'http://nexus3-core:8081/nexus3/repository/maven-snapshots' | ||
// Maven global settings configuration ID | ||
globalSettingsId = 'MavenSettings' | ||
// Maven tool id | ||
mavenInstallation = 'Maven3' | ||
} | ||
|
||
stages { | ||
stage ('Loading Custom Tools') { | ||
steps { | ||
tool chrome | ||
} | ||
} | ||
|
||
stage ('Fresh Dependency Installation') { | ||
steps { | ||
dir(angularDir){ | ||
sh "yarn" | ||
} | ||
} | ||
} | ||
|
||
stage ('Code Linting') { | ||
steps { | ||
dir(angularDir) { | ||
sh """yarn ${lintScript}""" | ||
} | ||
} | ||
} | ||
|
||
stage ('Execute Angular tests') { | ||
steps { | ||
dir(angularDir) { | ||
sh """yarn ${testScript}""" | ||
} | ||
} | ||
} | ||
|
||
stage ('SonarQube code analysis') { | ||
steps { | ||
script { | ||
dir(angularDir) { | ||
def scannerHome = tool sonarTool | ||
def props = readJSON file: 'package.json' | ||
withSonarQubeEnv(sonarEnv) { | ||
sh """ | ||
${scannerHome}/bin/sonar-scanner \ | ||
-Dsonar.projectKey=${props.name} \ | ||
-Dsonar.projectName=${props.name} \ | ||
-Dsonar.projectVersion=${props.version} \ | ||
-Dsonar.sources=${srcDir} | ||
""" | ||
} | ||
timeout(time: 1, unit: 'HOURS') { | ||
def qg = waitForQualityGate() | ||
if (qg.status != 'OK') { | ||
error "Pipeline aborted due to quality gate failure: ${qg.status}" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
stage ('Build Application') { | ||
steps { | ||
dir(angularDir) { | ||
sh """yarn ${buildScript}""" | ||
} | ||
} | ||
} | ||
|
||
stage ('Deliver application into Nexus') { | ||
steps { | ||
script { | ||
dir(angularDir) { | ||
def props = readJSON file: 'package.json' | ||
zip dir: 'dist/', zipFile: """${props.name}.zip""" | ||
withMaven(globalMavenSettingsConfig: globalSettingsId, maven: mavenInstallation) { | ||
sh """ | ||
mvn deploy:deploy-file \ | ||
-DgroupId=${groupId} \ | ||
-DartifactId=${props.name} \ | ||
-Dversion=${props.version}-SNAPSHOT \ | ||
-Dpackaging=zip \ | ||
-Dfile=${props.name}.zip \ | ||
-DrepositoryId=${repositoryId} \ | ||
-Durl=${repositoryUrl} | ||
""" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
post { | ||
always { | ||
cleanWs() | ||
} | ||
} | ||
} | ||
pipeline{ | ||
agent any | ||
|
||
options { | ||
buildDiscarder(logRotator(artifactDaysToKeepStr: '1', artifactNumToKeepStr: '1', daysToKeepStr: '5', numToKeepStr: '50')) | ||
// Disable concurrent builds. It will wait until the pipeline finish before start a new one | ||
disableConcurrentBuilds() | ||
} | ||
|
||
tools { | ||
nodejs "NodeJS 10.14.0" | ||
} | ||
|
||
environment { | ||
// Script for build the application. Defined at package.json | ||
buildScript = 'build --configuration=docker' | ||
// Script for lint the application. Defined at package.json | ||
lintScript = 'lint' | ||
// Script for test the application. Defined at package.json | ||
testScript = 'test:ci' | ||
// Angular directory | ||
angularDir = 'angular' | ||
// SRC folder. It will be angularDir/srcDir | ||
srcDir = 'src' | ||
// Name of the custom tool for chrome stable | ||
chrome = 'Chrome-stable' | ||
|
||
// sonarQube | ||
// Name of the sonarQube tool | ||
sonarTool = 'SonarQube' | ||
// Name of the sonarQube environment | ||
sonarEnv = "SonarQube" | ||
|
||
// Nexus | ||
// Artifact groupId | ||
groupId = 'com.devonfw.mythaistar' | ||
// Nexus repository ID | ||
repositoryId = 'pl-nexus' | ||
// Nexus internal URL | ||
repositoryUrl = 'http://nexus3-core:8081/nexus3/repository/maven-releases' | ||
// Maven global settings configuration ID | ||
globalSettingsId = 'MavenSettings' | ||
// Maven tool id | ||
mavenInstallation = 'Maven3' | ||
} | ||
|
||
stages { | ||
stage ('Loading Custom Tools') { | ||
steps { | ||
tool chrome | ||
} | ||
} | ||
|
||
stage ('Fresh Dependency Installation') { | ||
steps { | ||
dir(angularDir){ | ||
sh "yarn" | ||
} | ||
} | ||
} | ||
|
||
stage ('Code Linting') { | ||
steps { | ||
dir(angularDir) { | ||
sh """yarn ${lintScript}""" | ||
} | ||
} | ||
} | ||
|
||
stage ('Execute Angular tests') { | ||
steps { | ||
dir(angularDir) { | ||
sh """yarn ${testScript}""" | ||
} | ||
} | ||
} | ||
|
||
stage ('SonarQube code analysis') { | ||
steps { | ||
script { | ||
dir(angularDir) { | ||
def scannerHome = tool sonarTool | ||
def props = readJSON file: 'package.json' | ||
withSonarQubeEnv(sonarEnv) { | ||
sh """ | ||
${scannerHome}/bin/sonar-scanner \ | ||
-Dsonar.projectKey=${props.name} \ | ||
-Dsonar.projectName=${props.name} \ | ||
-Dsonar.projectVersion=${props.version} \ | ||
-Dsonar.sources=${srcDir} | ||
""" | ||
} | ||
timeout(time: 1, unit: 'HOURS') { | ||
def qg = waitForQualityGate() | ||
if (qg.status != 'OK') { | ||
error "Pipeline aborted due to quality gate failure: ${qg.status}" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
stage ('Build Application') { | ||
steps { | ||
dir(angularDir) { | ||
sh """yarn ${buildScript}""" | ||
} | ||
} | ||
} | ||
|
||
stage ('Deliver application into Nexus') { | ||
steps { | ||
script { | ||
dir(angularDir) { | ||
def props = readJSON file: 'package.json' | ||
zip dir: 'dist/', zipFile: """${props.name}.zip""" | ||
withMaven(globalMavenSettingsConfig: globalSettingsId, maven: mavenInstallation) { | ||
sh """ | ||
mvn deploy:deploy-file \ | ||
-DgroupId=${groupId} \ | ||
-DartifactId=${props.name} \ | ||
-Dversion=${props.version} \ | ||
-Dpackaging=zip \ | ||
-Dfile=${props.name}.zip \ | ||
-DrepositoryId=${repositoryId} \ | ||
-Durl=${repositoryUrl} | ||
""" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
post { | ||
always { | ||
cleanWs() | ||
} | ||
} | ||
} |
Oops, something went wrong.