-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add images save / load scripts (#181)
* Add images save / load scripts * Some fixes * Fixes
- Loading branch information
1 parent
b794b66
commit 12d0943
Showing
3 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ zitadel | |
zitadel-db | ||
.DS_Store | ||
.idea | ||
.env | ||
.env | ||
datalens-images.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
# chmod +x ./scripts/load-images.sh | ||
# ./scripts/load-images.sh | ||
|
||
file=${1:-"datalens-images.gz"} | ||
|
||
gzip -cd ${file} | docker load |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# chmod +x ./scripts/save-images.sh | ||
# ./scripts/save-images.sh | ||
|
||
get_docker_compose_command() { | ||
if command -v docker-compose &>/dev/null; then | ||
echo "docker-compose" | ||
return 0 | ||
elif command -v docker compose &>/dev/null; then | ||
echo "docker compose" | ||
return 0 | ||
else | ||
echo "Compose plugin for docker is not installed. e.g. sudo apt install docker-compose-plugin" >/dev/stderr | ||
exit 1 | ||
fi | ||
} | ||
|
||
file=${1:-"docker-compose.yml"} | ||
|
||
if [ ! -z ${file} ] && [ -f ${file} ]; then | ||
echo -e "\nPulling images...\n" | ||
images=`grep image: ${file} | awk '{print $2}'` | ||
$(get_docker_compose_command) -f ${file} pull | ||
|
||
echo -e "\nSaving images...\n" | ||
docker save ${images} | gzip > datalens-images.gz | ||
|
||
echo "Images saved to datalens-images.gz" | ||
else | ||
echo "Incorrect file path" | ||
fi |