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
812e5201
Commit
812e5201
authored
Jan 31, 2017
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client-go: add staging/copy.sh testing
parent
880cbd5d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
13 deletions
+71
-13
verify-staging-client-go.sh
hack/verify-staging-client-go.sh
+54
-3
copy.sh
staging/copy.sh
+17
-10
No files found.
hack/verify-staging-client-go.sh
View file @
812e5201
...
@@ -18,8 +18,59 @@ set -o errexit
...
@@ -18,8 +18,59 @@ set -o errexit
set
-o
nounset
set
-o
nounset
set
-o
pipefail
set
-o
pipefail
go build ./staging/src/k8s.io/client-go/examples/...
V
=
""
while
getopts
":v"
opt
;
do
case
$opt
in
v
)
# increase verbosity
V
=
"-v"
;;
\?
)
echo
"Invalid option: -
$OPTARG
"
>
&2
;;
esac
done
readonly
V
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
# TODO: reenable copy.sh when test can cope with circular dependencies
cd
${
KUBE_ROOT
}
# "${KUBE_ROOT}"/staging/copy.sh -v
# Smoke test client-go examples
go
install
./staging/src/k8s.io/client-go/examples/...
# Create a temporary GOPATH for apimachinery and client-go, copy the current HEAD into each and turn them
# into a git repo. Then we can run copy.sh with this additional GOPATH. The Godeps.json will
# have invalid git SHA1s, but it's good enough as a smoke test of copy.sh.
if
[
"
${
USE_TEMP_DIR
:-
1
}
"
=
1
]
;
then
TEMP_STAGING_GOPATH
=
$(
mktemp
-d
-t
verify-staging-client-go.XXXXX
)
echo
"Creating the temporary staging GOPATH directory:
${
TEMP_STAGING_GOPATH
}
"
cleanup
()
{
if
[
"
${
KEEP_TEMP_DIR
:-
0
}
"
!=
1
]
;
then
rm
-rf
"
${
TEMP_STAGING_GOPATH
}
"
fi
}
trap
cleanup EXIT SIGINT
mkdir
-p
"
${
TEMP_STAGING_GOPATH
}
/src/k8s.io"
ln
-s
"
${
PWD
}
"
"
${
TEMP_STAGING_GOPATH
}
/src/k8s.io"
else
TEMP_STAGING_GOPATH
=
"
${
GOPATH
}
"
fi
for
PACKAGE
in
apimachinery client-go
;
do
PACKAGE_PATH
=
"
${
TEMP_STAGING_GOPATH
}
/src/k8s.io/
${
PACKAGE
}
"
echo
"Creating a temporary
${
PACKAGE
}
repo with a snapshot of HEAD"
mkdir
-p
"
${
PACKAGE_PATH
}
"
rsync
-ax
--delete
staging/src/k8s.io/
${
PACKAGE
}
/
"
${
PACKAGE_PATH
}
/"
pushd
"
${
PACKAGE_PATH
}
"
>
/dev/null
git init
>
/dev/null
git add
*
git
-c
user.email
=
"nobody@k8s.io"
-c
user.name
=
"verify-staging-client-go.sh"
commit
-q
-m
"Snapshot"
popd
>
/dev/null
done
echo
"Running godep restore"
pushd
"
${
TEMP_STAGING_GOPATH
}
/src/k8s.io/kubernetes"
>
/dev/null
export
GOPATH
=
"
${
TEMP_STAGING_GOPATH
}
"
godep restore
${
V
}
2>&1 |
sed
's/^/ /'
echo
"Testing staging/copy.sh"
staging/copy.sh
-d
2>&1 |
sed
's/^/ /'
popd
staging/copy.sh
View file @
812e5201
...
@@ -18,18 +18,22 @@ set -o errexit
...
@@ -18,18 +18,22 @@ set -o errexit
set
-o
nounset
set
-o
nounset
set
-o
pipefail
set
-o
pipefail
VERIFYONLY
=
false
FAIL_ON_CHANGES
=
false
while
getopts
":v"
opt
;
do
DRY_RUN
=
false
while
getopts
":fd"
opt
;
do
case
$opt
in
case
$opt
in
v
)
f
)
VERIFYONLY
=
true
FAIL_ON_CHANGES
=
true
;;
d
)
DRY_RUN
=
true
;;
;;
\?
)
\?
)
echo
"Invalid option: -
$OPTARG
"
>
&2
echo
"Invalid option: -
$OPTARG
"
>
&2
;;
;;
esac
esac
done
done
readonly
VERIFYONLY
readonly
FAIL_ON_CHANGES DRY_RUN
echo
"**PLEASE** run
\"
godep restore
\"
before running this script"
echo
"**PLEASE** run
\"
godep restore
\"
before running this script"
# PREREQUISITES: run `godep restore` in the main repo before calling this script.
# PREREQUISITES: run `godep restore` in the main repo before calling this script.
...
@@ -183,8 +187,8 @@ find "${CLIENT_REPO_TEMP}" -type f \( \
...
@@ -183,8 +187,8 @@ find "${CLIENT_REPO_TEMP}" -type f \( \
echo
"remove cyclical godep"
echo
"remove cyclical godep"
rm
-rf
"
${
CLIENT_REPO_TEMP
}
/_vendor/k8s.io/client-go"
rm
-rf
"
${
CLIENT_REPO_TEMP
}
/_vendor/k8s.io/client-go"
if
[
"
${
VERIFYONLY
}
"
=
true
]
;
then
if
[
"
${
FAIL_ON_CHANGES
}
"
=
true
]
;
then
echo
"running
verify-only
"
echo
"running
FAIL_ON_CHANGES
"
ret
=
0
ret
=
0
if
diff
-NauprB
-I
"GoVersion.*
\|
GodepVersion.*"
"
${
CLIENT_REPO
}
"
"
${
CLIENT_REPO_TEMP
}
"
;
then
if
diff
-NauprB
-I
"GoVersion.*
\|
GodepVersion.*"
"
${
CLIENT_REPO
}
"
"
${
CLIENT_REPO_TEMP
}
"
;
then
echo
"
${
CLIENT_REPO
}
up to date."
echo
"
${
CLIENT_REPO
}
up to date."
...
@@ -197,8 +201,11 @@ if [ "${VERIFYONLY}" = true ]; then
...
@@ -197,8 +201,11 @@ if [ "${VERIFYONLY}" = true ]; then
fi
fi
fi
fi
echo
"move to the client repo"
# clean the ${CLIENT_REPO}
# clean the ${CLIENT_REPO}
ls
"
${
CLIENT_REPO
}
"
|
{
grep
-v
'_tmp'
||
true
;
}
| xargs
rm
-rf
echo
"move to the client repo"
mv
"
${
CLIENT_REPO_TEMP
}
"
/
*
"
${
CLIENT_REPO
}
"
if
[
"
${
DRY_RUN
}
"
=
false
]
;
then
ls
"
${
CLIENT_REPO
}
"
|
{
grep
-v
'_tmp'
||
true
;
}
| xargs
rm
-rf
mv
"
${
CLIENT_REPO_TEMP
}
"
/
*
"
${
CLIENT_REPO
}
"
fi
cleanup
cleanup
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