Skip to content

Commit 244be8f

Browse files
Attempt 7
1 parent a204468 commit 244be8f

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

Jenkinsfile

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,25 @@ def CheckNightlyTag(githubToken, repoOwner, repoName, expectedHash)
3030
def attempt = 0
3131

3232
while (attempt < maxAttempts) {
33-
def tagHash = bash("""
34-
curl -s \\
35-
-H "Authorization: Bearer ${githubToken}" \\
36-
"https://api.github.com/repos/${repoOwner}/${repoName}/git/refs/tags/nightly" |
37-
jq -r '.object.sha'
33+
// Fetch all tags from the remote repository
34+
bash """
35+
git fetch --tags origin
36+
"""
37+
38+
// Check if the nightly tag exists and points to the expected commit
39+
def tagExists = bash("""
40+
if git rev-parse --verify nightly > /dev/null 2>&1; then
41+
echo "true"
42+
else
43+
echo "false"
44+
fi
3845
""", true).trim()
3946

40-
if (tagHash == expectedHash) {
41-
return true
47+
if (tagExists == "true") {
48+
def tagHash = bash("git rev-parse nightly", true).trim()
49+
if (tagHash == expectedHash) {
50+
return true
51+
}
4252
}
4353

4454
sleep 10
@@ -277,7 +287,7 @@ pipeline
277287

278288
//NOTE: We use Debug builds for now even for release.
279289
}
280-
290+
/*
281291
stage('Test')
282292
{
283293
parallel
@@ -394,7 +404,7 @@ pipeline
394404
}
395405
}
396406
}
397-
407+
*/
398408
stage('GitHub Operations')
399409
{
400410
agent { label 'linux' }

0 commit comments

Comments
 (0)