기본 Declarative Pipelinegroovy
pipeline {
agent any
options {
timestamps()
buildDiscarder(logRotator(numToKeepStr: "20"))
}
stages {
stage("Checkout") {
steps {
checkout scm
}
}
stage("Install") {
steps {
bat "npm.cmd ci"
}
}
stage("Test") {
steps {
bat "npm.cmd test"
}
}
stage("Build") {
steps {
bat "npm.cmd run build"
}
}
}
}Windows agent 기준 예시입니다. Linux agent라면 bat 대신 sh를 사용합니다.