
pl.allegro.tech.build.axion.release.PushReleaseTask.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of axion-release-plugin Show documentation
Show all versions of axion-release-plugin Show documentation
Gradle release and version management plugin
The newest version!
package pl.allegro.tech.build.axion.release
import org.gradle.api.tasks.TaskAction
import pl.allegro.tech.build.axion.release.domain.Releaser
import pl.allegro.tech.build.axion.release.domain.scm.ScmPushResult
import pl.allegro.tech.build.axion.release.domain.scm.ScmPushResultOutcome
import pl.allegro.tech.build.axion.release.infrastructure.di.VersionResolutionContext
abstract class PushReleaseTask extends BaseAxionTask {
@TaskAction
void release() {
VersionResolutionContext context = resolutionContext()
Releaser releaser = context.releaser()
ScmPushResult result = releaser.pushRelease()
if (result.outcome === ScmPushResultOutcome.FAILED) {
def status = result.failureStatus
def message = result.remoteMessage.orElse("Unknown error during push")
logger.error("remote status: ${status}")
logger.error("remote message: ${message}")
throw new ReleaseFailedException(message)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy