Skip to content

Commit

Permalink
feat: build linux migalood
Browse files Browse the repository at this point in the history
  • Loading branch information
duvbell committed Jan 15, 2024
1 parent aab804e commit 690e6b4
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,14 @@ proto-format:
###############################################################################
### V3 setup ###
###############################################################################
build-v4:
docker build -t migalood:latest .
build-linux:
mkdir -p $(BUILDDIR)
docker build --platform linux/amd64 --tag migalood ./
docker create --platform limux/amd64 --name temp migalood:latest
docker cp temp:/usr/bin/migalood $(BUILDDIR)/
docker rm temp



build-v3:
docker build -t migaloodv3 -f migalood-v3/Dockerfile .
Expand Down Expand Up @@ -305,3 +311,7 @@ build-cosmovisor-linux:

build-migalood-env:
$(MAKE) -C contrib/migalood-env migalood-upgrade-env


upgrade-test:
bash contrib/updates/prepare_cosmovisor.sh $(BUILDDIR) ${TESTNET_NVAL} ${TESTNET_CHAINID}
37 changes: 37 additions & 0 deletions contrib/updates/prepare_cosmovisor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

# this bash will prepare cosmosvisor to the build folder so that it can perform upgrade
# this script is supposed to be run by Makefile

# These fields should be fetched automatically in the future
# Need to do more upgrade to see upgrade patterns
OLD_VERSION=v3.0.4
# this command will retrieve the folder with the largest number in format v<number>
SOFTWARE_UPGRADE_NAME=$(ls -d -- ./app/upgrades/v* | sort -Vr | head -n 1 | xargs basename)
BUILDDIR=$1
TESTNET_NVAL=$2
TESTNET_CHAINID=$3

# check if BUILDDIR is set
if [ -z "$BUILDDIR" ]; then
echo "BUILDDIR is not set"
exit 1
fi

# install old binary if not exist
if [ ! -f "_build/$OLD_VERSION.zip" ] &> /dev/null
then
mkdir -p _build/old
wget -c "https://github.com/White-Whale-Defi-Platform/migaloo-chain/archive/refs/tags/${OLD_VERSION}.zip" -O _build/${OLD_VERSION}.zip
unzip _build/${OLD_VERSION}.zip -d _build
fi


if [ ! -f "$BUILDDIR/$OLD_VERSION.zip" ] &> /dev/null
then
mkdir -p BUILDDIR/old
docker build --platform linux/amd64 --no-cache --build-arg source=./_build/migaloo-chain-${OLD_VERSION:1}/ --tag migaloo/migalood.binary.old .
docker create --platform linux/amd64 --name old-temp migaloo/migalood.binary.old:latest
docker cp old-temp:/usr/local/bin/migalood $BUILDDIR/old/
docker rm old-temp
fi

0 comments on commit 690e6b4

Please sign in to comment.