jenkins - 为什么没有使用 Jenkins 克隆 Bitbucket 源代码存储库?
问题描述
我在我的 Linux 机器中使用最新的 Jenkins。我正在尝试使用 Jenkins 管道克隆 Bitbucket 存储库和结帐主分支。我想要实现的是,在克隆了我的源代码之后,我可以利用它并继续构建。以下是我的代码;
node {
stage('Build') {
git branch: 'master',
credentialsId: '12345678-1234-1234-1234-123456789123',
url: 'https://username@bitbucket.org/username/test.git'
}
stage('Test') {
sh """pwd"""
}
}
下面是我的控制台输出;
Started by user User
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/lib/jenkins/workspace/test_pipeline
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] git
The recommended git tool is: NONE
using credential 12345678-1234-1234-1234-123456789123
> git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/test_pipeline/.git # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://username@bitbucket.org/username/test.git # timeout=10
Fetching upstream changes from https://username@bitbucket.org/username/test.git
> git --version # timeout=10
> git --version # 'git version 2.32.0'
using GIT_ASKPASS to set credentials bitbucket_token_1
> git fetch --tags --force --progress -- https://username@bitbucket.org/username/test.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
Checking out Revision ae8839d74d91d4ae28ba37a4ec91fa2265058b75 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f ae8839d74d91d4ae28ba37a4ec91fa2265058b75 # timeout=10
> git branch -a -v --no-abbrev # timeout=10
> git branch -D master # timeout=10
> git checkout -b master ae8839d74d91d4ae28ba37a4ec91fa2265058b75 # timeout=10
Commit message: "Initial commit"
> git rev-list --no-walk ae8839d74d91d4ae28ba37a4ec91fa2265058b75 # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Test)
[Pipeline] sh
+ pwd
/var/lib/jenkins/workspace/test_pipeline
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
当我 cd 到时,/var/lib/jenkins/workspace/test_pipeline
我什么也看不到。为什么会这样?
解决方案
推荐阅读
- vb.net - VB.NET Timer.Start() 循环无值
- algorithm - 在给定 K 个最佳候选者的情况下查找时间戳
- excel - 查找范围内三个最小值的平均值 - 意外编译错误
- database - 当以下查询或条件不返回任何行时,我想在 oracle 中返回“1”作为默认值
- matrix - Fortran 矩阵除法
- java - Servlet 到 JSP 总是传递空值
- vue.js - Vue路由器-替换路由视图时在另一个顶部呈现
- android - 在 Android 中绘制 3D 数学函数
- java - 在 Struts 2.5.14 中,我无法添加新动作,我可以添加的唯一动作是每个 struts.xml 包中的 hello
- android-layout - ExoPlayer2 可缩放视图?