All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.kokuwa.maven.helm.RegistryLogoutMojo Maven / Gradle / Ivy

The newest version!
package io.kokuwa.maven.helm;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;

import io.kokuwa.maven.helm.pojo.HelmRepository;
import lombok.Setter;

/**
 * Mojo for executing "helm registry logout".
 *
 * @see helm registry logout
 * @since 6.7.0
 */
@Mojo(name = "registry-logout", defaultPhase = LifecyclePhase.DEPLOY, threadSafe = true)
@Setter
public class RegistryLogoutMojo extends AbstractHelmMojo {

	/**
	 * Set this to true to skip invoking registry-logout goal.
	 *
	 * @since 6.7.0
	 */
	@Parameter(property = "helm.registry-logout.skip", defaultValue = "false")
	private boolean skipRegistryLogout;

	@Override
	public void execute() throws MojoExecutionException {

		if (skip || skipRegistryLogout) {
			getLog().info("Skip registry logout");
			return;
		}

		HelmRepository repository = getHelmUploadRepo();
		if (repository == null) {
			getLog().warn("No upload repo found for logout, skipped.");
			return;
		}

		helm()
				.arguments("registry", "logout", repository.getUrl())
				.execute("Failed to logout from repository " + repository.getName() + " at " + repository.getUrl());
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy