Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- properties([[$class: 'jenkins.model.BuildDiscarderProperty',
- strategy: [$class: 'LogRotator', numToKeepStr: '30', artifactNumToKeepStr: '1']]])
- node('web-app-build') {
- try {
- stage('Clean workspace') {
- deleteDir()
- }
- stage('Install NodeJS and NPM') {
- def nodeHome = tool name: 'NodeJS 7.2.0', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
- env.PATH = "${nodeHome}/bin:${env.PATH}"
- }
- stage('Checkout') {
- checkout scm
- }
- stage('Install Dependencies') {
- sh "npm install --silent"
- sh "npm install -g @angular/cli@latest"
- sh "ng set --global warnings.versionMismatch=false"
- sh "npm install protractor -g"
- }
- stage('Run E2E tests') {
- sh "webdriver-manager update --versions.chrome=2.30 --gecko=false"
- sh "ng e2e"
- }
- stage('Publish Reports') {
- publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'coverage', reportFiles: 'index.html', reportName: 'HTML Report'])
- step([$class: 'JUnitResultArchiver', testResults: '**/junit/junit.xml'])
- step([
- $class: 'CloverPublisher',
- cloverReportDir: 'coverage',
- cloverReportFileName: 'clover.xml',
- healthyTarget: [methodCoverage: 70, conditionalCoverage: 80, statementCoverage: 80],
- unhealthyTarget: [methodCoverage: 50, conditionalCoverage: 50, statementCoverage: 50],
- failingTarget: [methodCoverage: 0, conditionalCoverage: 0, statementCoverage: 0]
- ])
- }
- if (env.BRANCH_NAME == 'develop') {
- stage('Create env=staging build ready for S3') {
- sh "ng build --env=staging --output-hashing=all"
- }
- stage('Deploy Build to S3 development.faberodt.com') {
- env.AWS_ACCESS_KEY_ID = 'AKIAILXMLIURVMYSBANQ'
- env.AWS_SECRET_ACCESS_KEY = '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'
- sh "npm install s3-deploy -g"
- sh "s3-deploy 'dist/**' --cwd './dist' --region 'us-west-2' --bucket 'development.faberodt.com' --cache 60 --etag"
- }
- stage('Create env=ci build ready for S3') {
- sh "ng build --env=ci --output-hashing=all"
- }
- stage('Deploy Build to S3 ci.faberodt.com') {
- env.AWS_ACCESS_KEY_ID = 'AKIAILXMLIURVMYSBANQ'
- env.AWS_SECRET_ACCESS_KEY = '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'
- sh "npm install s3-deploy -g"
- sh "s3-deploy 'dist/**' --cwd './dist' --region 'us-west-2' --bucket 'ci.faberodt.com' --cache 60 --etag"
- }
- stage('Create env=e2e build ready for S3 e2e.faber.work') {
- sh "ng build --env=e2e --output-hashing=all"
- }
- stage('Deploy Build to S3 e2e.faberodt.com') {
- env.AWS_ACCESS_KEY_ID = 'AKIAILXMLIURVMYSBANQ'
- env.AWS_SECRET_ACCESS_KEY = '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'
- sh "npm install s3-deploy -g"
- sh "s3-deploy 'dist/**' --cwd './dist' --region 'us-west-2' --bucket 'e2e.faberodt.com' --cache 60 --etag"
- }
- stage('Run "Web App e2e" Tests') {
- build job: '../Web App e2e', wait: false
- }
- }
- } catch (e) {
- throw e
- }
- }
- properties([[$class: 'jenkins.model.BuildDiscarderProperty',
- strategy: [$class: 'LogRotator', numToKeepStr: '30', artifactNumToKeepStr: '1']]])
- node('web-app-build') {
- try {
- stage('Clean workspace') {
- deleteDir()
- }
- stage('Install NodeJS and NPM') {
- def nodeHome = tool name: 'NodeJS 7.2.0', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
- env.PATH = "${nodeHome}/bin:${env.PATH}"
- }
- stage('Checkout') {
- checkout scm
- }
- stage('Install Dependencies') {
- sh "npm install --silent"
- sh "npm install -g @angular/cli@latest"
- sh "ng set --global warnings.versionMismatch=false"
- sh "npm install protractor -g"
- }
- stage('Run E2E tests') {
- sh "webdriver-manager update --versions.chrome=2.30 --gecko=false"
- sh "ng e2e"
- }
- stage('Publish Reports') {
- publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'coverage', reportFiles: 'index.html', reportName: 'HTML Report'])
- step([$class: 'JUnitResultArchiver', testResults: '**/junit/junit.xml'])
- step([
- $class: 'CloverPublisher',
- cloverReportDir: 'coverage',
- cloverReportFileName: 'clover.xml',
- healthyTarget: [methodCoverage: 70, conditionalCoverage: 80, statementCoverage: 80],
- unhealthyTarget: [methodCoverage: 50, conditionalCoverage: 50, statementCoverage: 50],
- failingTarget: [methodCoverage: 0, conditionalCoverage: 0, statementCoverage: 0]
- ])
- }
- if (env.BRANCH_NAME == 'develop') {
- stage('Create env=staging build ready for S3') {
- sh "ng build --env=staging --output-hashing=all"
- }
- stage('Deploy Build to S3 development.faberodt.com') {
- env.AWS_ACCESS_KEY_ID = 'AKIAILXMLIURVMYSBANQ'
- env.AWS_SECRET_ACCESS_KEY = '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'
- sh "npm install s3-deploy -g"
- sh "s3-deploy 'dist/**' --cwd './dist' --region 'us-west-2' --bucket 'development.faberodt.com' --cache 60 --etag"
- }
- stage('Create env=ci build ready for S3') {
- sh "ng build --env=ci --output-hashing=all"
- }
- stage('Deploy Build to S3 ci.faberodt.com') {
- env.AWS_ACCESS_KEY_ID = 'AKIAILXMLIURVMYSBANQ'
- env.AWS_SECRET_ACCESS_KEY = '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'
- sh "npm install s3-deploy -g"
- sh "s3-deploy 'dist/**' --cwd './dist' --region 'us-west-2' --bucket 'ci.faberodt.com' --cache 60 --etag"
- }
- stage('Create env=e2e build ready for S3 e2e.faber.work') {
- sh "ng build --env=e2e --output-hashing=all"
- }
- stage('Deploy Build to S3 e2e.faberodt.com') {
- env.AWS_ACCESS_KEY_ID = 'AKIAILXMLIURVMYSBANQ'
- env.AWS_SECRET_ACCESS_KEY = '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'
- sh "npm install s3-deploy -g"
- sh "s3-deploy 'dist/**' --cwd './dist' --region 'us-west-2' --bucket 'e2e.faberodt.com' --cache 60 --etag"
- }
- stage('Run "Web App e2e" Tests') {
- build job: '../Web App e2e', wait: false
- }
- }
- } catch (e) {
- throw e
- }
- }
- /*global jasmine */
- var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
- exports.config = {
- allScriptsTimeout: 11000,
- specs: [
- './e2e/**/*.e2e-spec.ts'
- ],
- capabilities: {
- 'browserName': 'chrome',
- 'chromeOptions': {
- args: ['--headless', 'no-sandbox', '--disable-gpu', '--window-size=800x600']
- }
- },
- directConnect: true,
- framework: 'jasmine',
- jasmineNodeOpts: {
- showColors: true,
- defaultTimeoutInterval: 30000,
- print: function () {
- }
- },
- useAllAngular2AppRoots: true,
- beforeLaunch: function () {
- require('ts-node').register({
- project: 'e2e'
- });
- },
- onPrepare: function () {
- jasmine.getEnv().addReporter(new SpecReporter());
- }
- };
- [15:03:50] I/file_manager - creating folder /var/jenkins/workspace/Web_App_feature_e2e-chrome-YUH5PYKKXHHXSQT3HLIZ74DQIBAH3D5D6WZCOLDVI2LYG4RGOVBQ/node_modules/protractor/node_modules/webdriver-manager/selenium
- [15:03:51] I/update - chromedriver: unzipping chromedriver_2.30.zip
- [15:03:51] I/update - chromedriver: setting permissions to 0755 for /var/jenkins/workspace/Web_App_feature_e2e-chrome-YUH5PYKKXHHXSQT3HLIZ74DQIBAH3D5D6WZCOLDVI2LYG4RGOVBQ/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.30
- [15:03:51] I/launcher - Running 1 instances of WebDriver
- [15:03:51] E/local - Error code: 135
- [15:03:51] E/local - Error message: No update-config.json found. Run 'webdriver-manager update' to download binaries.
- [15:03:51] E/local - Error: No update-config.json found. Run 'webdriver-manager update' to download binaries.
- at Local.addDefaultBinaryLocs_ (/var/jenkins/workspace/Web_App_feature_e2e-chrome-YUH5PYKKXHHXSQT3HLIZ74DQIBAH3D5D6WZCOLDVI2LYG4RGOVBQ/node_modules/protractor/lib/driverProviders/local.ts:47:15)
- at Local.setupDriverEnv (/var/jenkins/workspace/Web_App_feature_e2e-chrome-YUH5PYKKXHHXSQT3HLIZ74DQIBAH3D5D6WZCOLDVI2LYG4RGOVBQ/node_modules/protractor/lib/driverProviders/local.ts:98:10)
- at Local.setupEnv (/var/jenkins/workspace/Web_App_feature_e2e-chrome-YUH5PYKKXHHXSQT3HLIZ74DQIBAH3D5D6WZCOLDVI2LYG4RGOVBQ/node_modules/protractor/lib/driverProviders/driverProvider.ts:124:30)
- at q.then (/var/jenkins/workspace/Web_App_feature_e2e-chrome-YUH5PYKKXHHXSQT3HLIZ74DQIBAH3D5D6WZCOLDVI2LYG4RGOVBQ/node_modules/protractor/lib/runner.ts:387:39)
- at _fulfilled (/var/jenkins/workspace/Web_App_feature_e2e-chrome-YUH5PYKKXHHXSQT3HLIZ74DQIBAH3D5D6WZCOLDVI2LYG4RGOVBQ/node_modules/protractor/node_modules/q/q.js:834:54)
- at self.promiseDispatch.done (/var/jenkins/workspace/Web_App_feature_e2e-chrome-YUH5PYKKXHHXSQT3HLIZ74DQIBAH3D5D6WZCOLDVI2LYG4RGOVBQ/node_modules/protractor/node_modules/q/q.js:863:30)
- at Promise.promise.promiseDispatch (/var/jenkins/workspace/Web_App_feature_e2e-chrome-YUH5PYKKXHHXSQT3HLIZ74DQIBAH3D5D6WZCOLDVI2LYG4RGOVBQ/node_modules/protractor/node_modules/q/q.js:796:13)
- at /var/jenkins/workspace/Web_App_feature_e2e-chrome-YUH5PYKKXHHXSQT3HLIZ74DQIBAH3D5D6WZCOLDVI2LYG4RGOVBQ/node_modules/protractor/node_modules/q/q.js:857:14
- at runSingle (/var/jenkins/workspace/Web_App_feature_e2e-chrome-YUH5PYKKXHHXSQT3HLIZ74DQIBAH3D5D6WZCOLDVI2LYG4RGOVBQ/node_modules/protractor/node_modules/q/q.js:137:13)
- at flush (/var/jenkins/workspace/Web_App_feature_e2e-chrome-YUH5PYKKXHHXSQT3HLIZ74DQIBAH3D5D6WZCOLDVI2LYG4RGOVBQ/node_modules/protractor/node_modules/q/q.js:125:13)
- at _combinedTickCallback (internal/process/next_tick.js:67:7)
- at process._tickCallback (internal/process/next_tick.js:98:9)
- [15:03:51] E/launcher - Process exited with error code 135
- [Pipeline] }
- [Pipeline] // stage
- [Pipeline] }
- [Pipeline] // node
- [Pipeline] End of Pipeline
- [Bitbucket] Notifying commit build result
- [Bitbucket] Build result notified
- ERROR: script returned exit code 135
- Finished: FAILURE
- stage('Install NodeJS and NPM') {
- def nodeHome = tool name: 'NodeJS 7.2.0', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
- env.PATH = "${nodeHome}/bin:${env.PATH}"
- }
- stage('Install NodeJS and NPM') {
- def nodeHome = tool name: 'NodeJS 7.2.0', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
- env.PATH = "${nodeHome}/bin;${env.PATH}"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement