Skip to content

Instantly share code, notes, and snippets.

@david-crespo
Last active May 31, 2024 19:40
Show Gist options
  • Save david-crespo/d8aa7ea1afb877ff585e6ad90fc5bc2c to your computer and use it in GitHub Desktop.
Save david-crespo/d8aa7ea1afb877ff585e6ad90fc5bc2c to your computer and use it in GitHub Desktop.
#! /usr/bin/env bash
# This script relies on yq to parse TOML. brew install yq
set -eux
DENDRITE_BIN_DIR="$(pwd)/out/dendrite-stub/root/opt/oxide/dendrite/bin"
MGD_BIN_DIR="$(pwd)/out/mgd/root/opt/oxide/mgd/bin"
DENDRITE_COMMIT="$(yq '.package.dendrite-stub.source.commit' package-manifest.toml)"
MGD_COMMIT="$(yq '.package.mgd.source.commit' package-manifest.toml)"
OSTYPE=linux-gnu cargo xtask download dendrite-stub
OSTYPE=linux-gnu cargo xtask download maghemite-mgd
cd ~/oxide/dendrite
git fetch --all && git checkout $DENDRITE_COMMIT
cargo build -p dpd --release --features=tofino_stub
cargo build -p swadm --release
cp target/release/dpd "$DENDRITE_BIN_DIR/dpd"
cp target/release/swadm "$DENDRITE_BIN_DIR/swadm"
cd ~/oxide/maghemite
git fetch --all && git checkout $MGD_COMMIT
cargo build --bin mgd --no-default-features
cp target/debug/mgd "$MGD_BIN_DIR/mgd"
echo "now add the bin dirs to your path"
echo ""
echo " export PATH=\"$DENDRITE_BIN_DIR:\$PATH\""
echo " export PATH=\"$MGD_BIN_DIR:\$PATH\""
@charliepark
Copy link

charliepark commented Nov 29, 2023

Make sure you https auth, using the GitHub cli tool before using this

brew install gh
gh auth login -p https

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment