Deployments: Rename docker deployment only if a version is not specified

With this change, Jenkins will output docker packages in the following naming conventions:

Develop: InfectionMonkey-docker-$commit_number.tgz

Release: InfectionMonkey-docker-v$version.tgz
This commit is contained in:
VakarisZ 2021-10-18 17:45:14 +03:00 committed by Ilija Lazoroski
parent 226c72df5f
commit 25df96da63
1 changed files with 8 additions and 2 deletions

View File

@ -39,12 +39,18 @@ build_package() {
local dist_dir=$2
pushd ./docker
if [ -n "$1" ]; then
version="v$(git rev-parse --short HEAD)"
else
version="v$version"
fi
docker_image_name="guardicore/monkey-island:$version"
tar_name="$DOCKER_DIR/InfectionMonkey-docker-v$version.tar"
tar_name="$DOCKER_DIR/InfectionMonkey-docker-$version.tar"
build_docker_image_tar "$docker_image_name" "$tar_name"
tgz_name="$DOCKER_DIR/InfectionMonkey-docker-v$version.tgz"
tgz_name="$DOCKER_DIR/InfectionMonkey-docker-$version.tgz"
build_docker_image_tgz "$tar_name" "$tgz_name"
move_package_to_dist_dir $tgz_name $dist_dir