Skip to content

Commit

Permalink
fix: fixing devcontainers to use the sandbox docker-compose file (#9782)
Browse files Browse the repository at this point in the history
Also removed the way they were using `npx aztec-app` to command the
sandbox, they've been removed from that tool anyway
  • Loading branch information
signorecello authored Nov 9, 2024
1 parent 5299f5f commit 5246251
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 65 deletions.
8 changes: 3 additions & 5 deletions .devcontainer/scripts/onCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
TYPE=$1
NAME=$2

curl -s install.aztec.network | NON_INTERACTIVE=1 BIN_PATH=/usr/local/bin bash -s
docker compose -f $HOME/.aztec/docker-compose.yml pull
curl -s install.aztec.network | NON_INTERACTIVE=1 bash -s
docker compose -f $HOME/.aztec/docker-compose.sandbox.yml pull

if ! grep -q "PXE_URL" ~/.bashrc; then
echo "export PXE_URL=https://\$CODESPACE_NAME-8080.preview.\$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN" >> ~/.bashrc
fi

if ! grep -q "alias sandbox" ~/.bashrc; then
echo "alias sandbox=\"npx aztec-app sandbox\"" >> ~/.bashrc
fi

corepack enable

if [ "$TYPE" != "sandbox_only" ]; then
Expand Down
61 changes: 1 addition & 60 deletions .devcontainer/scripts/postAttachCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,4 @@ apt update
apt install gh
gh codespace ports visibility 8080:public -c $CODESPACE_NAME

npx aztec-app sandbox start

r=$(tput sgr0) # Reset color
bold=$(tput bold) # Bold text
g=$(tput setaf 46) # Light Green
b=$(tput setaf 21) # Bright Blue
p=$(tput setaf 13) # Magenta
y=$(tput setaf 226) # Bright Yellow
c=$(tput setaf 51) # Cyan
o=$(tput setaf 208) # Orange

# Function to print colored text
print_colored() {
case $2 in
green)
color=$g
;;
blue)
color=$b
;;
magenta)
color=$p
;;
yellow)
color=$y
;;
cyan)
color=$c
;;
orange)
color=$o
;;
*)
color=$r
;;
esac
echo "${color}$1${r}"
}

echo
echo "${bold}${c} █████╗ ███████╗████████╗███████╗ ██████╗${r}"
echo "${bold}${o}██╔══██╗╚══███╔╝╚══██╔══╝██╔════╝██╔════╝${r}"
echo "${bold}${g}███████║ ███╔╝ ██║ █████╗ ██║${r}"
echo "${bold}${b}██╔══██║ ███╔╝ ██║ ██╔══╝ ██║${r}"
echo "${bold}${p}██║ ██║███████╗ ██║ ███████╗╚██████╗${r}"
echo "${bold}${y}╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝ ╚═════╝${r}"
echo
print_colored "${bold}Your codespace is ready with your chosen box! 🎉" "cyan"
print_colored "You can now yarn dev or any other package.json script." "cyan"
echo
print_colored "Manage the running development network by running:" "magenta"
print_colored "sandbox [start, stop, logs, etc]" "green"
print_colored "example: \"sandbox logs\""
echo
print_colored "You can also connect your local environment to it." "magenta"
print_colored "To do so, prepend your commands with this codespace's sandbox URL:" "magenta"
print_colored "${PXE_URL}" "green"
print_colored "example: PXE_URL=\"${PXE_URL}\" yarn dev"
echo
print_colored "${bold}Enjoy your sandbox! 🏖️" "orange"
aztec start --sandbox

0 comments on commit 5246251

Please sign in to comment.