Commit 174a43ce authored by Christian Kuhn's avatar Christian Kuhn Committed by Susanne Moog
Browse files

[TASK] bamboo plan for security pre-merge tests

Change-Id: Ic1e1d0f8fd1a128e542e7cada389d681ac41e10f
Resolves: #88265
Releases: master, 9.5, 8.7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60648


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Susanne Moog's avatarSusanne Moog <look@susi.dev>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Susanne Moog's avatarSusanne Moog <look@susi.dev>
parent d619ecfc
......@@ -80,43 +80,43 @@ public class PreMergeSpec extends AbstractCoreSpec {
// EARLY stage
ArrayList<Job> jobsEarlyStage = new ArrayList<Job>();
jobsEarlyStage.add(this.getJobCglCheckGitCommit("PHP72"));
jobsEarlyStage.add(this.getJobComposerValidate("PHP72"));
jobsEarlyStage.add(this.getJobCglCheckGitCommit("PHP72", false));
jobsEarlyStage.add(this.getJobComposerValidate("PHP72", false));
Stage stageEarly = new Stage("Early")
.jobs(jobsEarlyStage.toArray(new Job[jobsEarlyStage.size()]));
// MAIN stage
ArrayList<Job> jobsMainStage = new ArrayList<Job>();
jobsMainStage.add(this.getJobAcceptanceTestInstallMysql(0, "PHP73", this.getTaskComposerInstall("PHP73")));
jobsMainStage.add(this.getJobAcceptanceTestInstallPgsql(0, "PHP72", this.getTaskComposerInstall("PHP72")));
jobsMainStage.add(this.getJobAcceptanceTestInstallSqlite(0, "PHP72", this.getTaskComposerInstall("PHP72")));
jobsMainStage.add(this.getJobAcceptanceTestInstallMysql(0, "PHP73", this.getTaskComposerInstall("PHP73"), false));
jobsMainStage.add(this.getJobAcceptanceTestInstallPgsql(0, "PHP72", this.getTaskComposerInstall("PHP72"), false));
jobsMainStage.add(this.getJobAcceptanceTestInstallSqlite(0, "PHP72", this.getTaskComposerInstall("PHP72"), false));
jobsMainStage.addAll(this.getJobsAcceptanceTestsBackendMysql(0, this.numberOfAcceptanceTestJobs, "PHP73", this.getTaskComposerInstall("PHP73")));
jobsMainStage.addAll(this.getJobsAcceptanceTestsBackendMysql(0, this.numberOfAcceptanceTestJobs, "PHP73", this.getTaskComposerInstall("PHP73"), false));
jobsMainStage.add(this.getJobIntegrationAnnotations(0, "PHP72", this.getTaskComposerInstall("PHP72")));
jobsMainStage.add(this.getJobIntegrationAnnotations(0, "PHP72", this.getTaskComposerInstall("PHP72"), false));
jobsMainStage.add(this.getJobIntegrationVarious(0, "PHP72", this.getTaskComposerInstall("PHP72")));
jobsMainStage.add(this.getJobIntegrationVarious(0, "PHP72", this.getTaskComposerInstall("PHP72"), false));
jobsMainStage.addAll(this.getJobsFunctionalTestsMysql(0, this.numberOfFunctionalMysqlJobs, "PHP73", this.getTaskComposerInstall("PHP73")));
jobsMainStage.addAll(this.getJobsFunctionalTestsMysql(0, this.numberOfFunctionalMysqlJobs, "PHP73", this.getTaskComposerInstall("PHP73"), false));
// mssql functionals are not executed as pre-merge
// jobsMainStage.addAll(this.getJobsFunctionalTestsMssql(0, this.numberOfFunctionalMssqlJobs, "PHP72", this.getTaskComposerInstall("PHP72")));
jobsMainStage.addAll(this.getJobsFunctionalTestsPgsql(0, this.numberOfFunctionalPgsqlJobs, "PHP72", this.getTaskComposerInstall("PHP72")));
jobsMainStage.addAll(this.getJobsFunctionalTestsSqlite(0, this.numberOfFunctionalSqliteJobs, "PHP72", this.getTaskComposerInstall("PHP72")));
// jobsMainStage.addAll(this.getJobsFunctionalTestsMssql(0, this.numberOfFunctionalMssqlJobs, "PHP72", this.getTaskComposerInstall("PHP72"), false));
jobsMainStage.addAll(this.getJobsFunctionalTestsPgsql(0, this.numberOfFunctionalPgsqlJobs, "PHP72", this.getTaskComposerInstall("PHP72"), false));
jobsMainStage.addAll(this.getJobsFunctionalTestsSqlite(0, this.numberOfFunctionalSqliteJobs, "PHP72", this.getTaskComposerInstall("PHP72"), false));
jobsMainStage.add(this.getJobUnitJavaScript(0, "PHP72", this.getTaskComposerInstall("PHP72")));
jobsMainStage.add(this.getJobUnitJavaScript(0, "PHP72", this.getTaskComposerInstall("PHP72"), false));
jobsMainStage.add(this.getJobLintPhp("PHP72"));
jobsMainStage.add(this.getJobLintPhp("PHP73"));
jobsMainStage.add(this.getJobLintPhp("PHP72", false));
jobsMainStage.add(this.getJobLintPhp("PHP73", false));
jobsMainStage.add(this.getJobLintScssTs("PHP72"));
jobsMainStage.add(this.getJobLintScssTs("PHP72", false));
jobsMainStage.add(this.getJobUnitPhp(0, "PHP72", this.getTaskComposerInstall("PHP72")));
jobsMainStage.add(this.getJobUnitPhp(0, "PHP73", this.getTaskComposerInstall("PHP73")));
jobsMainStage.add(this.getJobUnitDeprecatedPhp(0, "PHP72", this.getTaskComposerInstall("PHP72")));
jobsMainStage.add(this.getJobUnitDeprecatedPhp(0, "PHP73", this.getTaskComposerInstall("PHP73")));
jobsMainStage.addAll(this.getJobUnitPhpRandom(0, this.numberOfUnitRandomOrderJobs, "PHP72", this.getTaskComposerInstall("PHP72")));
jobsMainStage.addAll(this.getJobUnitPhpRandom(0, this.numberOfUnitRandomOrderJobs, "PHP73", this.getTaskComposerInstall("PHP73")));
jobsMainStage.add(this.getJobUnitPhp(0, "PHP72", this.getTaskComposerInstall("PHP72"), false));
jobsMainStage.add(this.getJobUnitPhp(0, "PHP73", this.getTaskComposerInstall("PHP73"), false));
jobsMainStage.add(this.getJobUnitDeprecatedPhp(0, "PHP72", this.getTaskComposerInstall("PHP72"), false));
jobsMainStage.add(this.getJobUnitDeprecatedPhp(0, "PHP73", this.getTaskComposerInstall("PHP73"), false));
jobsMainStage.addAll(this.getJobUnitPhpRandom(0, this.numberOfUnitRandomOrderJobs, "PHP72", this.getTaskComposerInstall("PHP72"), false));
jobsMainStage.addAll(this.getJobUnitPhpRandom(0, this.numberOfUnitRandomOrderJobs, "PHP73", this.getTaskComposerInstall("PHP73"), false));
Stage stageMainStage = new Stage("Main stage")
.jobs(jobsMainStage.toArray(new Job[jobsMainStage.size()]));
......
package core;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
import java.util.ArrayList;
import com.atlassian.bamboo.specs.api.BambooSpec;
import com.atlassian.bamboo.specs.api.builders.AtlassianModule;
import com.atlassian.bamboo.specs.api.builders.BambooKey;
import com.atlassian.bamboo.specs.api.builders.Variable;
import com.atlassian.bamboo.specs.api.builders.notification.AnyNotificationRecipient;
import com.atlassian.bamboo.specs.api.builders.notification.Notification;
import com.atlassian.bamboo.specs.api.builders.plan.Job;
import com.atlassian.bamboo.specs.api.builders.plan.Plan;
import com.atlassian.bamboo.specs.api.builders.plan.Stage;
import com.atlassian.bamboo.specs.api.builders.plan.branches.BranchCleanup;
import com.atlassian.bamboo.specs.api.builders.plan.branches.PlanBranchManagement;
import com.atlassian.bamboo.specs.api.builders.project.Project;
import com.atlassian.bamboo.specs.api.builders.requirement.Requirement;
import com.atlassian.bamboo.specs.builders.notification.PlanCompletedNotification;
import com.atlassian.bamboo.specs.builders.task.ScriptTask;
import com.atlassian.bamboo.specs.builders.trigger.RemoteTrigger;
import com.atlassian.bamboo.specs.builders.trigger.RepositoryPollingTrigger;
import com.atlassian.bamboo.specs.model.task.ScriptTaskProperties;
import com.atlassian.bamboo.specs.util.BambooServer;
/**
* Core master security test plan.
*/
@BambooSpec
public class SecuritySpec extends AbstractCoreSpec {
protected static String planName = "Core master security";
protected static String planKey = "GTS";
protected int numberOfAcceptanceTestJobs = 10;
protected int numberOfFunctionalMysqlJobs = 10;
protected int numberOfFunctionalMssqlJobs = 10;
protected int numberOfFunctionalPgsqlJobs = 10;
protected int numberOfFunctionalSqliteJobs = 10;
protected int numberOfUnitRandomOrderJobs = 1;
/**
* Run main to publish plan on Bamboo
*/
public static void main(final String[] args) throws Exception {
// By default credentials are read from the '.credentials' file.
BambooServer bambooServer = new BambooServer(bambooServerName);
bambooServer.publish(new SecuritySpec().createPlan());
bambooServer.publish(new SecuritySpec().getSecurityPlanPermissions(projectKey, planKey));
}
/**
* Core master pre-merge plan is in "TYPO3 core" project of bamboo
*/
Project project() {
return new Project().name(projectName).key(projectKey);
}
/**
* Returns full Plan definition
*/
Plan createPlan() {
// PREPARATION stage
ArrayList<Job> jobsPreparationStage = new ArrayList<Job>();
jobsPreparationStage.add(this.getJobBuildLabels());
Stage stagePreparation = new Stage("Preparation")
.jobs(jobsPreparationStage.toArray(new Job[jobsPreparationStage.size()]));
// EARLY stage
ArrayList<Job> jobsEarlyStage = new ArrayList<Job>();
jobsEarlyStage.add(this.getJobCglCheckGitCommit("PHP72", true));
jobsEarlyStage.add(this.getJobComposerValidate("PHP72", true));
Stage stageEarly = new Stage("Early")
.jobs(jobsEarlyStage.toArray(new Job[jobsEarlyStage.size()]));
// MAIN stage
ArrayList<Job> jobsMainStage = new ArrayList<Job>();
jobsMainStage.add(this.getJobAcceptanceTestInstallMysql(0, "PHP73", this.getTaskComposerInstall("PHP73"), true));
jobsMainStage.add(this.getJobAcceptanceTestInstallPgsql(0, "PHP72", this.getTaskComposerInstall("PHP72"), true));
jobsMainStage.add(this.getJobAcceptanceTestInstallSqlite(0, "PHP72", this.getTaskComposerInstall("PHP72"), true));
jobsMainStage.addAll(this.getJobsAcceptanceTestsBackendMysql(0, this.numberOfAcceptanceTestJobs, "PHP73", this.getTaskComposerInstall("PHP73"), true));
jobsMainStage.add(this.getJobIntegrationAnnotations(0, "PHP72", this.getTaskComposerInstall("PHP72"), true));
jobsMainStage.add(this.getJobIntegrationVarious(0, "PHP72", this.getTaskComposerInstall("PHP72"), true));
jobsMainStage.addAll(this.getJobsFunctionalTestsMysql(0, this.numberOfFunctionalMysqlJobs, "PHP73", this.getTaskComposerInstall("PHP73"), true));
// mssql functionals are not executed as pre-merge
// jobsMainStage.addAll(this.getJobsFunctionalTestsMssql(0, this.numberOfFunctionalMssqlJobs, "PHP72", this.getTaskComposerInstall("PHP72"), true));
jobsMainStage.addAll(this.getJobsFunctionalTestsPgsql(0, this.numberOfFunctionalPgsqlJobs, "PHP72", this.getTaskComposerInstall("PHP72"), true));
jobsMainStage.addAll(this.getJobsFunctionalTestsSqlite(0, this.numberOfFunctionalSqliteJobs, "PHP72", this.getTaskComposerInstall("PHP72"), true));
jobsMainStage.add(this.getJobUnitJavaScript(0, "PHP72", this.getTaskComposerInstall("PHP72"), true));
jobsMainStage.add(this.getJobLintPhp("PHP72", true));
jobsMainStage.add(this.getJobLintPhp("PHP73", true));
jobsMainStage.add(this.getJobLintScssTs("PHP72", true));
jobsMainStage.add(this.getJobUnitPhp(0, "PHP72", this.getTaskComposerInstall("PHP72"), true));
jobsMainStage.add(this.getJobUnitPhp(0, "PHP73", this.getTaskComposerInstall("PHP73"), true));
jobsMainStage.add(this.getJobUnitDeprecatedPhp(0, "PHP72", this.getTaskComposerInstall("PHP72"), true));
jobsMainStage.add(this.getJobUnitDeprecatedPhp(0, "PHP73", this.getTaskComposerInstall("PHP73"), true));
jobsMainStage.addAll(this.getJobUnitPhpRandom(0, this.numberOfUnitRandomOrderJobs, "PHP72", this.getTaskComposerInstall("PHP72"), true));
jobsMainStage.addAll(this.getJobUnitPhpRandom(0, this.numberOfUnitRandomOrderJobs, "PHP73", this.getTaskComposerInstall("PHP73"), true));
Stage stageMainStage = new Stage("Main stage")
.jobs(jobsMainStage.toArray(new Job[jobsMainStage.size()]));
// Compile plan
return new Plan(project(), planName, planKey)
.description("Execute TYPO3 core master security tests. Auto generated! See Build/bamboo of core git repository.")
.pluginConfigurations(this.getDefaultPlanPluginConfiguration())
.stages(
stagePreparation,
stageEarly,
stageMainStage
)
.linkedRepositories("github TYPO3 TYPO3.CMS")
.triggers(
new RemoteTrigger()
.name("Remote trigger for security builds")
.description("Gerrit")
.triggerIPAddresses("5.10.165.218,91.184.35.13"))
.variables(
new Variable("changeUrl", ""),
new Variable("patchset", "")
)
.planBranchManagement(
new PlanBranchManagement()
.delete(new BranchCleanup())
.notificationForCommitters()
)
.notifications(new Notification()
.type(new PlanCompletedNotification())
.recipients(new AnyNotificationRecipient(new AtlassianModule("com.atlassian.bamboo.plugins.bamboo-slack:recipient.slack"))
.recipientString("https://intercept.typo3.com/bamboo")
)
);
}
}
package core;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
import org.junit.Test;
import com.atlassian.bamboo.specs.api.builders.plan.Plan;
import com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException;
import com.atlassian.bamboo.specs.api.util.EntityPropertiesBuilders;
public class SecuritySpecTest {
@Test
public void checkYourPlanOffline() throws PropertiesValidationException {
Plan plan = new SecuritySpec().createPlan();
EntityPropertiesBuilders.build(plan);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment