我已经设置了 Jenkins 来管理四个项目的自动部署。但似乎在每构建一个月后,工件就会被自动删除。如何停止进程?我使用 Git 作为 SCM。
这是其中一个项目的 Jenkins 配置:
用于 GITScm 轮询的 GitHub 挂钩触发器 - 已检查
管道 > 定义 > SCM - GIT
管道 > 定义 > SCM > 存储库 > 存储库 URL - git@github.com:ABCD
Pipeline > Definition > SCM > Repositories > Credentials - Credentials
Pipeline > Definition > SCM > Branches to build > Branch Specifier (blank for 'any') - BRANCH_NAME
管道 > 定义 > SCM > 存储库浏览器 - 自动
管道 > 定义 > 脚本路径 - Jenkinsfile
管道 > 定义 > 轻量级结帐 - 已检查
和Jenkinsfile配置:
#!/usr/bin/env groovy
pipeline {
agent any
stages {
stage('preflight') {
steps {
sh 'node -v'
}
}
stage('build') {
steps {
sh 'npm --version'
sh 'npm install'
sh 'ng build --prod'
}
}
}
}