Skip to content

Instantly share code, notes, and snippets.

@lievendoclo
Created September 11, 2018 20:47
Show Gist options
  • Save lievendoclo/39b5e39cbd52b443823afcb5c63e385a to your computer and use it in GitHub Desktop.
Save lievendoclo/39b5e39cbd52b443823afcb5c63e385a to your computer and use it in GitHub Desktop.
Kubernetes deploy with Atomist
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