#!/bin/bash set -e script_dir=$(dirname "$0") cd "$script_dir/.." prerequisites=$1 if [ "$prerequisites" == "--prep" ]; then echo "Preparing the packager environment" apt update && apt install -y openssh-client rustup install 1.84.0 rustup install stable-x86_64-unknown-linux-gnu rustup default stable rustup target add x86_64-unknown-linux-musl fi if [ -n "$TEST" ]; then echo "Building the hacker-challenge with test feature" occlum-cargo build --release --features test else echo "Building the hacker-challenge" occlum-cargo build --release fi strip target/x86_64-unknown-linux-musl/release/hacker-challenge sha256sum target/x86_64-unknown-linux-musl/release/hacker-challenge cat > challenge.yaml <