Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Node.js 8 - Closes #1532 #1533

Merged
merged 4 commits into from
Dec 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.15.0
8.14.0
104 changes: 55 additions & 49 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@ pipeline {
}
stage('Install npm dependencies') {
steps {
script {
// TODO: switch to 'npm ci' (npm >= 5.7.1)
// see https://blog.npmjs.org/post/171556855892/introducing-npm-ci-for-faster-more-reliable
cache_file = restoreCache("package.json")
sh 'npm install'
saveCache(cache_file, './node_modules', 10)
nvm(getNodejsVersion()) {
sh 'npm ci'
}
}
}
Expand All @@ -33,26 +29,31 @@ pipeline {
parallel (
"ESLint": {
ansiColor('xterm') {
sh '''
npm run --silent clean-build
npm run --silent copy-files
npm run --silent eslint
'''
nvm(getNodejsVersion()) {
sh '''
npm run --silent clean-build
npm run --silent copy-files
npm run --silent eslint
'''
}
}
},
"build": {
withCredentials([string(credentialsId: 'github-lisk-token', variable: 'GH_TOKEN')]) {
sh '''
npm run --silent build
npm run --silent build:testnet
npm run --silent bundlesize
nvm(getNodejsVersion()) {
sh '''
npm run --silent build
npm run --silent build:testnet
npm run --silent bundlesize

if [ -z $CHANGE_BRANCH ]; then
USE_SYSTEM_XORRISO=true npm run dist:linux
else
echo "Skipping desktop build for Linux because we're building a PR."
fi
'''
if [ -z $CHANGE_BRANCH ]; then
npm install
USE_SYSTEM_XORRISO=true npm run dist:linux
else
echo "Skipping desktop build for Linux because we're building a PR."
fi
'''
}
}
archiveArtifacts artifacts: 'app/build/'
archiveArtifacts artifacts: 'app/build-testnet/'
Expand Down Expand Up @@ -82,9 +83,11 @@ pipeline {
parallel (
"jest": {
ansiColor('xterm') {
sh 'ON_JENKINS=true npm run --silent test'
withCredentials([string(credentialsId: 'lisk-hub-coveralls-token', variable: 'COVERALLS_REPO_TOKEN')]) {
sh 'cat coverage/jest/lcov.info |coveralls -v'
nvm(getNodejsVersion()) {
sh 'ON_JENKINS=true npm run --silent test'
withCredentials([string(credentialsId: 'lisk-hub-coveralls-token', variable: 'COVERALLS_REPO_TOKEN')]) {
sh 'cat coverage/jest/lcov.info |coveralls -v'
}
}
}
},
Expand All @@ -100,17 +103,19 @@ pipeline {
withCredentials([string(credentialsId: 'lisk-hub-testnet-passphrase', variable: 'TESTNET_PASSPHRASE')]) {
ansiColor('xterm') {
wrap([$class: 'Xvfb', parallelBuild: true, autoDisplayName: true]) {
sh '''#!/bin/bash -xe
export N=${EXECUTOR_NUMBER:-0}; N=$((N+1))
nvm(getNodejsVersion()) {
sh '''#!/bin/bash -xe
export N=${EXECUTOR_NUMBER:-0}; N=$((N+1))

rm -rf $WORKSPACE/$BRANCH_NAME/
cp -rf $WORKSPACE/lisk/docker/ $WORKSPACE/$BRANCH_NAME/
cp $WORKSPACE/test/dev_blockchain.db.gz $WORKSPACE/$BRANCH_NAME/dev_blockchain.db.gz
cd $WORKSPACE/$BRANCH_NAME
cp .env.development .env
rm -rf $WORKSPACE/$BRANCH_NAME/
cp -rf $WORKSPACE/lisk/docker/ $WORKSPACE/$BRANCH_NAME/
cp $WORKSPACE/test/dev_blockchain.db.gz $WORKSPACE/$BRANCH_NAME/dev_blockchain.db.gz
cd $WORKSPACE/$BRANCH_NAME
cp .env.development .env

# random port assignment
cat <<EOF >docker-compose.override.yml
sed -i -r -e '/ports:/,+2d' docker-compose.yml
# random port assignment
cat <<EOF >docker-compose.override.yml
version: "2"
services:

Expand All @@ -120,24 +125,25 @@ services:
- \\${ENV_LISK_WS_PORT}
EOF

ENV_LISK_VERSION="$LISK_CORE_VERSION" make coldstart
export CYPRESS_baseUrl=http://127.0.0.1:300$N/#/
export CYPRESS_coreUrl=http://127.0.0.1:$( docker-compose port lisk 4000 |cut -d ":" -f 2 )
cd -
ENV_LISK_VERSION="$LISK_CORE_VERSION" make coldstart
export CYPRESS_baseUrl=http://127.0.0.1:300$N/#/
export CYPRESS_coreUrl=http://127.0.0.1:$( docker-compose port lisk 4000 |cut -d ":" -f 2 )
cd -

npm run serve -- $WORKSPACE/app/build -p 300$N -a 127.0.0.1 &>server.log &
set +e
set -o pipefail
npm run serve -- $WORKSPACE/app/build -p 300$N -a 127.0.0.1 &>server.log &
set +e
set -o pipefail

githubNotify context: 'Jenkins e2e tests',
description: 'e2e tests are running',
status: 'PENDING'
npm run cypress:run -- --record |tee cypress.log
ret=$?
grep --extended-regexp --only-matching 'https://dashboard.cypress.io/#/projects/1it63b/runs/[0-9]+' cypress.log |tail --lines=1 >.cypress_url
echo $ret >.cypress_status
exit $ret
'''
githubNotify context: 'Jenkins e2e tests',
description: 'e2e tests are running',
status: 'PENDING'
npm run cypress:run -- --record |tee cypress.log
ret=$?
grep --extended-regexp --only-matching 'https://dashboard.cypress.io/#/projects/1it63b/runs/[0-9]+' cypress.log |tail --lines=1 >.cypress_url
echo $ret >.cypress_status
exit $ret
'''
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,6 @@
},
"snyk": true,
"engines": {
"node": ">=v6.10.0 <=v6.15.0"
"node": ">=v8.14.0 <v10.0.0"
}
}