You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.2 KiB
43 lines
1.2 KiB
#!/bin/bash -x |
|
|
|
travis_docker_env () |
|
{ |
|
if [[ -n "${DOCKER_IMG_JM}" ]] && [[ "${HAS_JOSH_K_SEAL_OF_APPROVAL}" == true ]]; then |
|
return 0 |
|
else |
|
return 1 |
|
fi |
|
} |
|
|
|
build_docker () |
|
{ |
|
if ! travis_docker_env; then |
|
return 0 |
|
fi |
|
|
|
core_version='24.0.1' |
|
core_dist="bitcoin-${core_version}-x86_64-linux-gnu.tar.gz" |
|
core_url="https://bitcoincore.org/bin/bitcoin-core-${core_version}/${core_dist}" |
|
declare -A deps=( [${core_dist}]="${core_url}" ) |
|
jm_root="${TRAVIS_BUILD_DIR}" |
|
repo_name="${TRAVIS_REPO_SLUG#*\/}" |
|
|
|
for dep in "${!deps[@]}"; do |
|
if [[ ! -r "${HOME}/downloads/${dep}" ]]; then |
|
curl --retry 5 -L "${deps[${dep}]}" -o "$HOME/downloads/${dep}" |
|
fi |
|
done |
|
|
|
mkdir -p "${jm_root}/deps/cache" |
|
find "$HOME/downloads" -type f -exec cp -v {} "${jm_root}/deps/cache/" \; |
|
cd "${jm_root}/../" || return 1 |
|
|
|
docker build \ |
|
--shm-size=1G \ |
|
--build-arg core_version="${core_version}" \ |
|
--build-arg core_dist="${core_dist}" \ |
|
--build-arg repo_name="${repo_name}" \ |
|
-f "./${repo_name}/test/Dockerfiles/${DOCKER_IMG_JM}.Dockerfile" . |
|
return "$?" |
|
} |
|
build_docker
|
|
|