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
3d30caf8
Commit
3d30caf8
authored
Jul 11, 2016
by
Erick Fejta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inject service-account.json into test container
parent
9b74e24f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
16 deletions
+19
-16
dockerized-e2e-runner.sh
hack/jenkins/dockerized-e2e-runner.sh
+9
-9
e2e-runner.sh
hack/jenkins/e2e-runner.sh
+10
-7
No files found.
hack/jenkins/dockerized-e2e-runner.sh
View file @
3d30caf8
...
@@ -29,14 +29,13 @@ mkdir -p "${HOST_ARTIFACTS_DIR}"
...
@@ -29,14 +29,13 @@ mkdir -p "${HOST_ARTIFACTS_DIR}"
:
${
JENKINS_GCE_SSH_PRIVATE_KEY_FILE
:
=
'/var/lib/jenkins/gce_keys/google_compute_engine'
}
:
${
JENKINS_GCE_SSH_PRIVATE_KEY_FILE
:
=
'/var/lib/jenkins/gce_keys/google_compute_engine'
}
:
${
JENKINS_GCE_SSH_PUBLIC_KEY_FILE
:
=
'/var/lib/jenkins/gce_keys/google_compute_engine.pub'
}
:
${
JENKINS_GCE_SSH_PUBLIC_KEY_FILE
:
=
'/var/lib/jenkins/gce_keys/google_compute_engine.pub'
}
env
-u
HOME
-u
PATH
-u
PWD
-u
WORKSPACE
>
${
WORKSPACE
}
/env.list
env
\
-u
HOME
\
# Add all uncommented lines for metadata.google.internal in /etc/hosts to the
-u
KUBEKINS_SERVICE_ACCOUNT_FILE
\
# test container.
-u
PATH
\
readonly
METADATA_SERVER_ADD_HOST_ARGS
=(
$(
-u
PWD
\
grep
'^[0-9a-fA-F\.:]\+ \+metadata\.google\.internal'
/etc/hosts |
\
-u
WORKSPACE
\
cut
-f1
-d
' '
|
\
>
${
WORKSPACE
}
/env.list
xargs
-r
printf
--
'--add-host="metadata.google.internal:%s"\n'
)
)
docker_extra_args
=()
docker_extra_args
=()
if
[[
"
${
JENKINS_ENABLE_DOCKER_IN_DOCKER
:-}
"
=
~ ^[yY]
$
]]
;
then
if
[[
"
${
JENKINS_ENABLE_DOCKER_IN_DOCKER
:-}
"
=
~ ^[yY]
$
]]
;
then
...
@@ -56,10 +55,11 @@ docker run --rm=true -i \
...
@@ -56,10 +55,11 @@ docker run --rm=true -i \
${
JENKINS_AWS_SSH_PRIVATE_KEY_FILE
:+-v
"
${
JENKINS_AWS_SSH_PRIVATE_KEY_FILE
}
:/workspace/.ssh/kube_aws_rsa:ro"
}
\
${
JENKINS_AWS_SSH_PRIVATE_KEY_FILE
:+-v
"
${
JENKINS_AWS_SSH_PRIVATE_KEY_FILE
}
:/workspace/.ssh/kube_aws_rsa:ro"
}
\
${
JENKINS_AWS_SSH_PUBLIC_KEY_FILE
:+-v
"
${
JENKINS_AWS_SSH_PUBLIC_KEY_FILE
}
:/workspace/.ssh/kube_aws_rsa.pub:ro"
}
\
${
JENKINS_AWS_SSH_PUBLIC_KEY_FILE
:+-v
"
${
JENKINS_AWS_SSH_PUBLIC_KEY_FILE
}
:/workspace/.ssh/kube_aws_rsa.pub:ro"
}
\
${
JENKINS_AWS_CREDENTIALS_FILE
:+-v
"
${
JENKINS_AWS_CREDENTIALS_FILE
}
:/workspace/.aws/credentials:ro"
}
\
${
JENKINS_AWS_CREDENTIALS_FILE
:+-v
"
${
JENKINS_AWS_CREDENTIALS_FILE
}
:/workspace/.aws/credentials:ro"
}
\
${
KUBEKINS_SERVICE_ACCOUNT_FILE
:+-v
"
${
KUBEKINS_SERVICE_ACCOUNT_FILE
}
:/service-account.json:ro"
}
\
--env-file
"
${
WORKSPACE
}
/env.list"
\
--env-file
"
${
WORKSPACE
}
/env.list"
\
-e
"HOME=/workspace"
\
-e
"HOME=/workspace"
\
-e
"WORKSPACE=/workspace"
\
-e
"WORKSPACE=/workspace"
\
${
KUBEKINS_SERVICE_ACCOUNT_FILE
:+-e
"KUBEKINS_SERVICE_ACCOUNT_FILE=/service-account.json"
}
\
"
${
docker_extra_args
[@]
:+
${
docker_extra_args
[@]
}}
"
\
"
${
docker_extra_args
[@]
:+
${
docker_extra_args
[@]
}}
"
\
"
${
METADATA_SERVER_ADD_HOST_ARGS
[@]
:+
${
METADATA_SERVER_ADD_HOST_ARGS
[@]
}}
"
\
gcr.io/google_containers/kubekins-test:go1.6.2-docker1.9.1-rev3
\
gcr.io/google_containers/kubekins-test:go1.6.2-docker1.9.1-rev3
\
bash
-c
"bash <(curl -fsS --retry 3 --keepalive-time 2 'https://raw.githubusercontent.com/kubernetes/kubernetes/master/hack/jenkins/e2e-runner.sh')"
bash
-c
"bash <(curl -fsS --retry 3 --keepalive-time 2 'https://raw.githubusercontent.com/kubernetes/kubernetes/master/hack/jenkins/e2e-runner.sh')"
hack/jenkins/e2e-runner.sh
View file @
3d30caf8
...
@@ -190,13 +190,6 @@ if running_in_docker; then
...
@@ -190,13 +190,6 @@ if running_in_docker; then
fi
fi
fi
fi
if
[[
-f
"
${
KUBEKINS_SERVICE_ACCOUNT_FILE
:-}
"
]]
;
then
echo
'Activating service account...'
# No harm in doing this multiple times.
gcloud auth activate-service-account
--key-file
=
"
${
KUBEKINS_SERVICE_ACCOUNT_FILE
}
"
elif
[[
-n
"
${
KUBEKINS_SERVICE_ACCOUNT_FILE
:-}
"
]]
;
then
echo
"ERROR: cannot access service account file at:
${
KUBEKINS_SERVICE_ACCOUNT_FILE
}
"
fi
# Install gcloud from a custom path if provided. Used to test GKE with gcloud
# Install gcloud from a custom path if provided. Used to test GKE with gcloud
# at HEAD, release candidate.
# at HEAD, release candidate.
# TODO: figure out how to avoid installing the cloud sdk twice if run inside Docker.
# TODO: figure out how to avoid installing the cloud sdk twice if run inside Docker.
...
@@ -230,6 +223,16 @@ if [[ -n "${JENKINS_GCI_IMAGE_FAMILY:-}" ]]; then
...
@@ -230,6 +223,16 @@ if [[ -n "${JENKINS_GCI_IMAGE_FAMILY:-}" ]]; then
fi
fi
fi
fi
if
[[
-f
"
${
KUBEKINS_SERVICE_ACCOUNT_FILE
:-}
"
]]
;
then
echo
'Activating service account...'
# No harm in doing this multiple times.
gcloud auth activate-service-account
--key-file
=
"
${
KUBEKINS_SERVICE_ACCOUNT_FILE
}
"
export
GCE_SERVICE_ACCOUNT
=
$(
gcloud auth list 2> /dev/null |
grep
active |
cut
-f3
-d
' '
)
unset
KUBEKINS_SERVICE_ACCOUNT_FILE
elif
[[
-n
"
${
KUBEKINS_SERVICE_ACCOUNT_FILE
:-}
"
]]
;
then
echo
"ERROR: cannot access service account file at:
${
KUBEKINS_SERVICE_ACCOUNT_FILE
}
"
fi
function
e2e_test
()
{
function
e2e_test
()
{
local
-r
ginkgo_test_args
=
"
${
1
}
"
local
-r
ginkgo_test_args
=
"
${
1
}
"
# Check to make sure the cluster is up before running tests, and fail if it's not.
# Check to make sure the cluster is up before running tests, and fail if it's not.
...
...
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