Skip to content

Latest commit

 

History

History
46 lines (37 loc) · 1.02 KB

16_nodejs.md

File metadata and controls

46 lines (37 loc) · 1.02 KB

Lab 16: Node.js

pipeline {
    agent any // with hosted env use agent { label env.JOB_NAME.split('/')[0] }
    options {
        buildDiscarder(logRotator(numToKeepStr: '5'))
        timeout(time: 10, unit: 'MINUTES')
        timestamps()  // Timestamper Plugin
    }
    environment {
        NVM_HOME = tool('nvm')
    }
    stages {
        stage('Build') {
            steps {
                sh """#!/bin/bash +x
                    source \${HOME}/.nvm/nvm.sh
                    nvm install 4
                    node --version
                """
            }
        }
    }
}

Lab 16.2: Improve Node.js Lab

Add additional Node.js lab with tests and artifact archiving.

Lab 16.3: Write Custom Step

Write a custom step to move the above boilerplate code into a shared library.


End of Lab 16

OpenShift Integration →

← back to overview