1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-21 23:18:13 +00:00
trezor-firmware/ci/Dockerfile

38 lines
1.4 KiB
Docker
Raw Normal View History

2020-05-03 17:00:57 +00:00
FROM nixos/nix:2.3.4
2017-11-04 00:56:05 +00:00
2020-05-03 17:00:57 +00:00
COPY shell.nix shell.nix
2017-11-04 00:56:05 +00:00
2020-05-03 17:00:57 +00:00
RUN nix-env -i -f shell.nix -A buildInputs
2019-08-27 14:05:22 +00:00
2020-05-03 17:00:57 +00:00
CMD [ "nix-shell" ]
2019-08-27 14:05:22 +00:00
2020-05-03 17:00:57 +00:00
# the rest of the file only applies when docker build is called
# with the following argument: "--build-arg FULLDEPS_TESTING=1"
2019-08-27 14:05:22 +00:00
2020-05-03 17:00:57 +00:00
ENV TREZOR_MONERO_TESTS_PATH="/opt/trezor_monero_tests"
2019-08-27 14:05:22 +00:00
2020-05-03 17:00:57 +00:00
ARG FULLDEPS_TESTING=0
ENV FULLDEPS_TESTING=${FULLDEPS_TESTING}
2020-05-03 17:00:57 +00:00
# install other python versions for tox testing
2019-08-27 14:05:22 +00:00
RUN if [ "${FULLDEPS_TESTING}" = "1" ]; then \
2020-05-03 17:00:57 +00:00
nix-env -iP python3-3.8.2 ; \
nix-env --set-flag priority 6 python3-3.8.2 ; \
nix-env -iP python3-3.6.10 ; \
nix-env --set-flag priority 7 python3-3.6.10 ; \
nix-env -iP python3-3.5.9 ; \
nix-env --set-flag priority 8 python3-3.5.9 ; \
2018-10-23 10:00:42 +00:00
fi
2018-10-12 12:13:39 +00:00
# download monero tests binary
2019-08-27 14:05:22 +00:00
RUN if [ "${FULLDEPS_TESTING}" = "1" ]; then \
2020-05-03 17:00:57 +00:00
TREZOR_MONERO_TESTS_SHA256SUM=1e5dfdb07de4ea46088f4a5bdb0d51f040fe479019efae30f76427eee6edb3f7 ; \
TREZOR_MONERO_TESTS_URL="https://github.com/ph4r05/monero/releases/download/v0.15.0.0-tests-u18.04-03/trezor_tests" ; \
2019-08-27 14:05:22 +00:00
wget --no-verbose "${TREZOR_MONERO_TESTS_URL}" -O "${TREZOR_MONERO_TESTS_PATH}" ; \
chmod +x "${TREZOR_MONERO_TESTS_PATH}" ; \
echo "${TREZOR_MONERO_TESTS_SHA256SUM} ${TREZOR_MONERO_TESTS_PATH}" | sha256sum -c ; \
2020-05-03 17:00:57 +00:00
nix-shell -p patchelf --run 'patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "${TREZOR_MONERO_TESTS_PATH}"' ; \
2019-08-27 14:05:22 +00:00
fi