From 6a9e2046297e23a6e7633c3ca631edb997026836 Mon Sep 17 00:00:00 2001 From: Trivernis Date: Thu, 19 Dec 2019 19:12:46 +0100 Subject: [PATCH 1/6] Added jenkins build config --- Jenkinsfile | 16 ++++++++++++++++ package-lock.json | 14 +++++++------- package.json | 2 +- 3 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..d933f33 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,16 @@ +pipeline { + stage('Stylecheck') { + steps { + echo 'Checking Style...' + sh 'npm i' + sh 'npm i tslint --dev' + sh 'tslint src/**/*.ts' + } + } + stage('Build') { + steps { + echo 'Building...' + sh 'ng build --prod' + } + } +} diff --git a/package-lock.json b/package-lock.json index c537c0a..924a6ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4521,9 +4521,9 @@ } }, "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "commondir": { @@ -12844,12 +12844,12 @@ }, "dependencies": { "resolve": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", - "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.14.1.tgz", + "integrity": "sha512-fn5Wobh4cxbLzuHaE+nphztHy43/b++4M6SsGFC2gB8uYwf0C8LcarfCz1un7UTW8OFQg9iNjZ4xpcFVGebDPg==", "dev": true, "requires": { - "path-parse": "^1.0.5" + "path-parse": "^1.0.6" } } } diff --git a/package.json b/package.json index 5249fab..d16e192 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.4.0", "ts-node": "~7.0.0", - "tslint": "~5.11.0", + "tslint": "^5.11.0", "typescript": "~3.5.0" } } From 602d74eadb9ae47bcd9fa6d32582f90f9030881c Mon Sep 17 00:00:00 2001 From: Trivernis Date: Thu, 19 Dec 2019 19:15:58 +0100 Subject: [PATCH 2/6] Jenkins config - added agent information --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index d933f33..698129e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,6 @@ pipeline { + agent any + stage('Stylecheck') { steps { echo 'Checking Style...' From 02db6bd65b59b65b44504075d3b39693ca3282bc Mon Sep 17 00:00:00 2001 From: Trivernis Date: Thu, 19 Dec 2019 19:18:02 +0100 Subject: [PATCH 3/6] Jenkins config - fixed stage declaration --- Jenkinsfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 698129e..aa7e8c8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,18 +1,20 @@ pipeline { agent any - stage('Stylecheck') { + stages { + stage('Stylecheck') { steps { echo 'Checking Style...' sh 'npm i' sh 'npm i tslint --dev' sh 'tslint src/**/*.ts' } - } - stage('Build') { - steps { - echo 'Building...' - sh 'ng build --prod' + } + stage('Build') { + steps { + echo 'Building...' + sh 'ng build --prod' + } } } } From bea2e225191f10cd7ecd41ceb792c72383a7a4d2 Mon Sep 17 00:00:00 2001 From: Trivernis Date: Thu, 19 Dec 2019 19:24:39 +0100 Subject: [PATCH 4/6] Jenkins config nodejs - added nodejs plugin and config --- Jenkinsfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index aa7e8c8..4b60814 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,15 +5,19 @@ pipeline { stage('Stylecheck') { steps { echo 'Checking Style...' - sh 'npm i' - sh 'npm i tslint --dev' - sh 'tslint src/**/*.ts' + nodejs { + sh 'npm i' + sh 'npm i tslint --dev' + sh 'tslint src/**/*.ts' + } } } stage('Build') { steps { echo 'Building...' - sh 'ng build --prod' + nodejs { + sh 'ng build --prod' + } } } } From edf2fee7e0ab80ae090144913bbf5209d3eaaf8b Mon Sep 17 00:00:00 2001 From: Trivernis Date: Thu, 19 Dec 2019 19:26:21 +0100 Subject: [PATCH 5/6] Jenkins config nodejs - added nodejs version --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4b60814..925340a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,7 @@ pipeline { stage('Stylecheck') { steps { echo 'Checking Style...' - nodejs { + nodejs(nodeJSInstallationName: 'Node 12.x') { sh 'npm i' sh 'npm i tslint --dev' sh 'tslint src/**/*.ts' @@ -15,7 +15,7 @@ pipeline { stage('Build') { steps { echo 'Building...' - nodejs { + nodejs(nodeJSInstallationName: 'Node 12.x') { sh 'ng build --prod' } } From fc15558644b28b6fc29ba586a9731a1697fc97f0 Mon Sep 17 00:00:00 2001 From: Trivernis Date: Thu, 19 Dec 2019 19:31:31 +0100 Subject: [PATCH 6/6] Jenkins config ts - added typescript module to npm installation --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 925340a..5c53f8a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,8 +7,8 @@ pipeline { echo 'Checking Style...' nodejs(nodeJSInstallationName: 'Node 12.x') { sh 'npm i' - sh 'npm i tslint --dev' - sh 'tslint src/**/*.ts' + sh 'npm i typescript tslint' + sh 'tslint "src/**/*.ts"' } } } @@ -16,6 +16,7 @@ pipeline { steps { echo 'Building...' nodejs(nodeJSInstallationName: 'Node 12.x') { + sh 'npm i @angular/cli' sh 'ng build --prod' } }