Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Merge '1.3.0' branch into 733-pilot-integration-test
Browse files Browse the repository at this point in the history
  • Loading branch information
yasharAyari committed Nov 13, 2017
2 parents 348d4cb + bb863f4 commit 35f4df9
Show file tree
Hide file tree
Showing 53 changed files with 19,797 additions and 655 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
node_modules
coverage
app/build
47 changes: 32 additions & 15 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
def fail(reason) {
def pr_branch = ''
def get_build_info() {
pr_branch = ''
if (env.CHANGE_BRANCH != null) {
pr_branch = " (${env.CHANGE_BRANCH})"
}
slackSend color: 'danger', message: "Build #${env.BUILD_NUMBER} of <${env.BUILD_URL}|${env.JOB_NAME}>${pr_branch} failed (<${env.BUILD_URL}/console|console>, <${env.BUILD_URL}/changes|changes>)\nCause: ${reason}", channel: '#lisk-nano-jenkins'
build_info = "#${env.BUILD_NUMBER} of <${env.BUILD_URL}|${env.JOB_NAME}>${pr_branch}"
return build_info
}

def slack_send(color, message) {
/* Slack channel names are limited to 21 characters */
CHANNEL_MAX_LEN = 21
CHANNEL_SUFFIX = '-jenkins'

channel = "${env.JOB_NAME}".tokenize('/')[0]
channel_len = CHANNEL_MAX_LEN - CHANNEL_SUFFIX.size()
if ( channel.size() > channel_len ) {
channel = channel.substring(0, channel_len)
}
channel += CHANNEL_SUFFIX
echo "[slack_send] channel: ${channel} "

slackSend color: "${color}", message: "${message}", channel: "${channel}"
}

def fail(reason) {
build_info = get_build_info()
slack_send('danger', "Build ${build_info} failed (<${env.BUILD_URL}/console|console>, <${env.BUILD_URL}/changes|changes>)\nCause: ${reason}")
currentBuild.result = 'FAILURE'
error("${reason}")
}
Expand All @@ -23,7 +45,7 @@ node('lisk-nano') {

try {
sh '''
N=${EXECUTOR_NUMBER:-0}
N=${EXECUTOR_NUMBER:-0}; N=$((N+1))
cd ~/lisk-Linux-x86_64
# work around core bug: config.json gets overwritten; use backup
cp .config.json config_$N.json
Expand Down Expand Up @@ -88,8 +110,8 @@ node('lisk-nano') {

stage ('Deploy') {
try {
sh 'rsync -axl --delete --rsync-path="mkdir -p /var/www/test/lisk-nano/$BRANCH_NAME/ && rsync" $WORKSPACE/app/build/ jenkins@master-01:/var/www/test/lisk-nano/$BRANCH_NAME/'
githubNotify context: 'Jenkins test deployment', description: 'Commit was deployed to test', status: 'SUCCESS', targetUrl: "${HUDSON_URL}test/lisk-nano/${BRANCH_NAME}"
sh 'rsync -axl --delete --rsync-path="mkdir -p /var/www/test/${JOB_NAME%/*}/$BRANCH_NAME/ && rsync" $WORKSPACE/app/build/ jenkins@master-01:/var/www/test/${JOB_NAME%/*}/$BRANCH_NAME/'
githubNotify context: 'Jenkins test deployment', description: 'Commit was deployed to test', status: 'SUCCESS', targetUrl: "${HUDSON_URL}test/" + "${JOB_NAME}".tokenize('/')[0] + "/${BRANCH_NAME}"
} catch (err) {
echo "Error: ${err}"
fail('Stopping build: deploy failed')
Expand All @@ -116,7 +138,7 @@ node('lisk-nano') {
ansiColor('xterm') {
withCredentials([string(credentialsId: 'lisk-nano-testnet-passphrase', variable: 'TESTNET_PASSPHRASE')]) {
sh '''
N=${EXECUTOR_NUMBER:-0}
N=${EXECUTOR_NUMBER:-0}; N=$((N+1))
# End to End test configuration
export DISPLAY=:1$N
Expand All @@ -139,7 +161,7 @@ node('lisk-nano') {
echo "Error: ${err}"
} finally {
sh '''
N=${EXECUTOR_NUMBER:-0}
N=${EXECUTOR_NUMBER:-0}; N=$((N+1))
curl --verbose http://127.0.0.1:400$N/api/blocks/getNethash || true
( cd ~/lisk-Linux-x86_64 && bash lisk.sh stop_node -p etc/pm2-lisk_$N.json ) || true
pgrep --list-full -f "Xvfb :1$N" || true
Expand All @@ -154,19 +176,14 @@ node('lisk-nano') {
deleteDir()
}

def pr_branch = ''
if (env.CHANGE_BRANCH != null) {
pr_branch = " (${env.CHANGE_BRANCH})"
}
if (currentBuild.result == null || currentBuild.result == 'SUCCESS') {
/* delete all files on success */
deleteDir()
/* notify of success if previous build failed */
previous_build = currentBuild.getPreviousBuild()
if (previous_build != null && previous_build.result == 'FAILURE') {
slackSend color: 'good',
message: "Recovery: build #${env.BUILD_NUMBER} of <${env.BUILD_URL}|${env.JOB_NAME}>${pr_branch} was successful.",
channel: '#lisk-nano-jenkins'
build_info = get_build_info()
slack_send('good', "Recovery: build ${build_info} was successful.")
}
} else {
archiveArtifacts allowEmptyArchive: true, artifacts: 'e2e-test-screenshots/'
Expand Down
1 change: 0 additions & 1 deletion config/webpack.config.react.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable import/no-extraneous-dependencies */
const { resolve } = require('path');
const webpack = require('webpack');
const StyleLintPlugin = require('stylelint-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const I18nScannerPlugin = require('../src/i18n-scanner');
Expand Down
9 changes: 6 additions & 3 deletions i18n/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"About": "About",
"Account saved": "Account saved",
"Account was successfully forgotten.": "Account was successfully forgotten.",
"Add active account": "Add active account",
"Add vote to": "Add vote to",
"Address": "Address",
"Address copied to clipboard": "Address copied to clipboard",
Expand All @@ -19,6 +20,7 @@
"Blockchain Application Registration": "Blockchain Application Registration",
"Cancel": "Cancel",
"Click to send all funds": "Click to send all funds",
"Close": "Close",
"Confirm": "Confirm",
"Connection re-established": "Connection re-established",
"Copy": "Copy",
Expand All @@ -42,7 +44,7 @@
"Fee": "Fee",
"Fee: {{amount}} LSK": "Fee: {{amount}} LSK",
"Fee: {{fee}} LSK": "Fee: {{fee}} LSK",
"Forget this account": "Forget this account",
"Forget": "Forget",
"Forging": "Forging",
"From / To": "From / To",
"Help": "Help",
Expand Down Expand Up @@ -73,6 +75,7 @@
"Move your mouse to generate random bytes": "Move your mouse to generate random bytes",
"Multisignature Creation": "Multisignature Creation",
"Name": "Name",
"Network": "Network",
"New Account": "New Account",
"Next": "Next",
"No delegates found": "No delegates found",
Expand Down Expand Up @@ -112,16 +115,15 @@
"Register as delegate": "Register as delegate",
"Register second passphrase": "Register second passphrase",
"Reload": "Reload",
"Remember this account": "Remember this account",
"Remove vote from": "Remove vote from",
"Repeat the transaction": "Repeat the transaction",
"Report Issue...": "Report Issue...",
"Required": "Required",
"Result": "Result",
"Result copied to clipboard": "Result copied to clipboard",
"Reward": "Reward",
"Save account": "Save account",
"Save your passphrase in a safe place": "Save your passphrase in a safe place",
"Saved accounts": "Saved accounts",
"Search": "Search",
"Search by username": "Search by username",
"Second Passphrase": "Second Passphrase",
Expand All @@ -143,6 +145,7 @@
"Signing a message with this tool indicates ownership of a privateKey (secret) and provides a level of proof that you are the owner of the key. Its important to bear in mind that this is not a 100% proof as computer systems can be compromised, but is still an effective tool for proving ownership of a particular publicKey/address pair.": "Signing a message with this tool indicates ownership of a privateKey (secret) and provides a level of proof that you are the owner of the key. Its important to bear in mind that this is not a 100% proof as computer systems can be compromised, but is still an effective tool for proving ownership of a particular publicKey/address pair.",
"Submit": "Submit",
"Success": "Success",
"Switch": "Switch",
"Testnet": "Testnet",
"The URL was invalid": "The URL was invalid",
"There are no transactions, yet.": "There are no transactions, yet.",
Expand Down

0 comments on commit 35f4df9

Please sign in to comment.