Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
c0d661b3
Unverified
Commit
c0d661b3
authored
Oct 16, 2024
by
Derek Nola
Committed by
GitHub
Oct 16, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check the last 10 commits for upgrade E2E test (#11086)
Signed-off-by:
Derek Nola
<
derek.nola@suse.com
>
parent
14eee80f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
latest_commit.sh
tests/e2e/scripts/latest_commit.sh
+16
-13
No files found.
tests/e2e/scripts/latest_commit.sh
View file @
c0d661b3
#!/bin/bash
#!/bin/bash
# Grabs the last 5 commit SHA's from the given branch, then purges any commits that do not have a passing CI build
branch
=
$1
output_file
=
$2
# Grabs the last 10 commit SHA's from the given branch, then purges any commits that do not have a passing CI build
iterations
=
0
iterations
=
0
curl
-s
-H
'Accept: application/vnd.github.v3+json'
"https://api.github.com/repos/k3s-io/k3s/commits?per_page=5&sha=
$1
"
| jq
-r
'.[] | .sha'
&>
$2
commits_str
=
$(
curl
-s
-H
'Accept: application/vnd.github.v3+json'
"https://api.github.com/repos/k3s-io/k3s/commits?per_page=10&sha=
$branch
"
| jq
-j
-r
'.[] | .sha, " "'
)
# The VMs take time on startup to hit googleapis.com, wait loop until we can
read
-a
commits
<<<
"
$commits_str
"
# The VMs take time on startup to hit aws, wait loop until we can
while
!
curl
-s
--fail
https://k3s-ci-builds.s3.amazonaws.com
>
/dev/null
;
do
while
!
curl
-s
--fail
https://k3s-ci-builds.s3.amazonaws.com
>
/dev/null
;
do
((
iterations++
))
((
iterations++
))
if
[
"
$iterations
"
-ge
30
]
;
then
if
[
"
$iterations
"
-ge
30
]
;
then
...
@@ -12,15 +17,12 @@ while ! curl -s --fail https://k3s-ci-builds.s3.amazonaws.com > /dev/null; do
...
@@ -12,15 +17,12 @@ while ! curl -s --fail https://k3s-ci-builds.s3.amazonaws.com > /dev/null; do
sleep
1
sleep
1
done
done
iterations
=
0
for
commit
in
"
${
commits
[@]
}
"
;
do
curl
-s
--fail
https://k3s-ci-builds.s3.amazonaws.com/k3s-
$(
head
-n
1
$2
)
.sha256sum
if
curl
-s
--fail
https://k3s-ci-builds.s3.amazonaws.com/k3s-
$commit
.sha256sum
>
/dev/null
;
then
while
[
$?
-ne
0
]
;
do
echo
"
$commit
"
>
"
$output_file
"
((
iterations++
))
exit
0
if
[
"
$iterations
"
-ge
6
]
;
then
echo
"No valid commits found"
exit
1
fi
fi
sed
-i
1d
"
$2
"
sleep
1
curl
-s
--fail
https://k3s-ci-builds.s3.amazonaws.com/k3s-
$(
head
-n
1
$2
)
.sha256sum
done
done
echo
"Failed to find a valid commit, checked: "
"
${
commits
[@]
}
"
exit
1
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment