diff --git a/scripts/build-container b/scripts/build-container index 2e8c853..c1df8b4 100755 --- a/scripts/build-container +++ b/scripts/build-container @@ -39,17 +39,20 @@ my $container_registry = $ENV{'CONTAINER_REGISTRY'} || 'gitea.badhouseplants.net my $image_name = $ENV{'PACKAGE_NAME'} | $ENV{'DRONE_REPO'} || "badhouseplants/badhouseplants-net"; my $tag = "$container_registry/$image_name:$git_commit_sha"; my $custom_tag = $ENV{'CUSTOM_TAG'} || ""; +my $skip_sha_push = $ENV{'SKIP_SHA_PUSH'} || ""; my $username = "woody"; my $password = $ENV{'REGISTRY_TOKEN'} || "YOU NOT AUTHORIZED, PAL"; my $containerfile = $ENV{'CONTAINERFILE'} || "Containerfile"; my $args = $ENV{'BUILD_ARGS'}; 0 == system ("buildah login --username $username --password $password $container_registry") or die $!; 0 == system ("buildah bud -t $tag -f $containerfile $args .") or die $!; -0 == system ("buildah push $tag") or die $!; +if ( $skip_sha_push eq "" ) { + 0 == system ("buildah push $tag") or die $!; +} # --------------------------------------------------------------------------- # -- Push the latest if the branch is main # --------------------------------------------------------------------------- -if ( $git_branch eq $main_branch) { +if ( $git_branch eq $main_branch ) { my $latest_tag = "$container_registry/$image_name:latest"; 0 == system ("buildah tag $tag $latest_tag") or die $!; 0 == system ("buildah push $latest_tag") or die $!;