pipeline {
agent {
// with hosted env use agent { label env.JOB_NAME.split('/')[0] }
docker {
image 'ruby:2.7.1'
}
}
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
timeout(time: 10, unit: 'MINUTES')
timestamps() // Timestamper Plugin
}
stages {
stage('Build') {
steps {
sh """#!/bin/bash
ruby --version
bundle --version
"""
}
}
}
}
Add additional Ruby lab with tests and artifact archiving.
Write a custom step to move the above boilerplate code into a shared library.
End of Lab 15