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
59a91326
Commit
59a91326
authored
Mar 09, 2016
by
Jeff Grafton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatically determine remote upstream name.
Also add option to force Godeps verification checks on post-commit Jenkins.
parent
4242fd2e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
18 deletions
+37
-18
kubernetes-test-go.yaml
...ns/job-configs/kubernetes-jenkins/kubernetes-test-go.yaml
+1
-0
util.sh
hack/lib/util.sh
+29
-0
verify-godep-licenses.sh
hack/verify-godep-licenses.sh
+4
-9
verify-godeps.sh
hack/verify-godeps.sh
+3
-9
No files found.
hack/jenkins/job-configs/kubernetes-jenkins/kubernetes-test-go.yaml
View file @
59a91326
...
...
@@ -9,6 +9,7 @@
builders
:
-
shell
:
'
bash
<(curl
-fsS
--retry
3
"https://raw.githubusercontent.com/kubernetes/kubernetes/master/hack/jenkins/upload-started.sh")'
-
shell
:
|
export KUBE_FORCE_VERIFY_CHECKS='y'
export KUBE_VERIFY_GIT_BRANCH='{branch}'
timeout -k {kill-timeout}m {timeout}m ./hack/jenkins/gotest-dockerized.sh && rc=$? || rc=$?
{report-rc}
...
...
hack/lib/util.sh
View file @
59a91326
...
...
@@ -312,4 +312,33 @@ kube::util::gv-to-swagger-name() {
esac
}
# Returns the name of the upstream remote repository name for the local git
# repo, e.g. "upstream" or "origin".
kube::util::git_upstream_remote_name
()
{
git remote
-v
|
grep
fetch |
\
grep
-E
'github.com/kubernetes/kubernetes|k8s.io/kubernetes'
|
\
head
-n
1 |
awk
'{print $1}'
}
# Checks whether there are any files matching pattern $2 changed between the
# current branch and upstream branch named by $1.
# Returns 1 (false) if there are no changes, 0 (true) if there are changes
# detected.
kube::util::has_changes_against_upstream_branch
()
{
local
-r
git_branch
=
$1
local
-r
pattern
=
$2
readonly
full_branch
=
"
$(
kube::util::git_upstream_remote_name
)
/
${
git_branch
}
"
echo
"Checking for '
${
pattern
}
' changes against '
${
full_branch
}
'"
# make sure the branch is valid, otherwise the check will pass erroneously.
if
!
git describe
"
${
full_branch
}
"
>
/dev/null
;
then
exit
1
fi
# notice this uses ... to find the first shared ancestor
if
!
git diff
--name-only
"
${
full_branch
}
...HEAD"
|
grep
"
${
pattern
}
"
>
/dev/null
;
then
echo
"No '
${
pattern
}
' changes detected."
return
1
fi
}
# ex: ts=2 sw=2 et filetype=sh
hack/verify-godep-licenses.sh
View file @
59a91326
...
...
@@ -19,16 +19,11 @@ set -o nounset
set
-o
pipefail
KUBE_ROOT
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
}
"
)
/.."
&&
pwd
-P
)
"
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
readonly
branch
=
"origin/
${
1
:-${
KUBE_VERIFY_GIT_BRANCH
:-
master
}}
"
echo
"Checking for Godeps changes against
${
branch
}
"
# make sure the branch is valid, otherwise the next check will pass erroneously.
if
!
git describe
"
${
branch
}
"
>
/dev/null
;
then
exit
1
fi
# notice this uses ... to find the first shared ancestor
if
!
git diff
--name-only
"
${
branch
}
...HEAD"
|
grep
'Godeps/'
>
/dev/null
;
then
echo
"No Godeps changes detected."
readonly
branch
=
${
1
:-${
KUBE_VERIFY_GIT_BRANCH
:-
master
}}
if
!
[[
${
KUBE_FORCE_VERIFY_CHECKS
:-}
=
~ ^[yY]
$
]]
&&
\
!
kube::util::has_changes_against_upstream_branch
"
${
branch
}
"
'Godeps/'
;
then
exit
0
fi
...
...
hack/verify-godeps.sh
View file @
59a91326
...
...
@@ -39,15 +39,9 @@ preload-dep() {
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
readonly
branch
=
"origin/
${
1
:-${
KUBE_VERIFY_GIT_BRANCH
:-
master
}}
"
echo
"Checking for Godeps changes against
${
branch
}
"
# make sure the branch is valid, otherwise the next check will pass erroneously.
if
!
git describe
"
${
branch
}
"
>
/dev/null
;
then
exit
1
fi
# notice this uses ... to find the first shared ancestor
if
!
git diff
--name-only
"
${
branch
}
...HEAD"
|
grep
'Godeps/'
>
/dev/null
;
then
echo
"No Godeps changes detected."
readonly
branch
=
${
1
:-${
KUBE_VERIFY_GIT_BRANCH
:-
master
}}
if
!
[[
${
KUBE_FORCE_VERIFY_CHECKS
:-}
=
~ ^[yY]
$
]]
&&
\
!
kube::util::has_changes_against_upstream_branch
"
${
branch
}
"
'Godeps/'
;
then
exit
0
fi
...
...
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