Skip to content

Commit ed38b0c

Browse files
authored
Update dependencies/build (#79)
* Import package-lock.json using synp * Move to using pipeline-library build for npm package. Update dependencies to mostly up to date, only 2 low severity vulnerabilities. * Bump to 1.7.2 * try to fix hangeing mocha test with newer mocha version * Tie to osx node
1 parent 5de8147 commit ed38b0c

File tree

6 files changed

+1343
-1200
lines changed

6 files changed

+1343
-1200
lines changed

.travis.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

Jenkinsfile

Lines changed: 7 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,9 @@
1-
#! groovy
1+
#!groovy
22
library 'pipeline-library'
33

4-
def nodeVersion = '8.9.1'
5-
def MAINLINE_BRANCH_REGEXP = /master|\d_\d_(X|\d)/ // a branch is considered mainline if 'master' or like: 1_7_X
6-
def isPublishable = false // used to determine if we should publish
7-
timestamps {
8-
node('osx && npm-publish') {
9-
def packageVersion = ''
10-
stage('Checkout') {
11-
// checkout scm
12-
// Hack for JENKINS-37658 - see https://support.cloudbees.com/hc/en-us/articles/226122247-How-to-Customize-Checkout-for-Pipeline-Multibranch
13-
checkout([
14-
$class: 'GitSCM',
15-
branches: scm.branches,
16-
extensions: scm.extensions + [[$class: 'CleanBeforeCheckout']],
17-
userRemoteConfigs: scm.userRemoteConfigs
18-
])
19-
20-
packageVersion = jsonParse(readFile('package.json'))['version']
21-
isPublishable = (env.BRANCH_NAME ==~ MAINLINE_BRANCH_REGEXP)
22-
currentBuild.displayName = "#${packageVersion}-${currentBuild.number}"
23-
}
24-
25-
nodejs(nodeJSInstallationName: "node ${nodeVersion}") {
26-
ansiColor('xterm') {
27-
timeout(15) {
28-
stage('Build') {
29-
// Install yarn if not installed
30-
if (sh(returnStatus: true, script: 'which yarn') != 0) {
31-
sh 'npm install -g yarn'
32-
}
33-
sh 'yarn install'
34-
try {
35-
withEnv(['TRAVIS=true', 'JUNIT_REPORT_PATH=junit_report.xml']) {
36-
sh 'yarn test'
37-
}
38-
} catch (e) {
39-
throw e
40-
} finally {
41-
junit 'junit_report.xml'
42-
}
43-
fingerprint 'package.json'
44-
// Only tag publishable branches
45-
if (isPublishable) {
46-
pushGitTag(name: packageVersion, message: "See ${env.BUILD_URL} for more information.", force: true)
47-
}
48-
} // stage
49-
} // timeout
50-
51-
stage('Security') {
52-
// Clean up and install only production dependencies
53-
sh 'yarn install --production'
54-
55-
// Scan for NSP and RetireJS warnings
56-
sh 'yarn global add nsp'
57-
sh 'nsp check --output summary --warn-only'
58-
59-
sh 'yarn global add retire'
60-
sh 'retire --exitwith 0'
61-
62-
// TODO Run node-check-updates
63-
64-
step([$class: 'WarningsPublisher', canComputeNew: false, canResolveRelativePaths: false, consoleParsers: [[parserName: 'Node Security Project Vulnerabilities'], [parserName: 'RetireJS']], defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', unHealthy: ''])
65-
} // stage
66-
67-
stage('Publish') {
68-
// only publish master and trigger downstream
69-
if (isPublishable) {
70-
sh 'npm publish'
71-
}
72-
} // stage
73-
74-
stage('JIRA') {
75-
if (isPublishable) {
76-
// update affected tickets, create and release version
77-
updateJIRA('TIMOB', "ioslib ${packageVersion}", scm)
78-
} // if
79-
} // stage(JIRA)
80-
} // ansiColor
81-
} //nodejs
82-
} // node
83-
} // timestamps
4+
buildNPMPackage {
5+
labels = 'osx && git && npm-publish'
6+
// nodeVersion = '8.9.1'
7+
projectKey = 'TIMOB'
8+
// updateJIRATickets = true
9+
}

lib/certs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ function watch(options, callback) {
272272
detect(options, function (err, results) {
273273
if (!err && (!watchResults || JSON.stringify(watchResults) !== JSON.stringify(results))) {
274274
watchResults = results;
275-
callback(null, results);
275+
return callback(null, results);
276276
}
277277
watchTimer = setTimeout(check, watchInterval);
278278
});

0 commit comments

Comments
 (0)