From 65f7fd0131924afe721c6c4c959fc7f1647cfa5e Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Mon, 18 Oct 2021 16:06:04 +0300 Subject: [PATCH] Deployments: change the outputs of appimage build and docker build to conform to the naming convention of InfectionMonkey-v*.* AppImages are built into InfectionMonkey-v1.11.0.AppImage Docker is build into InfectionMonkey-docker-v1.11.0.tgz --- build_scripts/appimage/appimage.sh | 5 +++-- build_scripts/appimage/clean.sh | 4 ++-- build_scripts/docker/docker.sh | 13 +++++++------ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/build_scripts/appimage/appimage.sh b/build_scripts/appimage/appimage.sh index 4b575e568..39d606e3d 100755 --- a/build_scripts/appimage/appimage.sh +++ b/build_scripts/appimage/appimage.sh @@ -119,7 +119,8 @@ build_package() { --deploy-deps-only="$MONGO_PATH/bin/mongod"\ --output appimage - move_package_to_dist_dir $dist_dir + dst_name="InfectionMonkey-v$version.AppImage" + move_package_to_dist_dir $dist_dir $dst_name popd } @@ -135,5 +136,5 @@ set_version() { } move_package_to_dist_dir() { - mv Infection_Monkey*.AppImage "$1/" + mv Infection_Monkey*.AppImage "$1/$2" } diff --git a/build_scripts/appimage/clean.sh b/build_scripts/appimage/clean.sh index 6ce76cd32..98f89b7e4 100755 --- a/build_scripts/appimage/clean.sh +++ b/build_scripts/appimage/clean.sh @@ -8,5 +8,5 @@ APPIMAGE_DIR="$(realpath $(dirname $BASH_SOURCE[0]))" rm -rf "$HOME/git/monkey" rm -rf "$HOME/.monkey_island" rm -rf "$APPIMAGE_DIR/squashfs-root" -rm "$APPIMAGE_DIR"/Infection_Monkey*x86_64.AppImage -rm "$APPIMAGE_DIR/../dist/Infection_Monkey*x86_64.AppImage" +rm "$APPIMAGE_DIR"/Infection_Monkey*.AppImage +rm "$APPIMAGE_DIR/../dist/InfectionMonkey*.AppImage" diff --git a/build_scripts/docker/docker.sh b/build_scripts/docker/docker.sh index 6f55ff6a0..24fdd6455 100755 --- a/build_scripts/docker/docker.sh +++ b/build_scripts/docker/docker.sh @@ -1,5 +1,4 @@ DOCKER_DIR="$(realpath $(dirname $BASH_SOURCE[0]))" -OUTPUT_NAME_TGZ="$DOCKER_DIR/infection_monkey_docker_$(date +%Y%m%d_%H%M%S).tgz" source "$DOCKER_DIR/../common.sh" @@ -41,12 +40,14 @@ build_package() { pushd ./docker docker_image_name="guardicore/monkey-island:$version" - tar_name="$DOCKER_DIR/dk.monkeyisland.$version.tar" + tar_name="$DOCKER_DIR/InfectionMonkey-docker-v$version.tar" build_docker_image_tar "$docker_image_name" "$tar_name" - build_docker_image_tgz "$tar_name" "$version" - move_package_to_dist_dir $dist_dir + tgz_name="$DOCKER_DIR/InfectionMonkey-docker-v$version.tgz" + build_docker_image_tgz "$tar_name" "$tgz_name" + + move_package_to_dist_dir $tgz_name $dist_dir popd } @@ -60,9 +61,9 @@ build_docker_image_tgz() { mkdir tgz mv "$1" ./tgz cp ./DOCKER_README.md ./tgz/README.md - tar -C ./tgz -cvf "$OUTPUT_NAME_TGZ" --gzip . + tar -C ./tgz -cvf "$2" --gzip . } move_package_to_dist_dir() { - mv $OUTPUT_NAME_TGZ "$1/" + mv "$1" "$2/" }