Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
6003a612
Commit
6003a612
authored
Dec 20, 2017
by
Matt Kwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Kokoro job pull Dockerimage from Dockerhub
parent
8ac050fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
build_and_run_docker.sh
kokoro/linux/build_and_run_docker.sh
+11
-8
pull_request_in_docker.sh
kokoro/linux/pull_request_in_docker.sh
+3
-3
No files found.
kokoro/linux/build_and_run_docker.sh
View file @
6003a612
...
@@ -11,15 +11,16 @@
...
@@ -11,15 +11,16 @@
set
-ex
set
-ex
cd
$(
dirname
$0
)
/..
cd
$(
dirname
$0
)
/..
/..
git_root
=
$(
pwd
)
git_root
=
$(
pwd
)
cd
-
cd
-
# Use image name based on Dockerfile location checksum
# Use image name based on Dockerfile sha1
DOCKER_IMAGE_NAME
=
$(
basename
$DOCKERFILE_DIR
)
_
$(
sha1sum
$DOCKERFILE_DIR
/Dockerfile |
cut
-f1
-d
\
)
DOCKERHUB_ORGANIZATION
=
grpctesting/protobuf
DOCKER_IMAGE_NAME
=
${
DOCKERHUB_ORGANIZATION
}
_
$(
sha1sum
$DOCKERFILE_DIR
/Dockerfile |
cut
-f1
-d
\
)
#
Make sure docker image has been built. Should be instantaneous if so.
#
Pull dockerimage from Dockerhub
docker
build
-t
$DOCKER_IMAGE_NAME
$DOCKERFILE_DIR
docker
pull
$DOCKER_IMAGE_NAME
# Ensure existence of ccache directory
# Ensure existence of ccache directory
CCACHE_DIR
=
/tmp/protobuf-ccache
CCACHE_DIR
=
/tmp/protobuf-ccache
...
@@ -28,19 +29,21 @@ mkdir -p $CCACHE_DIR
...
@@ -28,19 +29,21 @@ mkdir -p $CCACHE_DIR
# Choose random name for docker container
# Choose random name for docker container
CONTAINER_NAME
=
"build_and_run_docker_
$(
uuidgen
)
"
CONTAINER_NAME
=
"build_and_run_docker_
$(
uuidgen
)
"
echo
$git_root
# Run command inside docker
# Run command inside docker
docker run
\
docker run
\
"
$@
"
\
"
$@
"
\
-e
CCACHE_DIR
=
$CCACHE_DIR
\
-e
CCACHE_DIR
=
$CCACHE_DIR
\
-e
EXTERNAL_GIT_ROOT
=
"/var/local/
jenkins
/protobuf"
\
-e
EXTERNAL_GIT_ROOT
=
"/var/local/
kokoro
/protobuf"
\
-e
TEST_SET
=
"
$TEST_SET
"
\
-e
TEST_SET
=
"
$TEST_SET
"
\
-e
THIS_IS_REALLY_NEEDED
=
'see https://github.com/docker/docker/issues/14203 for why docker is awful'
\
-e
THIS_IS_REALLY_NEEDED
=
'see https://github.com/docker/docker/issues/14203 for why docker is awful'
\
-v
"
$git_root
:/var/local/
jenkins
/protobuf:ro"
\
-v
"
$git_root
:/var/local/
kokoro
/protobuf:ro"
\
-v
$CCACHE_DIR
:
$CCACHE_DIR
\
-v
$CCACHE_DIR
:
$CCACHE_DIR
\
-w
/var/local/git/protobuf
\
-w
/var/local/git/protobuf
\
--name
=
$CONTAINER_NAME
\
--name
=
$CONTAINER_NAME
\
$DOCKER_IMAGE_NAME
\
$DOCKER_IMAGE_NAME
\
bash
-l
"/var/local/
jenkins
/protobuf/
$DOCKER_RUN_SCRIPT
"
||
FAILED
=
"true"
bash
-l
"/var/local/
kokoro
/protobuf/
$DOCKER_RUN_SCRIPT
"
||
FAILED
=
"true"
# Copy output artifacts
# Copy output artifacts
if
[
"
$OUTPUT_DIR
"
!=
""
]
if
[
"
$OUTPUT_DIR
"
!=
""
]
...
...
kokoro/linux/pull_request_in_docker.sh
View file @
6003a612
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
WORKSPACE_BASE
=
`
pwd
`
WORKSPACE_BASE
=
`
pwd
`
MY_DIR
=
"
$(
dirname
"
$0
"
)
"
MY_DIR
=
"
$(
dirname
"
$0
"
)
"
TEST_SCRIPT
=
$MY_DIR
/../tests.sh
TEST_SCRIPT
=
$MY_DIR
/../
../
tests.sh
BUILD_DIR
=
/tmp/protobuf
BUILD_DIR
=
/tmp/protobuf
set
-e
# exit immediately on error
set
-e
# exit immediately on error
...
@@ -16,7 +16,7 @@ set -x # display all commands
...
@@ -16,7 +16,7 @@ set -x # display all commands
rm
-rf
$BUILD_DIR
rm
-rf
$BUILD_DIR
mkdir
-p
$BUILD_DIR
mkdir
-p
$BUILD_DIR
cd
$BUILD_DIR
cd
$BUILD_DIR
git clone /var/local/
jenkins
/protobuf
git clone /var/local/
kokoro
/protobuf
cd
protobuf
cd
protobuf
# Set up the directory where our test output is going to go.
# Set up the directory where our test output is going to go.
...
@@ -54,7 +54,7 @@ parallel --results $LOG_OUTPUT_DIR --joblog $OUTPUT_DIR/joblog $TEST_SCRIPT :::
...
@@ -54,7 +54,7 @@ parallel --results $LOG_OUTPUT_DIR --joblog $OUTPUT_DIR/joblog $TEST_SCRIPT :::
cat
$OUTPUT_DIR
/joblog
cat
$OUTPUT_DIR
/joblog
# The directory that is copied from Docker back into the
Jenkins
workspace.
# The directory that is copied from Docker back into the
Kokoro
workspace.
COPY_FROM_DOCKER
=
/var/local/git/protobuf/testoutput
COPY_FROM_DOCKER
=
/var/local/git/protobuf/testoutput
mkdir
-p
$COPY_FROM_DOCKER
mkdir
-p
$COPY_FROM_DOCKER
TESTOUTPUT_XML_FILE
=
$COPY_FROM_DOCKER
/testresults.xml
TESTOUTPUT_XML_FILE
=
$COPY_FROM_DOCKER
/testresults.xml
...
...
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