Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Commit 38cf1df

Browse files
authored
ci: fix Docker image caching (#106)
We need to source the Google Container Registry (GCR) configuration before defining the docker image names.
1 parent fde6831 commit 38cf1df

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

ci/kokoro/install/build.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ else
4949
exit 1
5050
fi
5151

52+
echo "================================================================"
53+
echo "Load Google Container Registry configuration parameters $(date)."
54+
55+
if [[ -f "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh" ]]; then
56+
source "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh"
57+
fi
58+
5259
if [[ -z "${PROJECT_ROOT+x}" ]]; then
5360
readonly PROJECT_ROOT="$(cd "$(dirname "$0")/../../.."; pwd)"
5461
fi
@@ -61,13 +68,6 @@ cd "${PROJECT_ROOT}"
6168
echo "================================================================"
6269
echo "Building with ${NCPU} cores $(date) on ${PWD}."
6370

64-
echo "================================================================"
65-
echo "Load Google Container Registry configuration parameters $(date)."
66-
67-
if [[ -f "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh" ]]; then
68-
source "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh"
69-
fi
70-
7171
echo "================================================================"
7272
echo "Setup Google Container Registry access $(date)."
7373
if [[ -f "${KOKORO_GFILE_DIR:-}/gcr-service-account.json" ]]; then

ci/kokoro/readme/build.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ else
5050
exit 1
5151
fi
5252

53+
echo "================================================================"
54+
echo "Load Google Container Registry configuration parameters $(date)."
55+
56+
if [[ -f "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh" ]]; then
57+
source "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh"
58+
fi
59+
5360
if [[ -z "${PROJECT_ROOT+x}" ]]; then
5461
readonly PROJECT_ROOT="$(cd "$(dirname "$0")/../../.."; pwd)"
5562
fi
@@ -62,13 +69,6 @@ cd "${PROJECT_ROOT}"
6269
echo "================================================================"
6370
echo "Building with ${NCPU} cores $(date) on ${PWD}."
6471

65-
echo "================================================================"
66-
echo "Load Google Container Registry configuration parameters $(date)."
67-
68-
if [[ -f "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh" ]]; then
69-
source "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh"
70-
fi
71-
7272
echo "================================================================"
7373
echo "Setup Google Container Registry access $(date)."
7474
if [[ -f "${KOKORO_GFILE_DIR:-}/gcr-service-account.json" ]]; then

ci/templates/kokoro/install/build.sh.in

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ else
4545
exit 1
4646
fi
4747

48+
echo "================================================================"
49+
echo "Load Google Container Registry configuration parameters $(date)."
50+
51+
if [[ -f "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh" ]]; then
52+
source "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh"
53+
fi
54+
4855
if [[ -z "${PROJECT_ROOT+x}" ]]; then
4956
readonly PROJECT_ROOT="$(cd "$(dirname "$0")/../../.."; pwd)"
5057
fi
@@ -57,13 +64,6 @@ cd "${PROJECT_ROOT}"
5764
echo "================================================================"
5865
echo "Building with ${NCPU} cores $(date) on ${PWD}."
5966

60-
echo "================================================================"
61-
echo "Load Google Container Registry configuration parameters $(date)."
62-
63-
if [[ -f "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh" ]]; then
64-
source "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh"
65-
fi
66-
6767
echo "================================================================"
6868
echo "Setup Google Container Registry access $(date)."
6969
if [[ -f "${KOKORO_GFILE_DIR:-}/gcr-service-account.json" ]]; then

ci/templates/kokoro/readme/build.sh.in

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ else
4646
exit 1
4747
fi
4848

49+
echo "================================================================"
50+
echo "Load Google Container Registry configuration parameters $(date)."
51+
52+
if [[ -f "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh" ]]; then
53+
source "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh"
54+
fi
55+
4956
if [[ -z "${PROJECT_ROOT+x}" ]]; then
5057
readonly PROJECT_ROOT="$(cd "$(dirname "$0")/../../.."; pwd)"
5158
fi
@@ -58,13 +65,6 @@ cd "${PROJECT_ROOT}"
5865
echo "================================================================"
5966
echo "Building with ${NCPU} cores $(date) on ${PWD}."
6067

61-
echo "================================================================"
62-
echo "Load Google Container Registry configuration parameters $(date)."
63-
64-
if [[ -f "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh" ]]; then
65-
source "${KOKORO_GFILE_DIR:-}/gcr-configuration.sh"
66-
fi
67-
6868
echo "================================================================"
6969
echo "Setup Google Container Registry access $(date)."
7070
if [[ -f "${KOKORO_GFILE_DIR:-}/gcr-service-account.json" ]]; then

0 commit comments

Comments
 (0)