nimbus-eth2/docker/dist/entry_point.sh

47 lines
1.4 KiB
Bash
Raw Normal View History

#!/bin/bash
set -e
cd /home/user/nimbus-eth2
2020-11-07 07:46:53 +00:00
git config --global core.abbrev 8
2020-11-06 22:11:16 +00:00
BINARIES="beacon_node beacon_node_spec_0_12_3"
2020-11-06 16:26:03 +00:00
# we need to build everything against libraries available inside this container, including the Nim compiler
make clean
make -j$(nproc) LOG_LEVEL="TRACE" NIMFLAGS="-d:disableMarchNative" PARTIAL_STATIC_LINKING=1 ${BINARIES}
# archive directory (we need the Nim compiler in here)
PREFIX="nimbus-eth2_Linux_amd64_"
GIT_COMMIT="$(git rev-parse --short HEAD)"
2020-11-06 16:26:03 +00:00
VERSION="$(./env.sh nim --verbosity:0 --hints:off --warnings:off scripts/print_version.nims)"
2020-11-07 07:46:53 +00:00
#TIMESTAMP="$(date --utc +'%Y%m%d%H%M%S')"
DIR="${PREFIX}${VERSION}_${GIT_COMMIT}"
DIST_PATH="dist/${DIR}"
# delete old artefacts
rm -rf "dist/${PREFIX}"*.tar.gz
2020-11-07 07:46:53 +00:00
if [[ -d "${DIST_PATH}" ]]; then
rm -rf "${DIST_PATH}"
fi
mkdir -p "${DIST_PATH}"
2020-11-06 16:26:03 +00:00
# copy and checksum binaries, copy scripts and docs
for BINARY in ${BINARIES}; do
cp -a ./build/${BINARY} "${DIST_PATH}/"
cd "${DIST_PATH}"
md5sum ${BINARY} > ${BINARY}.md5sum
sha512sum ${BINARY} > ${BINARY}.sha512sum
cd - >/dev/null
done
sed -e "s/GIT_COMMIT/${GIT_COMMIT}/" docker/dist/README.md > "${DIST_PATH}/README.md"
2020-11-07 07:46:53 +00:00
cp -a scripts/makedir.sh docker/dist/run_*_node.sh "${DIST_PATH}/"
#cp -a docs/the_nimbus_book "${DIST_PATH}/"
# create the tarball
cd dist
tar czf "${DIR}.tar.gz" "${DIR}"
# don't leave the directory hanging around
rm -rf "${DIR}"
cd - >/dev/null