| | |
| | | @Library('utils')_ |
| | | pipeline { |
| | | agent { label '103' } |
| | | triggers { |
| | | GenericTrigger( |
| | | genericVariables: [ |
| | | [key: 'ref', value: '$.ref'] |
| | | ], |
| | | causeString: 'Triggered on $ref', |
| | | tokenCredentialId: '6abafc9e-1f0e-4d27-8389-7c81d69bcdb2', |
| | | printContributedVariables: true, |
| | | printPostContent: true, |
| | | silentResponse: false, |
| | | regexpFilterText: '$ref', |
| | | regexpFilterExpression: 'refs/heads/' + BRANCH_NAME |
| | | ) |
| | | } |
| | | |
| | | environment { |
| | | project_name = 'git_study' |
| | | url = 'http://47.92.145.232:8998/r/git_study.git' |
| | |
| | | options { |
| | | //给日志加上时间错, 需安装 Timestamper 插件 |
| | | timestamps() |
| | | ansiColor('xterm') |
| | | //丢弃旧的构建前两个为发布包保留天数(比此早的发布包将被删除,但构建的日志、操作历史、报告等将被保留)和构建个数 |
| | | buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '7', numToKeepStr: '10') |
| | | |
| | | } |
| | | stages { |
| | |
| | | stage('version add') { |
| | | when { |
| | | allOf { |
| | | not { |
| | | branch 'master' |
| | | } |
| | | anyOf { |
| | | changeset "**/*.js" |
| | | changeset "**/*.css" |
| | |
| | | } |
| | | } |
| | | } |
| | | // steps { |
| | | // versionAdd("${project_name}","${GIT_CREDENTIALS_ID}","${url}","${GIT_BRANCH}") |
| | | // } |
| | | steps{ |
| | | echo "todo add version" |
| | | } |
| | | |
| | | } |
| | | stage('deploy') { |
| | | when { branch 'master' } |
| | | steps { |
| | | sh 'echo test' |
| | | } |