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
7732c8d8
Commit
7732c8d8
authored
Aug 31, 2017
by
Tim Hockin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Centralize godep version number
parent
7d87eec4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
11 deletions
+19
-11
godep-restore.sh
hack/godep-restore.sh
+1
-1
godep-save.sh
hack/godep-save.sh
+1
-1
util.sh
hack/lib/util.sh
+15
-7
update-all.sh
hack/update-all.sh
+1
-1
update-staging-godeps-dockerized.sh
hack/update-staging-godeps-dockerized.sh
+1
-1
No files found.
hack/godep-restore.sh
View file @
7732c8d8
...
@@ -22,7 +22,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
...
@@ -22,7 +22,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/init.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/util.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/util.sh"
kube::util::ensure_godep_version
v79
kube::util::ensure_godep_version
kube::log::status
"Starting to download all kubernetes godeps. This takes a while"
kube::log::status
"Starting to download all kubernetes godeps. This takes a while"
GOPATH
=
${
GOPATH
}
:
${
KUBE_ROOT
}
/staging godep restore
"
$@
"
GOPATH
=
${
GOPATH
}
:
${
KUBE_ROOT
}
/staging godep restore
"
$@
"
...
...
hack/godep-save.sh
View file @
7732c8d8
...
@@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
...
@@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/util.sh"
source
"
${
KUBE_ROOT
}
/hack/lib/util.sh"
kube::util::ensure_single_dir_gopath
kube::util::ensure_single_dir_gopath
kube::util::ensure_godep_version
v79
kube::util::ensure_godep_version
kube::util::ensure_no_staging_repos_in_gopath
kube::util::ensure_no_staging_repos_in_gopath
if
[
-e
"
${
KUBE_ROOT
}
/vendor"
-o
-e
"
${
KUBE_ROOT
}
/Godeps"
]
;
then
if
[
-e
"
${
KUBE_ROOT
}
/vendor"
-o
-e
"
${
KUBE_ROOT
}
/Godeps"
]
;
then
...
...
hack/lib/util.sh
View file @
7732c8d8
...
@@ -512,25 +512,33 @@ kube::util::ensure_clean_working_dir() {
...
@@ -512,25 +512,33 @@ kube::util::ensure_clean_working_dir() {
done
1>&2
done
1>&2
}
}
# Ensure that the given godep version is installed and in the path
# Ensure that the given godep version is installed and in the path. Almost
# nobody should use any version but the default.
kube::util::ensure_godep_version
()
{
kube::util::ensure_godep_version
()
{
GODEP_VERSION
=
${
1
:-
"v79"
}
GODEP_VERSION
=
${
1
:-
"v79"
}
# this version is known to work
if
[[
"
$(
godep version 2>/dev/null
)
"
==
*
"godep
${
GODEP_VERSION
}
"
*
]]
;
then
if
[[
"
$(
godep version 2>/dev/null
)
"
==
*
"godep
${
GODEP_VERSION
}
"
*
]]
;
then
return
return
fi
fi
kube::log::status
"Getting godep version
${
GODEP_VERSION
}
"
kube::util::ensure-temp-dir
kube::util::ensure-temp-dir
mkdir
-p
"
${
KUBE_TEMP
}
/go/src"
mkdir
-p
"
${
KUBE_TEMP
}
/go/src"
GOPATH
=
"
${
KUBE_TEMP
}
/go"
go get
-d
-u
github.com/tools/godep
GP
=
"
$(
echo
$GOPATH
|
cut
-f1
-d
:
)
"
pushd
"
${
KUBE_TEMP
}
/go/src/github.com/tools/godep"
>
/dev/null
rm
-rf
"
${
GP
}
/src/github.com/tools/godep"
go get
-d
-u
github.com/tools/godep
pushd
"
${
GP
}
/src/github.com/tools/godep"
>
/dev/null
git checkout
-q
"
${
GODEP_VERSION
}
"
git checkout
-q
"
${
GODEP_VERSION
}
"
GOPATH
=
"
${
KUBE_TEMP
}
/go"
go
install
.
go
install
.
popd
>
/dev/null
popd
>
/dev/null
PATH
=
"
${
KUBE_TEMP
}
/go/bin:
${
PATH
}
"
hash
-r
# force bash to clear PATH cache
hash
-r
# force bash to clear PATH cache
godep version
PATH
=
"
${
PATH
}
:
${
GP
}
/bin"
if
[[
"
$(
godep version 2>/dev/null
)
"
!=
*
"godep
${
GODEP_VERSION
}
"
*
]]
;
then
kube::log::error
"Expected godep
${
GODEP_VERSION
}
, got
$(
godep version
)
"
return
1
fi
}
}
# Ensure that none of the staging repos is checked out in the GOPATH because this
# Ensure that none of the staging repos is checked out in the GOPATH because this
...
...
hack/update-all.sh
View file @
7732c8d8
...
@@ -53,7 +53,7 @@ if ! $ALL ; then
...
@@ -53,7 +53,7 @@ if ! $ALL ; then
echo
"Running in short-circuit mode; run with -a to force all scripts to run."
echo
"Running in short-circuit mode; run with -a to force all scripts to run."
fi
fi
kube::util::ensure_godep_version
v79
kube::util::ensure_godep_version
if
!
kube::util::godep_restored 2>&1 |
sed
's/^/ /'
;
then
if
!
kube::util::godep_restored 2>&1 |
sed
's/^/ /'
;
then
echo
"Running godep restore"
echo
"Running godep restore"
...
...
hack/update-staging-godeps-dockerized.sh
View file @
7732c8d8
...
@@ -57,7 +57,7 @@ kube::golang::setup_env
...
@@ -57,7 +57,7 @@ kube::golang::setup_env
kube::util::ensure_single_dir_gopath
kube::util::ensure_single_dir_gopath
kube::util::ensure_no_staging_repos_in_gopath
kube::util::ensure_no_staging_repos_in_gopath
# Confirm we have the right godep version installed
# Confirm we have the right godep version installed
kube::util::ensure_godep_version
v79
kube::util::ensure_godep_version
# Create a fake git repo the root of the repo to prevent godeps from complaining
# Create a fake git repo the root of the repo to prevent godeps from complaining
kube::util::create-fake-git-tree
"
${
KUBE_ROOT
}
"
kube::util::create-fake-git-tree
"
${
KUBE_ROOT
}
"
...
...
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