Skip to content

Commit 58bfbe8

Browse files
committed
fix some shell lint errors
1 parent 2b6e62f commit 58bfbe8

8 files changed

Lines changed: 26 additions & 21 deletions

File tree

attestation/configid-based/attest.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ download_command() {
9191
# Download and extract image
9292
echo "Downloading Dstack image..."
9393
local image_url="${IMAGE_DL_URL}"
94-
local image_filename="$(basename "${image_url}")"
94+
local image_filename
95+
image_filename="$(basename "${image_url}")"
9596
local image_path="${IMAGES_DIR}/${image_filename}"
9697

9798
echo "Downloading image from ${image_url}"
@@ -186,7 +187,7 @@ calc_mrs_command() {
186187

187188
# Run dstack-mr with metadata.json from the image
188189
echo "Running dstack-mr to calculate MRs..."
189-
${TOOLS_DIR}/dstack-mr -metadata "${IMAGES_DIR}/dstack-${IMAGE_VERSION}/metadata.json" \
190+
"${TOOLS_DIR}/dstack-mr" -metadata "${IMAGES_DIR}/dstack-${IMAGE_VERSION}/metadata.json" \
190191
-cpu ${VCPU_COUNT} \
191192
-memory "${MEM_SIZE}M" \
192193
-json > "known_good_mrs.json.tmp"
@@ -245,7 +246,7 @@ EOF
245246
if [ -n "$instance_id" ]; then
246247
echo "✅ App started successfully!"
247248
echo "Instance ID: $instance_id"
248-
echo $instance_id > instance_id.txt
249+
echo "$instance_id" > instance_id.txt
249250
break
250251
fi
251252
# Check for boot errors

custom-domain/dstack-ingress/build-image.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ if ! docker buildx inspect buildkit_20 &>/dev/null; then
1010
fi
1111
touch pinned-packages.txt
1212
git rev-parse HEAD > .GIT_REV
13-
docker buildx build --builder buildkit_20 --no-cache --build-arg SOURCE_DATE_EPOCH="0" --output type=docker,name=$NAME,rewrite-timestamp=true .
14-
docker run --rm --entrypoint bash $NAME -c "dpkg -l | grep '^ii' |awk '{print \$2\"=\"\$3}' | sort" > pinned-packages.txt
13+
docker buildx build --builder buildkit_20 --no-cache --build-arg SOURCE_DATE_EPOCH="0" --output type=docker,name="$NAME",rewrite-timestamp=true .
14+
docker run --rm --entrypoint bash "$NAME" -c "dpkg -l | grep '^ii' |awk '{print \$2\"=\"\$3}' | sort" > pinned-packages.txt
1515
rm .GIT_REV

custom-domain/dstack-ingress/scripts/entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ obtain_certificate() {
8080
certbot certonly --dns-cloudflare \
8181
--dns-cloudflare-credentials ~/.cloudflare/cloudflare.ini \
8282
--dns-cloudflare-propagation-seconds 120 \
83-
--email $CERTBOT_EMAIL \
83+
--email "$CERTBOT_EMAIL" \
8484
--agree-tos --no-eff-email --non-interactive \
85-
-d $DOMAIN
85+
-d "$DOMAIN"
8686
}
8787

8888
set_cname_record() {

custom-domain/dstack-ingress/scripts/generate-evidences.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ CERT_FILE=/etc/letsencrypt/live/${DOMAIN}/fullchain.pem
66

77
mkdir -p /evidences
88
cd /evidences
9-
cp ${ACME_ACCOUNT_FILE} acme-account.json
10-
cp ${CERT_FILE} cert.pem
9+
cp "${ACME_ACCOUNT_FILE}" acme-account.json
10+
cp "${CERT_FILE}" cert.pem
1111

1212
sha256sum acme-account.json cert.pem > sha256sum.txt
1313

@@ -20,5 +20,5 @@ while [ ${#PADDED_HASH} -lt 128 ]; do
2020
done
2121
QUOTED_HASH="${PADDED_HASH}"
2222

23-
curl -s --unix-socket /var/run/tappd.sock http://localhost/prpc/Tappd.RawQuote?report_data=${QUOTED_HASH} > quote.json
23+
curl -s --unix-socket /var/run/tappd.sock "http://localhost/prpc/Tappd.RawQuote?report_data=${QUOTED_HASH}" > quote.json
2424
echo "Generated evidences successfully"

launcher/build-image.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ if ! docker buildx inspect buildkit_20 &>/dev/null; then
1010
fi
1111
touch pinned-packages.txt
1212
git rev-parse HEAD > .GIT_REV
13-
docker buildx build --platform linux/amd64 --builder buildkit_20 --no-cache --build-arg SOURCE_DATE_EPOCH="0" --output type=docker,name=$NAME,rewrite-timestamp=true .
14-
docker run --rm --entrypoint bash $NAME -c "dpkg -l | grep '^ii' |awk '{print \$2\"=\"\$3}' | sort" > pinned-packages.txt
15-
rm .GIT_REV
13+
docker buildx build --platform linux/amd64 --builder buildkit_20 --no-cache --build-arg SOURCE_DATE_EPOCH="0" --output "type=docker,name=$NAME,rewrite-timestamp=true" .
14+
docker run --rm --entrypoint bash "$NAME" -c "dpkg -l | grep '^ii' |awk '{print \$2\"=\"\$3}' | sort" > pinned-packages.txt
15+
rm .GIT_REV

launcher/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ EXTERNAL_PORT=10080
66
SERVICE_NAME=server
77

88

9-
cd $WORKDIR
9+
cd $WORKDIR || exit
1010

1111
check-update() {
1212
echo "Checking for updates..."

launcher/get-latest.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ MINUTE=$(date +%-M)
2929
# Use time-based selection instead of random to create more predictable upgrade patterns
3030
# This will switch images roughly every minute
3131
if [ $((MINUTE % 2)) -eq 0 ]; then
32-
echo "nginx@sha256:d67fed8b03f1ed3d2a5e3cbc5ca268ad7a7528adfdd1220c420c8cf4e3802d9c" > $OUTPUT
32+
echo "nginx@sha256:d67fed8b03f1ed3d2a5e3cbc5ca268ad7a7528adfdd1220c420c8cf4e3802d9c" > "$OUTPUT"
3333
else
34-
echo "nginx@sha256:81aa342ba08035632898b78d46d0e11d79abeee63b3a6994a44ac34e102ef888" > $OUTPUT
34+
echo "nginx@sha256:81aa342ba08035632898b78d46d0e11d79abeee63b3a6994a44ac34e102ef888" > "$OUTPUT"
3535
fi
3636

phala-cloud-prelaunch-script/prelaunch.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ elif [[ -n "$DSTACK_AWS_ACCESS_KEY_ID" && -n "$DSTACK_AWS_SECRET_ACCESS_KEY" &&
112112
fi
113113

114114
echo "Logging in to AWS ECR..."
115-
aws ecr get-login-password --region $DSTACK_AWS_REGION | docker login --username AWS --password-stdin "$DSTACK_AWS_ECR_REGISTRY"
115+
aws ecr get-login-password --region "$DSTACK_AWS_REGION" | docker login --username AWS --password-stdin "$DSTACK_AWS_ECR_REGISTRY"
116116
if [ $? -eq 0 ]; then
117117
echo "AWS ECR login successful"
118118
notify_host_hoot_info "AWS ECR login successful"
@@ -142,17 +142,21 @@ fi
142142

143143

144144
if [[ -e /var/run/dstack.sock ]]; then
145-
export DSTACK_APP_ID=$(curl -s --unix-socket /var/run/dstack.sock http://dstack/Info | jq -j .app_id)
145+
DSTACK_APP_ID=$(curl -s --unix-socket /var/run/dstack.sock http://dstack/Info | jq -j .app_id)
146+
export DSTACK_APP_ID
146147
else
147-
export DSTACK_APP_ID=$(curl -s --unix-socket /var/run/tappd.sock http://dstack/prpc/Tappd.Info | jq -j .app_id)
148+
DSTACK_APP_ID=$(curl -s --unix-socket /var/run/tappd.sock http://dstack/prpc/Tappd.Info | jq -j .app_id)
149+
export DSTACK_APP_ID
148150
fi
149151
# Check if app-compose.json has default_gateway_domain field and DSTACK_GATEWAY_DOMAIN is not set
150152
# If true, set DSTACK_GATEWAY_DOMAIN from app-compose.json
151153
if [[ $(jq 'has("default_gateway_domain")' app-compose.json) == "true" && -z "$DSTACK_GATEWAY_DOMAIN" ]]; then
152-
export DSTACK_GATEWAY_DOMAIN=$(jq -j '.default_gateway_domain' app-compose.json)
154+
DSTACK_GATEWAY_DOMAIN=$(jq -j '.default_gateway_domain' app-compose.json)
155+
export DSTACK_GATEWAY_DOMAIN
153156
fi
154157
if [[ -n "$DSTACK_GATEWAY_DOMAIN" ]]; then
155-
export DSTACK_APP_DOMAIN=$DSTACK_APP_ID"."$DSTACK_GATEWAY_DOMAIN
158+
DSTACK_APP_DOMAIN=$DSTACK_APP_ID"."$DSTACK_GATEWAY_DOMAIN
159+
export DSTACK_APP_DOMAIN
156160
fi
157161

158162
echo "----------------------------------------------"

0 commit comments

Comments
 (0)