Skip to content

Commit

Permalink
Merge branch 'master' into restore-hot-wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim Neunert authored Sep 1, 2021
2 parents 89c65d6 + 3a845b3 commit f3827df
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ container:
# image: python:slim
# image: ubuntu:focal
# image: python:3.8-buster
image: registry.gitlab.com/cryptoadvance/specter-desktop/cirrus-focal:latest
image: registry.gitlab.com/cryptoadvance/specter-desktop/cirrus-focal:20210831

# We assume here that we're having a proper python3 system including virtualenv and pip
prep_stuff_template: &PREP_STUFF_TEMPLATE
Expand All @@ -12,7 +12,7 @@ prep_stuff_template: &PREP_STUFF_TEMPLATE
- cat pytest.ini | grep "addopts = " | cut -d'=' -f2 | sed 's/--/+/g' | tr '+' '\n' | grep bitcoin | cut -d' ' -f2
- cat tests/bitcoin_gitrev_pinned 2> /dev/null || true
- cat /etc/os-release | grep VERSION
populate_script: ./tests/install_noded.sh binary
populate_script: ./tests/install_noded.sh --debug --bitcoin binary
elementsd_installation_cache:
folder: ./tests/elements
fingerprint_script:
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ cypress/screenshots
node_modules
btcd-conn.json
elmd-conn.json
tests/bitcoin
tests/bitcoin.binary
tests/bitcoin.compile
tests/bitcoin*
token.sh
src/cryptoadvance/specter/translations/**/messages.mo
3 changes: 2 additions & 1 deletion docker/cirrus-focal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ from ubuntu:focal
RUN apt update && DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends -y \
libusb-1.0-0-dev libudev-dev python3 python3-virtualenv \
build-essential libtool autotools-dev automake autoconf pkg-config bsdmainutils libevent-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev bc \
nodejs npm libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
nodejs npm libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb \
wget

# Stuff needed for Elements (compilation)
RUN DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends -y libboost-thread-dev libsqlite3-dev git
10 changes: 6 additions & 4 deletions docker/cirrus-focal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ An image used to run the build on cirrus (tests only, not cypress-tests).

Create it like this:

```
docker build . -t registry.gitlab.com/cryptoadvance/specter-desktop/cirrus-focal:latest
docker push registry.gitlab.com/cryptoadvance/specter-desktop/cirrus-focal:latest
```
current_date=$(date +"%Y%m%d")
docker build . -t registry.gitlab.com/cryptoadvance/specter-desktop/cirrus-focal:${current_date}
docker push registry.gitlab.com/cryptoadvance/specter-desktop/cirrus-focal:${current_date}
# Do not forget to update the $current_date in .cirrus.yml
```

Check the `.cirrus.yml` on how this is used
Check the `.cirrus.yml` on how this is used and update the $current_date there.
24 changes: 21 additions & 3 deletions tests/install_noded.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ function sub_help {
function check_compile_prerequisites {
REQUIRED_PKGS="build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 autoconf"
REQUIRED_PKGS="$REQUIRED_PKGS libevent-dev libevent-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev bc nodejs npm libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb"
REQUIRED_PKGS="$REQUIRED_PKGS wget"
for REQUIRED_PKG in $REQUIRED_PKGS; do
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed")
echo Checking for $REQUIRED_PKG: $PKG_OK
Expand All @@ -161,7 +162,19 @@ function check_compile_prerequisites {
apt-get --yes install $REQUIRED_PKG
fi
done
}

function check_binary_prerequisites {
REQUIRED_PKGS="wget"
for REQUIRED_PKG in $REQUIRED_PKGS; do
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed")
echo Checking for $REQUIRED_PKG: $PKG_OK
if [ "" = "$PKG_OK" ]; then
echo "No $REQUIRED_PKG. Setting up $REQUIRED_PKG."
echo "WARNING: THIS SHOULD NOT BE NECESSARY, PLEASE FIX!"
apt-get --yes install $REQUIRED_PKG
fi
done
}

function sub_compile {
Expand All @@ -183,14 +196,17 @@ function sub_compile {
}

function sub_binary {
node_impl=$1
if [ "$node_impl" = "elements" ]; then
echo " --> binary installation of elements not supported, exiting"
exit 2
fi
echo " --> install_noded.sh Start $(date) (binary)"
echo " --> install_noded.sh Start $(date) (binary) for node_impl $node_impl"
START=$(date +%s.%N)
check_binary_prerequisites
# todo: Parametrize this
version=$(calc_pytestinit_nodeimpl_version $node_impl)
echo " --> install version $version"
# remove the v-prefix
version=$(echo $version | sed -e 's/v//')
if [[ ! -f bitcoin-${version}-x86_64-linux-gnu.tar.gz ]]; then
Expand All @@ -207,6 +223,8 @@ function sub_binary {
ln -s ./bitcoin-${version} bitcoin
echo " --> Listing binaries"
find ./bitcoin/bin -maxdepth 1 -type f -executable -exec ls -ld {} \;
echo " --> checking for bitcoind"
test -x ./bitcoin/bin/bitcodind || (echo "not found" && exit 2)
echo " --> Finished installing bitcoind binary"
END=$(date +%s.%N)
DIFF=$(echo "$END - $START" | bc)
Expand Down Expand Up @@ -246,11 +264,11 @@ function parse_and_execute() {
shift
;;
compile)
sub_compile $node_impl
sub_compile $node_impl || exit 2
shift
;;
binary)
sub_binary
sub_binary $node_impl || exit 2
shift
;;
*)
Expand Down

0 comments on commit f3827df

Please sign in to comment.