Skip to content

Commit c88f21a

Browse files
committed
Update and rename create-image-from-s3.sh to create-image-from-http.sh
1 parent f8fc935 commit c88f21a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

examples/create-image-from-s3.sh renamed to examples/create-image-from-http.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ fi
1414

1515

1616
NAME=$(basename "${URL}")
17-
NAME=${NAME%.*}-$(date +%Y-%m-%d_%H:%M)
17+
SNAPSHOT_NAME=${NAME%.*}-$(date +%Y-%m-%d_%H:%M)
18+
IMAGE_NAME=${IMAGE_NAME:-$SNAPSHOT_NAME}
19+
IMAGE_BOOTSCRIPT=${IMAGE_BOOTSCRIPT:stable}
1820
VOLUME_SIZE=${VOLUME_SIZE:-50GB}
1921
KEY=$(cat ~/.ssh/id_rsa.pub | awk '{ print $1" "$2 }' | tr ' ' '_')
2022

@@ -50,12 +52,12 @@ echo "[+] Server stopped"
5052

5153

5254
echo "[+] Creating a snapshot of nbd1"
53-
SNAPSHOT=$(scw commit --volume=1 "${SERVER}" "${NAME}")
55+
SNAPSHOT=$(scw commit --volume=1 "${SERVER}" "${SNAPSHOT_NAME}")
5456
echo "[+] Snapshot ${SNAPSHOT} created"
5557

5658

5759
echo "[+] Creating an image based of the snapshot"
58-
IMAGE=$(scw tag "${SNAPSHOT}" "${NAME}")
60+
IMAGE=$(scw tag --bootscript="${IMAGE_BOOTSCRIPT}" "${SNAPSHOT}" "${IMAGE_NAME}")
5961
echo "[+] Image created: ${IMAGE}"
6062

6163

0 commit comments

Comments
 (0)