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
68232c32
Unverified
Commit
68232c32
authored
Aug 25, 2017
by
Christoph Blecker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create kube::util::create-fake-git-tree function
parent
a235ba4e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
16 deletions
+24
-16
util.sh
hack/lib/util.sh
+17
-0
update-staging-godeps-dockerized.sh
hack/update-staging-godeps-dockerized.sh
+7
-16
No files found.
hack/lib/util.sh
View file @
68232c32
...
@@ -437,6 +437,23 @@ kube::util::git_upstream_remote_name() {
...
@@ -437,6 +437,23 @@ kube::util::git_upstream_remote_name() {
head
-n
1 |
awk
'{print $1}'
head
-n
1 |
awk
'{print $1}'
}
}
# Ensures the current directory is a git tree for doing things like restoring or
# validating godeps
kube::util::create-fake-git-tree
()
{
local
-r
target_dir
=
${
1
:-$(
pwd
)}
pushd
"
${
target_dir
}
"
>
/dev/null
git init
>
/dev/null
git config
--local
user.email
"nobody@k8s.io"
git config
--local
user.name
"
$0
"
git add
.
>
/dev/null
git commit
-q
-m
"Snapshot"
>
/dev/null
if
((
${
KUBE_VERBOSE
:-
5
}
>=
6
))
;
then
kube::log::status
"
${
target_dir
}
is now a git tree."
fi
popd
>
/dev/null
}
# Checks whether godep restore was run in the current GOPATH, i.e. that all referenced repos exist
# Checks whether godep restore was run in the current GOPATH, i.e. that all referenced repos exist
# and are checked out to the referenced rev.
# and are checked out to the referenced rev.
kube::util::godep_restored
()
{
kube::util::godep_restored
()
{
...
...
hack/update-staging-godeps-dockerized.sh
View file @
68232c32
...
@@ -50,11 +50,16 @@ while getopts ":df" opt; do
...
@@ -50,11 +50,16 @@ while getopts ":df" opt; do
esac
esac
done
done
# Confirm this is running inside a docker container, as this will modify the git tree (unsafe to run outside of container)
kube::util::ensure_dockerized
kube::util::ensure_dockerized
kube::golang::setup_env
kube::golang::setup_env
# Ensure we have a simple gopath so that we can modify it, and that no staging repos have made their way in
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
kube::util::ensure_godep_version v79
kube::util::ensure_godep_version v79
# Create a fake git repo the root of the repo to prevent godeps from complaining
kube::util::create-fake-git-tree
"
${
KUBE_ROOT
}
"
kube::log::status
"Checking whether godeps are restored"
kube::log::status
"Checking whether godeps are restored"
if
!
kube::util::godep_restored 2>&1 |
sed
's/^/ /'
;
then
if
!
kube::util::godep_restored 2>&1 |
sed
's/^/ /'
;
then
...
@@ -87,27 +92,13 @@ function diffGodepManifest() {
...
@@ -87,27 +92,13 @@ function diffGodepManifest() {
fi
fi
}
}
# Create a fake git repo for staging to prevent godeps from complaining
pushd
"
${
KUBE_ROOT
}
"
>
/dev/null
git init
>
/dev/null
git config
--local
user.email
"nobody@k8s.io"
git config
--local
user.name
"
$0
"
git add
.
>
/dev/null
git commit
-q
-m
"Snapshot"
>
/dev/null
popd
>
/dev/null
# move into staging and save the dependencies for everything in order
# move into staging and save the dependencies for everything in order
mkdir
-p
"
${
TMP_GOPATH
}
/src/k8s.io"
mkdir
-p
"
${
TMP_GOPATH
}
/src/k8s.io"
for
repo
in
$(
ls
${
KUBE_ROOT
}
/staging/src/k8s.io
)
;
do
for
repo
in
$(
ls
${
KUBE_ROOT
}
/staging/src/k8s.io
)
;
do
cp
-a
"
${
KUBE_ROOT
}
/staging/src/k8s.io/
${
repo
}
"
"
${
TMP_GOPATH
}
/src/k8s.io/"
cp
-a
"
${
KUBE_ROOT
}
/staging/src/k8s.io/
${
repo
}
"
"
${
TMP_GOPATH
}
/src/k8s.io/"
pushd
"
${
TMP_GOPATH
}
/src/k8s.io/
${
repo
}
"
>
/dev/null
# Create a fake git tree for the staging repo to prevent godeps from complaining
git init
>
/dev/null
kube::util::create-fake-git-tree
"
${
TMP_GOPATH
}
/src/k8s.io/
${
repo
}
"
git config
--local
user.email
"nobody@k8s.io"
git config
--local
user.name
"
$0
"
git add
.
>
/dev/null
git commit
-q
-m
"Snapshot"
>
/dev/null
popd
>
/dev/null
updateGodepManifest
updateGodepManifest
diffGodepManifest
diffGodepManifest
...
...
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