2017-01-22 04:59:18 +04:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2017-04-12 14:55:01 +04:00
|
|
|
script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")"
|
2017-01-22 04:59:18 +04:00
|
|
|
src_dir="$(dirname "$script_dir")"
|
|
|
|
cd "$src_dir"
|
|
|
|
|
2018-01-28 23:03:31 +04:00
|
|
|
. "$script_dir"/version.sh
|
|
|
|
|
2018-02-15 14:40:25 +04:00
|
|
|
if [ "$1" = "--build-opam" ] ; then
|
|
|
|
build_opam=yes
|
|
|
|
shift 1
|
|
|
|
fi
|
2017-01-22 04:59:18 +04:00
|
|
|
image_name="${1:-tezos}"
|
|
|
|
image_version="${2:-latest}"
|
2018-02-15 14:40:25 +04:00
|
|
|
build_dir="${3:-$src_dir/_docker_build}"
|
2018-01-28 23:03:31 +04:00
|
|
|
opam_image_name="${image_name}_opam"
|
2017-08-04 20:32:52 +04:00
|
|
|
build_image_name="${image_name}_build"
|
|
|
|
build_deps_image_name="${image_name}_build_deps"
|
2017-01-22 04:59:18 +04:00
|
|
|
|
2018-02-15 14:40:25 +04:00
|
|
|
if [ -n "$build_opam" ] ; then
|
|
|
|
|
|
|
|
export build_dir
|
|
|
|
|
|
|
|
"$script_dir"/ci/create_docker_image.opam.sh \
|
|
|
|
"$opam_image_name" "$image_version"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
docker pull registry.gitlab.com/tezos/tezos/opam:latest
|
|
|
|
docker tag registry.gitlab.com/tezos/tezos/opam:latest \
|
|
|
|
"$opam_image_name:$image_version"
|
|
|
|
|
|
|
|
fi
|
2018-01-28 23:03:31 +04:00
|
|
|
|
|
|
|
"$script_dir"/ci/create_docker_image.build_deps.sh \
|
2018-02-15 14:40:25 +04:00
|
|
|
"$build_deps_image_name" "$image_version" \
|
|
|
|
"$opam_image_name:$image_version"
|
|
|
|
|
2017-01-22 04:59:18 +04:00
|
|
|
|
2018-01-28 23:03:31 +04:00
|
|
|
"$script_dir"/ci/create_docker_image.build.sh \
|
2018-02-15 14:40:25 +04:00
|
|
|
"$build_image_name" "$image_version" \
|
|
|
|
"$build_deps_image_name"
|
2017-01-22 04:59:18 +04:00
|
|
|
|
2018-01-28 23:03:31 +04:00
|
|
|
"$script_dir"/ci/create_docker_image.minimal.sh \
|
2018-02-15 14:40:25 +04:00
|
|
|
"$image_name" "$image_version" "$build_image_name"
|