Search in sources :

Example 1 with SystemPipelineDescriptor

use of org.guvnor.ala.pipeline.SystemPipelineDescriptor in project kie-wb-common by kiegroup.

the class ProvisioningPipelinesProducer method getWildflyPipeline.

/**
 * Produces a pipeline for provisioning building an provisioning war applications into an Wildlfy server.
 */
@Produces
public SystemPipelineDescriptor getWildflyPipeline() {
    return new SystemPipelineDescriptor() {

        @Override
        public Optional<ProviderType> getProviderType() {
            return Optional.of(WildflyProviderType.instance());
        }

        @Override
        public Pipeline getPipeline() {
            // Create Wildfly Pipeline Configuration
            final GitConfig gitConfig = new GitConfig() {
            };
            final MavenProjectConfig projectConfig = new MavenProjectConfig() {
            };
            final MavenBuildConfig mavenBuildConfig = new MavenBuildConfig() {

                @Override
                public List<String> getGoals() {
                    final List<String> result = new ArrayList<>();
                    result.add("clean");
                    result.add("package");
                    return result;
                }

                @Override
                public Properties getProperties() {
                    final Properties result = new Properties();
                    result.setProperty("failIfNoTests", "false");
                    return result;
                }
            };
            final MavenBuildExecConfig mavenBuildExecConfig = new MavenBuildExecConfig() {
            };
            final WildflyProviderConfig wildflyProviderConfig = new WildflyProviderConfig() {
            };
            final ContextAwareWildflyRuntimeExecConfig wildflyRuntimeExecConfig = new ContextAwareWildflyRuntimeExecConfig() {
            };
            final Pipeline pipeline = PipelineFactory.newBuilder().addConfigStage("Git Source", gitConfig).addConfigStage("Maven Project", projectConfig).addConfigStage("Maven Build Config", mavenBuildConfig).addConfigStage("Maven Build", mavenBuildExecConfig).addConfigStage("Wildfly Provider Config", wildflyProviderConfig).addConfigStage("Wildfly Runtime Exec", wildflyRuntimeExecConfig).buildAs("source-to-wildlfy-provisioning");
            return pipeline;
        }
    };
}
Also used : WildflyProviderConfig(org.guvnor.ala.wildfly.config.WildflyProviderConfig) ArrayList(java.util.ArrayList) MavenBuildConfig(org.guvnor.ala.build.maven.config.MavenBuildConfig) Properties(java.util.Properties) Pipeline(org.guvnor.ala.pipeline.Pipeline) MavenBuildExecConfig(org.guvnor.ala.build.maven.config.MavenBuildExecConfig) SystemPipelineDescriptor(org.guvnor.ala.pipeline.SystemPipelineDescriptor) MavenProjectConfig(org.guvnor.ala.build.maven.config.MavenProjectConfig) ContextAwareWildflyRuntimeExecConfig(org.guvnor.ala.wildfly.config.impl.ContextAwareWildflyRuntimeExecConfig) GitConfig(org.guvnor.ala.source.git.config.GitConfig) ProviderType(org.guvnor.ala.runtime.providers.ProviderType) WildflyProviderType(org.guvnor.ala.wildfly.model.WildflyProviderType) Produces(javax.enterprise.inject.Produces)

Aggregations

ArrayList (java.util.ArrayList)1 Properties (java.util.Properties)1 Produces (javax.enterprise.inject.Produces)1 MavenBuildConfig (org.guvnor.ala.build.maven.config.MavenBuildConfig)1 MavenBuildExecConfig (org.guvnor.ala.build.maven.config.MavenBuildExecConfig)1 MavenProjectConfig (org.guvnor.ala.build.maven.config.MavenProjectConfig)1 Pipeline (org.guvnor.ala.pipeline.Pipeline)1 SystemPipelineDescriptor (org.guvnor.ala.pipeline.SystemPipelineDescriptor)1 ProviderType (org.guvnor.ala.runtime.providers.ProviderType)1 GitConfig (org.guvnor.ala.source.git.config.GitConfig)1 WildflyProviderConfig (org.guvnor.ala.wildfly.config.WildflyProviderConfig)1 ContextAwareWildflyRuntimeExecConfig (org.guvnor.ala.wildfly.config.impl.ContextAwareWildflyRuntimeExecConfig)1 WildflyProviderType (org.guvnor.ala.wildfly.model.WildflyProviderType)1