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
04c90565
Commit
04c90565
authored
May 11, 2015
by
Quinton Hoole
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7993 from saad-ali/jenkinssoak2
Modify Jenkins E2E to not fetch/unpack Kuberenetes, when deployment is disabled
parents
8b3130b1
94643ce6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
70 deletions
+73
-70
e2e.sh
hack/jenkins/e2e.sh
+73
-70
No files found.
hack/jenkins/e2e.sh
View file @
04c90565
...
@@ -97,99 +97,102 @@ export E2E_UP="${E2E_UP:-true}"
...
@@ -97,99 +97,102 @@ export E2E_UP="${E2E_UP:-true}"
export
E2E_TEST
=
"
${
E2E_TEST
:-
true
}
"
export
E2E_TEST
=
"
${
E2E_TEST
:-
true
}
"
export
E2E_DOWN
=
"
${
E2E_DOWN
:-
true
}
"
export
E2E_DOWN
=
"
${
E2E_DOWN
:-
true
}
"
if
[[
${
KUBE_RUN_FROM_OUTPUT
:-}
=
~ ^[yY]
$
]]
;
then
if
[[
"
${
E2E_UP
,,
}
"
==
"true"
]]
;
then
echo
"Found KUBE_RUN_FROM_OUTPUT=y; will use binaries from _output"
if
[[
${
KUBE_RUN_FROM_OUTPUT
:-}
=
~ ^[yY]
$
]]
;
then
cp
_output/release-tars/kubernetes
*
.tar.gz
.
echo
"Found KUBE_RUN_FROM_OUTPUT=y; will use binaries from _output"
else
cp
_output/release-tars/kubernetes
*
.tar.gz
.
echo
"Pulling binaries from GCS"
else
if
[[
$(
find
.
|
wc
-l
)
!=
1
]]
;
then
echo
"Pulling binaries from GCS"
echo
$PWD
not empty, bailing!
if
[[
$(
find
.
|
wc
-l
)
!=
1
]]
;
then
exit
1
echo
$PWD
not empty, bailing!
exit
1
fi
# Tell kube-up.sh to skip the update, it doesn't lock. An internal
# gcloud bug can cause racing component updates to stomp on each
# other.
export
KUBE_SKIP_UPDATE
=
y
sudo
flock
-x
-n
/var/run/lock/gcloud-components.lock
-c
"gcloud components update -q"
||
true
# The "ci" bucket is for builds like "v0.15.0-468-gfa648c1"
bucket
=
"ci"
# The "latest" version picks the most recent "ci" or "release" build.
version_file
=
"latest"
if
[[
${
JENKINS_USE_RELEASE_TARS
:-}
=
~ ^[yY]
$
]]
;
then
# The "release" bucket is for builds like "v0.15.0"
bucket
=
"release"
if
[[
${
JENKINS_USE_STABLE
:-}
=
~ ^[yY]
$
]]
;
then
# The "stable" version picks the most recent "release" build.
version_file
=
"stable"
fi
fi
githash
=
$(
gsutil
cat
gs://kubernetes-release/
${
bucket
}
/
${
version_file
}
.txt
)
gsutil
-m
cp
gs://kubernetes-release/
${
bucket
}
/
${
githash
}
/kubernetes.tar.gz gs://kubernetes-release/
${
bucket
}
/
${
githash
}
/kubernetes-test.tar.gz
.
fi
fi
# Tell kube-up.sh to skip the update, it doesn't lock. An internal
if
[[
!
"
${
CIRCLECI
:-}
"
==
"true"
]]
;
then
# gcloud bug can cause racing component updates to stomp on each
# Copy GCE keys so we don't keep cycling them.
# other.
# To set this up, you must know the <project>, <zone>, and <instance> that
export
KUBE_SKIP_UPDATE
=
y
# on which your jenkins jobs are running. Then do:
sudo
flock
-x
-n
/var/run/lock/gcloud-components.lock
-c
"gcloud components update -q"
||
true
#
# # Get into the instance.
# The "ci" bucket is for builds like "v0.15.0-468-gfa648c1"
# $ gcloud compute ssh --project="<prj>" ssh --zone="<zone>" <instance>
bucket
=
"ci"
#
# The "latest" version picks the most recent "ci" or "release" build.
# # Generate a key by ssh'ing into itself, then exit.
version_file
=
"latest"
# $ gcloud compute ssh --project="<prj>" ssh --zone="<zone>" <instance>
if
[[
${
JENKINS_USE_RELEASE_TARS
:-}
=
~ ^[yY]
$
]]
;
then
# $ ^D
# The "release" bucket is for builds like "v0.15.0"
#
bucket
=
"release"
# # Copy the keys to the desired location, e.g. /var/lib/jenkins/gce_keys/
if
[[
${
JENKINS_USE_STABLE
:-}
=
~ ^[yY]
$
]]
;
then
# $ sudo mkdir -p /var/lib/jenkins/gce_keys/
# The "stable" version picks the most recent "release" build.
# $ sudo cp ~/.ssh/google_compute_engine /var/lib/jenkins/gce_keys/
version_file
=
"stable"
# $ sudo cp ~/.ssh/google_compute_engine.pub /var/lib/jenkins/gce_keys/
#
# Move the permissions to jenkins.
# $ sudo chown -R jenkins /var/lib/jenkins/gce_keys/
# $ sudo chgrp -R jenkins /var/lib/jenkins/gce_keys/
if
[[
"
${
KUBERNETES_PROVIDER
}
"
==
"aws"
]]
;
then
echo
"Skipping SSH key copying for AWS"
else
mkdir
-p
${
WORKSPACE
}
/.ssh/
cp
/var/lib/jenkins/gce_keys/google_compute_engine
${
WORKSPACE
}
/.ssh/
cp
/var/lib/jenkins/gce_keys/google_compute_engine.pub
${
WORKSPACE
}
/.ssh/
fi
fi
fi
fi
githash
=
$(
gsutil
cat
gs://kubernetes-release/
${
bucket
}
/
${
version_file
}
.txt
)
md5sum
kubernetes
*
.tar.gz
gsutil
-m
cp
gs://kubernetes-release/
${
bucket
}
/
${
githash
}
/kubernetes.tar.gz gs://kubernetes-release/
${
bucket
}
/
${
githash
}
/kubernetes-test.tar.gz
.
tar
-xzf
kubernetes.tar.gz
fi
tar
-xzf
kubernetes-test.tar.gz
if
[[
!
"
${
CIRCLECI
:-}
"
==
"true"
]]
;
then
# Set by GKE-CI to change the CLUSTER_API_VERSION to the git version
# Copy GCE keys so we don't keep cycling them.
if
[[
!
-z
${
E2E_SET_CLUSTER_API_VERSION
:-}
]]
;
then
# To set this up, you must know the <project>, <zone>, and <instance> that
export
CLUSTER_API_VERSION
=
$(
echo
${
githash
}
|
cut
-c
2-
)
# on which your jenkins jobs are running. Then do:
elif
[[
${
JENKINS_USE_RELEASE_TARS
:-}
=
~ ^[yY]
$
]]
;
then
#
release
=
$(
gsutil
cat
gs://kubernetes-release/release/
${
version_file
}
.txt |
cut
-c
2-
)
# # Get into the instance.
export
CLUSTER_API_VERSION
=
${
release
}
# $ gcloud compute ssh --project="<prj>" ssh --zone="<zone>" <instance>
fi
#
# # Generate a key by ssh'ing into itself, then exit.
# $ gcloud compute ssh --project="<prj>" ssh --zone="<zone>" <instance>
# $ ^D
#
# # Copy the keys to the desired location, e.g. /var/lib/jenkins/gce_keys/
# $ sudo mkdir -p /var/lib/jenkins/gce_keys/
# $ sudo cp ~/.ssh/google_compute_engine /var/lib/jenkins/gce_keys/
# $ sudo cp ~/.ssh/google_compute_engine.pub /var/lib/jenkins/gce_keys/
#
# Move the permissions to jenkins.
# $ sudo chown -R jenkins /var/lib/jenkins/gce_keys/
# $ sudo chgrp -R jenkins /var/lib/jenkins/gce_keys/
if
[[
"
${
KUBERNETES_PROVIDER
}
"
==
"aws"
]]
;
then
echo
"Skipping SSH key copying for AWS"
else
mkdir
-p
${
WORKSPACE
}
/.ssh/
cp
/var/lib/jenkins/gce_keys/google_compute_engine
${
WORKSPACE
}
/.ssh/
cp
/var/lib/jenkins/gce_keys/google_compute_engine.pub
${
WORKSPACE
}
/.ssh/
fi
fi
fi
md5sum
kubernetes
*
.tar.gz
tar
-xzf
kubernetes.tar.gz
tar
-xzf
kubernetes-test.tar.gz
cd
kubernetes
cd
kubernetes
# Set by GKE-CI to change the CLUSTER_API_VERSION to the git version
if
[[
!
-z
${
E2E_SET_CLUSTER_API_VERSION
:-}
]]
;
then
export
CLUSTER_API_VERSION
=
$(
echo
${
githash
}
|
cut
-c
2-
)
elif
[[
${
JENKINS_USE_RELEASE_TARS
:-}
=
~ ^[yY]
$
]]
;
then
release
=
$(
gsutil
cat
gs://kubernetes-release/release/
${
version_file
}
.txt |
cut
-c
2-
)
export
CLUSTER_API_VERSION
=
${
release
}
fi
# Have cmd/e2e run by goe2e.sh generate JUnit report in ${WORKSPACE}/junit*.xml
# Have cmd/e2e run by goe2e.sh generate JUnit report in ${WORKSPACE}/junit*.xml
export
E2E_REPORT_DIR
=
${
WORKSPACE
}
export
E2E_REPORT_DIR
=
${
WORKSPACE
}
### Set up ###
### Set up ###
if
[[
"
${
E2E_UP
,,
}
"
==
"true"
]]
;
then
if
[[
"
${
E2E_UP
,,
}
"
==
"true"
]]
;
then
go run ./hack/e2e.go
${
E2E_OPT
}
-v
--down
go run ./hack/e2e.go
${
E2E_OPT
}
-v
--down
go run ./hack/e2e.go
${
E2E_OPT
}
-v
--up
go run ./hack/e2e.go
${
E2E_OPT
}
-v
--up
go run ./hack/e2e.go
-v
--ctl
=
"version --match-server-version=false"
go run ./hack/e2e.go
-v
--ctl
=
"version --match-server-version=false"
fi
fi
### Run tests ###
### Run tests ###
# Jenkins will look at the junit*.xml files for test failures, so don't exit
# Jenkins will look at the junit*.xml files for test failures, so don't exit
# with a nonzero error code if it was only tests that failed.
# with a nonzero error code if it was only tests that failed.
if
[[
"
${
E2E_TEST
,,
}
"
==
"true"
]]
;
then
if
[[
"
${
E2E_TEST
,,
}
"
==
"true"
]]
;
then
go run ./hack/e2e.go
${
E2E_OPT
}
-v
--test
--test_args
=
"
${
GINKGO_TEST_ARGS
}
--ginkgo.noColor"
||
true
go run ./hack/e2e.go
${
E2E_OPT
}
-v
--test
--test_args
=
"
${
GINKGO_TEST_ARGS
}
--ginkgo.noColor"
||
true
fi
fi
### Clean up ###
### Clean up ###
if
[[
"
${
E2E_DOWN
,,
}
"
==
"true"
]]
;
then
if
[[
"
${
E2E_DOWN
,,
}
"
==
"true"
]]
;
then
go run ./hack/e2e.go
${
E2E_OPT
}
-v
--down
go run ./hack/e2e.go
${
E2E_OPT
}
-v
--down
fi
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