Skip to content

Commit 2a4e00c

Browse files
authored
chore: store installed version instead of re-tagging (#16990)
Store version of the aztec image at install time and use as default rather than re-tagging. This will allow `--pull always` to work if running a custom dist-tag.
2 parents 9adfd77 + 121ee0b commit 2a4e00c

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

aztec-up/bin/aztec

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
NETWORK=${NETWORK:-}
5-
VERSION=${VERSION:-${NETWORK:-"latest"}}
4+
export AZTEC_PATH="${AZTEC_PATH:-$HOME/.aztec}"
5+
export VERSION="${VERSION:-$(cat "$AZTEC_PATH/default_version")}"
6+
export DOCKER_REPO="${DOCKER_REPO:-"aztecprotocol/aztec"}"
67

7-
DOCKER_REPO=${DOCKER_REPO:-"aztecprotocol/aztec"}
88
# Take copy of command-line arguments, so we can mutate to parse.
99
if [ $# -eq 0 ]; then
1010
args=("--help")
1111
else
1212
args=("$@")
1313
fi
14+
1415
while [ "$#" -gt 0 ]; do
1516
case $1 in
1617
-p | --port)
@@ -35,14 +36,6 @@ while [ "$#" -gt 0 ]; do
3536
ADMIN_PORT="$2"
3637
shift 2
3738
;;
38-
--pxe.network)
39-
# Set version to user-specified network (e.g. 'devnet')
40-
VERSION="$2"
41-
echo "Using aztecprotocol/aztec:$VERSION"
42-
# Turn on proving if connecting to a network.
43-
export PXE_PROVER_ENABLED=1
44-
shift 2
45-
;;
4639
--help)
4740
NO_PORT_FORWARDING=1
4841
shift 1

aztec-up/bin/aztec-install

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ else
1717
NON_INTERACTIVE=${NON_INTERACTIVE:-0}
1818
fi
1919

20-
AZTEC_PATH=$HOME/.aztec
20+
AZTEC_PATH="${AZTEC_PATH:-$HOME/.aztec}"
2121
BIN_PATH=${BIN_PATH:-$AZTEC_PATH/bin}
2222

2323
# Define version if specified, otherwise set to "latest".
@@ -146,15 +146,14 @@ if ! docker info &>/dev/null; then
146146
exit 1
147147
fi
148148

149+
mkdir -p "$AZTEC_PATH"
150+
TMP_VERSION_FILE="$(mktemp)"
151+
echo "$VERSION" > "$TMP_VERSION_FILE"
152+
149153
# Pull the aztec container.
150154
if [ -z "${SKIP_PULL:-}" ]; then
151155
info "Pulling aztec version $VERSION..."
152156
docker pull aztecprotocol/aztec:$VERSION
153-
154-
# If not latest, retag to be latest so it runs from scripts.
155-
if [ $VERSION != "latest" ]; then
156-
docker tag aztecprotocol/aztec:$VERSION aztecprotocol/aztec:latest
157-
fi
158157
fi
159158

160159
info "Installing scripts in $BIN_PATH..."
@@ -165,6 +164,7 @@ install_bin aztec-up
165164
install_bin aztec-nargo
166165
install_bin aztec-postprocess-contract
167166
install_bin aztec-wallet
167+
mv "$TMP_VERSION_FILE" "$AZTEC_PATH/default_version"
168168

169169
update_path_env_var $BIN_PATH
170170

0 commit comments

Comments
 (0)