jenkins - Jenkins 不执行 Jenkinsfile 中的步骤
问题描述
为什么詹金斯不执行我的詹金斯文件?我构建的控制台输出是这样的:
20:06:19 Started by GitLab push by
20:06:19 Building in workspace /var/jenkins_home/workspace/repo
20:06:19 [WS-CLEANUP] Deleting project workspace...
20:06:19 [WS-CLEANUP] Done
20:06:19 Cloning the remote Git repository
20:06:19 Cloning repository
20:06:19 > git init /var/jenkins_home/workspace/ # timeout=10
20:06:19 Fetching upstream changes from https://gitlab.com/
20:06:19 > git --version # timeout=10
20:06:19 using GIT_ASKPASS to set credentials
20:06:19 > git fetch --tags --progress https://gitlab.com/t+refs/heads/*:refs/remotes/origin/*
20:06:21 > git config remote.origin.url https://gitlab.com/ # timeout=10
20:06:21 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
20:06:21 > git config remote.origin.url https://gitlab.com/ # timeout=10
20:06:21 Fetching upstream changes from https://gitlab.com/
20:06:21 using GIT_ASKPASS to set credentials
20:06:21 > git fetch --tags --progress https://gitlab.com/ +refs/heads/*:refs/remotes/origin/*
20:06:22 skipping resolution of commit remotes/origin/jenkins, since it originates from another repository
20:06:22 > git rev-parse refs/remotes/origin/jenkins^{commit} # timeout=10
20:06:22 > git rev-parse refs/remotes/origin/origin/jenkins^{commit} # timeout=10
20:06:22 Checking out Revision 44f2afa95f961b5b28a482516abf05a17180ea48 (refs/remotes/origin/jenkins)
20:06:22 > git config core.sparsecheckout # timeout=10
20:06:22 > git checkout -f 44f2afa95f961b5b28a482516abf05a17180ea48
20:06:22 Commit message: "chore: test jenkins"
20:06:22 > git rev-list --no-walk dfff4c2214daa01de600086d6d28cf8f9d53cdc5 # timeout=10
20:06:22 Finished: SUCCESS
在我的詹金斯文件中,我有这个示例管道
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
}
有什么我错过的吗?
解决方案
您需要pipeline
在点击new item
jenkins 页面后选择类型,而不是选择freestyle/maven
类型。输入名称并单击“确定”,然后选择pipeline from SCM
推荐阅读
- jquery - 在 jQuery 中,禁用 keyup 函数中的提交按钮
- node.js - 在线服务器无法识别对 Node server.js 文件的更改
- excel - 循环通过一组电子邮件地址和名称范围以根据数据透视字段发送电子邮件
- excel - 计算两个日期每季度的天数
- javascript - 使用多个按钮更新多个文本字段值
- video - FFMPEG 视频转换为 MP4 可以在除 iOS Safari/Chrome 之外的任何地方使用
- java - 如何匹配班级
- google-bigquery - 如何在 Google BigQuery 中解析电子邮件地址
- android - Flutter - 如何获取 TextField 值并将其显示为新文本
- oracle - 从 Oracle 数据库表生成 .csv 文件的最快方法是什么?