Created
September 11, 2018 20:47
-
-
Save lievendoclo/39b5e39cbd52b443823afcb5c63e385a to your computer and use it in GitHub Desktop.
Kubernetes deploy with Atomist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sdm: SoftwareDeliveryMachine = createSoftwareDeliveryMachine( | |
{ | |
name: "Spring software delivery machine", | |
configuration, | |
}); | |
sdm.addExtensionPacks(SpringSupport, kubernetesSupport()); | |
const autofix = new Autofix().with(AddDockerfileAutofix); | |
const version = new Version().withVersioner(MavenProjectVersioner); | |
const build = new Build().with({builder: new MavenBuilder(sdm), progressReporter: MavenProgressReporter}); | |
const dockerBuild = new DockerBuild().with({ | |
preparations: [MavenVersionPreparation, MavenPackage], | |
options: { push: false }, | |
}); | |
const kubernetesDeploy = new KubernetesDeploy({ environment: "testing" }); | |
const BaseGoals = goals("checks") | |
.plan(version, autofix, new AutoCodeInspection(), new PushImpact()); | |
const BuildGoals = goals("build") | |
.plan(build).after(autofix, version); | |
const DeployGoals = goals("deploy") | |
.plan(dockerBuild).after(build) | |
.plan(kubernetesDeploy).after(dockerBuild); | |
sdm.addGoalContributions(goalContributors( | |
onAnyPush().setGoals(BaseGoals), | |
whenPushSatisfies(IsMaven).setGoals(BuildGoals), | |
whenPushSatisfies(HasDockerfile).setGoals(DeployGoals), | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment