Search in sources :

Example 1 with PigConfiguration

use of org.jboss.pnc.bacon.pig.impl.config.PigConfiguration in project bacon by project-ncl.

the class ConfigReaderTest method shouldNotOverrideEnvironmentNameWithId.

@Test
void shouldNotOverrideEnvironmentNameWithId() {
    PigConfiguration config = loadBuildConfig("/build-config-environment-override.yaml");
    assertNotNull(config);
    for (BuildConfig build : config.getBuilds()) {
        if (build.getName().equals("profile-injection-1.0.0")) {
            if (build.getRawEnvironmentId() != null && build.getEnvironmentName().equals("OpenJDK 1.8")) {
                fail("The envId from defaultBuildParameters should not override if environmentName is declared");
            }
        }
    }
}
Also used : PigConfiguration(org.jboss.pnc.bacon.pig.impl.config.PigConfiguration) BuildConfig(org.jboss.pnc.bacon.pig.impl.config.BuildConfig) Test(org.junit.jupiter.api.Test)

Example 2 with PigConfiguration

use of org.jboss.pnc.bacon.pig.impl.config.PigConfiguration in project bacon by project-ncl.

the class ConfigReaderTest method shouldExpandVariables.

@Test
void shouldExpandVariables() {
    PigConfiguration config = loadBuildConfig("/build-config-VarUsage.yaml");
    assertNotNull(config);
    if (!config.getVersion().equals("3.5.1")) {
        fail("Version does not match predefined variable");
    }
}
Also used : PigConfiguration(org.jboss.pnc.bacon.pig.impl.config.PigConfiguration) Test(org.junit.jupiter.api.Test)

Example 3 with PigConfiguration

use of org.jboss.pnc.bacon.pig.impl.config.PigConfiguration in project bacon by project-ncl.

the class QuarkusCommunityDepAnalyzerTest method test.

@Test
@Disabled
void test() {
    File tempFolder = Files.newTemporaryFolder();
    System.out.println(tempFolder.getAbsolutePath());
    File extras = new File(tempFolder, "extras");
    extras.mkdir();
    RepositoryData repositoryData = new RepositoryData();
    repositoryData.setRepositoryPath(Paths.get(REPO_ZIP_PATH));
    PigContext context = new PigContext();
    PigConfiguration pigConfig = new PigConfiguration();
    Flow flow = new Flow();
    RepoGenerationData repositoryGeneration = new RepoGenerationData();
    repositoryGeneration.setBomArtifactId("quarkus-bom");
    flow.setRepositoryGeneration(repositoryGeneration);
    pigConfig.setFlow(flow);
    Map<String, Map<String, ?>> addons = new HashMap<>();
    Map<String, Object> depAnalyzerConfig = new HashMap<>();
    depAnalyzerConfig.put("skippedExtensions", asList("quarkus-resteasy-reactive-kotlin", "quarkus-mongodb-client"));
    addons.put(QuarkusCommunityDepAnalyzer.NAME, depAnalyzerConfig);
    pigConfig.setAddons(addons);
    context.setPigConfiguration(pigConfig);
    context.setRepositoryData(repositoryData);
    PigContext.setInstance(context);
    Config instance = new Config();
    ConfigProfile configProfile = new ConfigProfile();
    PigConfig pig = new PigConfig();
    pig.setIndyUrl(INDY_URL);
    configProfile.setPig(pig);
    DaConfig da = new DaConfig();
    da.setUrl(DA_URL);
    configProfile.setDa(da);
    instance.setActiveProfile(configProfile);
    Config.setInstance(instance);
    QuarkusCommunityDepAnalyzer analyzer = new QuarkusCommunityDepAnalyzer(pigConfig, Collections.emptyMap(), tempFolder.getAbsolutePath(), extras.getAbsolutePath(), new Deliverables());
    analyzer.trigger();
}
Also used : HashMap(java.util.HashMap) PigConfig(org.jboss.pnc.bacon.config.PigConfig) DaConfig(org.jboss.pnc.bacon.config.DaConfig) Config(org.jboss.pnc.bacon.config.Config) PigConfiguration(org.jboss.pnc.bacon.pig.impl.config.PigConfiguration) PigContext(org.jboss.pnc.bacon.pig.impl.PigContext) ConfigProfile(org.jboss.pnc.bacon.config.ConfigProfile) RepositoryData(org.jboss.pnc.bacon.pig.impl.repo.RepositoryData) Flow(org.jboss.pnc.bacon.pig.impl.config.Flow) DaConfig(org.jboss.pnc.bacon.config.DaConfig) Deliverables(org.jboss.pnc.bacon.pig.impl.documents.Deliverables) PigConfig(org.jboss.pnc.bacon.config.PigConfig) RepoGenerationData(org.jboss.pnc.bacon.pig.impl.config.RepoGenerationData) File(java.io.File) HashMap(java.util.HashMap) Map(java.util.Map) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 4 with PigConfiguration

use of org.jboss.pnc.bacon.pig.impl.config.PigConfiguration in project bacon by project-ncl.

the class QuarkusPostBuildAnalyzerTest method preConfig.

private PigConfiguration preConfig() {
    PigConfiguration config = new PigConfiguration();
    HashMap<String, Map<String, ?>> addons = new HashMap<>();
    HashMap<String, Object> addOnConfig = new HashMap<>();
    addOnConfig.put("stagingPath", "http://localhost:8080/");
    addOnConfig.put("productName", "quarkus");
    addons.put(QuarkusPostBuildAnalyzer.NAME, addOnConfig);
    config.setAddons(addons);
    return config;
}
Also used : HashMap(java.util.HashMap) PigConfiguration(org.jboss.pnc.bacon.pig.impl.config.PigConfiguration) Map(java.util.Map) HashMap(java.util.HashMap)

Example 5 with PigConfiguration

use of org.jboss.pnc.bacon.pig.impl.config.PigConfiguration in project bacon by project-ncl.

the class PigFacade method generateJavadoc.

public static void generateJavadoc() {
    abortIfContextDataAbsent();
    PigContext context = context();
    context.getDeliverables().setJavadocZipName(context.getPrefix() + "-javadoc.zip");
    PigConfiguration pigConfiguration = context.getPigConfiguration();
    Map<String, PncBuild> builds = context.getBuilds();
    new JavadocManager(pigConfiguration, context.getReleasePath(), context.getDeliverables(), builds).prepare();
}
Also used : JavadocManager(org.jboss.pnc.bacon.pig.impl.javadoc.JavadocManager) PigConfiguration(org.jboss.pnc.bacon.pig.impl.config.PigConfiguration) PigContext(org.jboss.pnc.bacon.pig.impl.PigContext) PncBuild(org.jboss.pnc.bacon.pig.impl.pnc.PncBuild)

Aggregations

PigConfiguration (org.jboss.pnc.bacon.pig.impl.config.PigConfiguration)13 Test (org.junit.jupiter.api.Test)6 PigContext (org.jboss.pnc.bacon.pig.impl.PigContext)4 PncBuild (org.jboss.pnc.bacon.pig.impl.pnc.PncBuild)4 RepositoryData (org.jboss.pnc.bacon.pig.impl.repo.RepositoryData)3 File (java.io.File)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 RepoGenerationData (org.jboss.pnc.bacon.pig.impl.config.RepoGenerationData)2 Deliverables (org.jboss.pnc.bacon.pig.impl.documents.Deliverables)2 BuildInfoCollector (org.jboss.pnc.bacon.pig.impl.pnc.BuildInfoCollector)2 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1 Config (org.jboss.pnc.bacon.config.Config)1 ConfigProfile (org.jboss.pnc.bacon.config.ConfigProfile)1 DaConfig (org.jboss.pnc.bacon.config.DaConfig)1 PigConfig (org.jboss.pnc.bacon.config.PigConfig)1 BuildConfig (org.jboss.pnc.bacon.pig.impl.config.BuildConfig)1 Flow (org.jboss.pnc.bacon.pig.impl.config.Flow)1