Skip to content

Commit

Permalink
use mobilecoin's builder image to do the build, and install new protoc
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed Feb 8, 2024
1 parent b88293a commit 4962b83
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
14 changes: 7 additions & 7 deletions build_mcd_mainnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e

cp install_new_protoc.sh mobilecoin/

pushd mobilecoin

export GIT_REV=`git rev-parse HEAD`
Expand All @@ -12,22 +14,20 @@ cargo clean
export NETWORK="prod.mobilecoin.com"
echo "NETWORK = ${NETWORK}"

source ./tools/download_sigstruct.sh
export SGX_MODE=HW
export IAS_MODE=PROD

echo "Building mobilecoind"

cargo build --release --locked -p mc-mobilecoind -p mc-admin-http-gateway
./mob --verbose --no-publish --hw --ias-prod --env="NETWORK=${NETWORK}" "source ./tools/download_sigstruct.sh; sudo ./install_new_protoc.sh; cargo build --release --locked -p mc-mobilecoind -p mc-admin-http-gateway"

rm install_new_protoc.sh

export ARTIFACTS=/tmp/mobilecoind-mainnet-package
echo "Bundling artifacts at ${ARTIFACTS}"

rm -rf ${ARTIFACTS}
mkdir -p ${ARTIFACTS}/bin

cp target/release/mobilecoind ${ARTIFACTS}/bin/
cp target/release/mc-admin-http-gateway ${ARTIFACTS}/bin/
cp target/docker/release/mobilecoind ${ARTIFACTS}/bin/
cp target/docker/release/mc-admin-http-gateway ${ARTIFACTS}/bin/
cp ingest-enclave.css ${ARTIFACTS}/bin/
cp consensus-enclave.css ${ARTIFACTS}/bin/
cat << EOF > "${ARTIFACTS}/README.md"
Expand Down
14 changes: 7 additions & 7 deletions build_mcd_testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e

cp install_new_protoc.sh mobilecoin/

pushd mobilecoin

export GIT_REV=`git rev-parse HEAD`
Expand All @@ -12,22 +14,20 @@ cargo clean
export NETWORK="test.mobilecoin.com"
echo "NETWORK = ${NETWORK}"

source ./tools/download_sigstruct.sh
export SGX_MODE=HW
export IAS_MODE=PROD

echo "Building mobilecoind"

cargo build --release --locked -p mc-mobilecoind -p mc-admin-http-gateway
./mob --verbose --no-publish --hw --ias-prod --env="NETWORK=${NETWORK}" "source ./tools/download_sigstruct.sh; sudo ./install_new_protoc.sh; cargo build --release --locked -p mc-mobilecoind -p mc-admin-http-gateway"

rm install_new_protoc.sh

export ARTIFACTS=/tmp/mobilecoind-testnet-package
echo "Bundling artifacts at ${ARTIFACTS}"

rm -rf ${ARTIFACTS}
mkdir -p ${ARTIFACTS}/bin

cp target/release/mobilecoind ${ARTIFACTS}/bin/
cp target/release/mc-admin-http-gateway ${ARTIFACTS}/bin/
cp target/docker/release/mobilecoind ${ARTIFACTS}/bin/
cp target/docker/release/mc-admin-http-gateway ${ARTIFACTS}/bin/
cp ingest-enclave.css ${ARTIFACTS}/bin/
cp consensus-enclave.css ${ARTIFACTS}/bin/
cat << EOF > "${ARTIFACTS}/README.md"
Expand Down
12 changes: 12 additions & 0 deletions install_new_protoc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

echo "Installing new protoc"

set -ex

cd /tmp
apt update
apt install unzip
wget https://github.com/protocolbuffers/protobuf/releases/download/v25.2/protoc-25.2-linux-x86_64.zip
unzip protoc-25.2-linux-x86_64.zip
cp bin/protoc /usr/bin/protoc

0 comments on commit 4962b83

Please sign in to comment.