Skip to content

Commit

Permalink
Bugfix/fix version number (#263)
Browse files Browse the repository at this point in the history
* Updated the version number in java project and also in the deployment Jenkinsfiles

* Changed distribution management

* Updated Jenkinsfile
  • Loading branch information
dario-rodriguez authored Jul 17, 2019
1 parent 34fe3b3 commit ff13d59
Show file tree
Hide file tree
Showing 12 changed files with 323 additions and 314 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
cd ../${REPO_CONSOLIDATE}
if [ ! -d ${REPO_DEST} ]; then git submodule add https://${GH_REPO_DEST}; else return 0; fi;
git submodule init
git submodule update
git submodule update --recursive --remote
cd ${REPO_DEST}
git checkout master
git pull
Expand Down
2 changes: 1 addition & 1 deletion java/mtsj/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.devonfw.java.mtsj</groupId>
<artifactId>mtsj</artifactId>
<version>3.2.0-SNAPSHOT</version>
<version>3.1.0</version>
</parent>
<artifactId>mtsj-api</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion java/mtsj/batch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.devonfw.java.mtsj</groupId>
<artifactId>mtsj</artifactId>
<version>3.2.0-SNAPSHOT</version>
<version>3.1.0</version>
</parent>
<artifactId>mtsj-batch</artifactId>
<packaging>jar</packaging>
Expand Down
6 changes: 3 additions & 3 deletions java/mtsj/core/pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.devonfw.java.mtsj</groupId>
<artifactId>mtsj</artifactId>
<version>3.2.0-SNAPSHOT</version>
<version>3.1.0</version>
</parent>
<artifactId>mtsj-core</artifactId>
<packaging>jar</packaging>
Expand Down Expand Up @@ -150,7 +150,7 @@
<artifactId>${mts.database.artifactId}</artifactId>
<version>${mts.database.version}</version>
</dependency>
<dependency><!-- Need for SAP Hana-->
<dependency> <!-- Need for SAP Hana-->
<groupId>com.sap.cloud.db.jdbc</groupId>
<artifactId>ngdbc</artifactId>
<version>2.3.48</version>
Expand Down
10 changes: 5 additions & 5 deletions java/mtsj/pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>mtsj</artifactId>
<groupId>com.devonfw.java.mtsj</groupId>
<version>3.2.0-SNAPSHOT</version>
<version>3.1.0</version>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
<description>Application based on the Devonfw framework for Java (devon4j).</description>
Expand Down Expand Up @@ -153,8 +153,8 @@
<version>2.22.0</version>
<configuration>
<excludedGroups>${devon.test.excluded.groups}</excludedGroups>
<forkCount>0</forkCount>
<reuseForks>true</reuseForks>
<forkCount>0</forkCount>
<reuseForks>true</reuseForks>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -223,7 +223,7 @@
<repository>
<id>pl-nexus</id>
<name>PL Releases</name>
<url>http://nexus3-core:8081/nexus/content/repositories/maven-releases/</url>
<url>http://nexus3-core:8081/nexus3/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>pl-nexus</id>
Expand Down
2 changes: 1 addition & 1 deletion java/mtsj/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.devonfw.java.mtsj</groupId>
<artifactId>mtsj</artifactId>
<version>3.2.0-SNAPSHOT</version>
<version>3.1.0</version>
</parent>
<artifactId>mtsj-server</artifactId>
<packaging>war</packaging>
Expand Down
282 changes: 141 additions & 141 deletions jenkins/angular/cicd/Jenkinsfile
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()
}
}
}
Loading

0 comments on commit ff13d59

Please sign in to comment.