Search in sources :

Example 51 with DeploymentConfiguration

use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.

the class NotificationService method setNotification.

public void setNotification(String deploymentName, Notification notification) {
    DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
    Notifications notifications = deploymentConfiguration.getNotifications();
    switch(notification.getNotificationType()) {
        case SLACK:
            notifications.setSlack((SlackNotification) notification);
            break;
        default:
            throw new IllegalArgumentException("Unknown notification type " + notification.getNotificationType());
    }
}
Also used : Notifications(com.netflix.spinnaker.halyard.config.model.v1.node.Notifications) DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)

Example 52 with DeploymentConfiguration

use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.

the class NotificationService method getNotifications.

public Notifications getNotifications(String deploymentName) {
    DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
    Notifications notifications = deploymentConfiguration.getNotifications();
    if (notifications == null) {
        notifications = new Notifications();
        deploymentConfiguration.setNotifications(notifications);
    }
    return notifications;
}
Also used : Notifications(com.netflix.spinnaker.halyard.config.model.v1.node.Notifications) DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)

Example 53 with DeploymentConfiguration

use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.

the class PubsubService method setPubsub.

public void setPubsub(String deploymentName, Pubsub pubsub) {
    DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
    Pubsubs pubsubs = deploymentConfiguration.getPubsub();
    switch(pubsub.pubsubType()) {
        case GOOGLE:
            pubsubs.setGoogle((GooglePubsub) pubsub);
            break;
        default:
            throw new IllegalArgumentException("Unknown pubsub type " + pubsub.pubsubType());
    }
}
Also used : Pubsubs(com.netflix.spinnaker.halyard.config.model.v1.node.Pubsubs) DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)

Example 54 with DeploymentConfiguration

use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.

the class DeploymentEnvironmentValidator method validateDistributedDeployment.

private void validateDistributedDeployment(ConfigProblemSetBuilder p, DeploymentEnvironment n) {
    String accountName = n.getAccountName();
    if (StringUtils.isEmpty(accountName)) {
        p.addProblem(Problem.Severity.FATAL, "An account name must be specified when using a Distributed deployment.");
        return;
    }
    DeploymentConfiguration deploymentConfiguration = n.parentOfType(DeploymentConfiguration.class);
    Account account;
    try {
        account = accountService.getAnyProviderAccount(deploymentConfiguration.getName(), n.getAccountName());
    } catch (ConfigNotFoundException e) {
        p.addProblem(Problem.Severity.FATAL, "Account " + accountName + " not defined.");
        return;
    }
    if (account instanceof GoogleAccount) {
        p.addProblem(Problem.Severity.WARNING, "Support for distributed deployments on GCE aren't fully supported yet.");
    } else if (account instanceof KubernetesAccount) {
        kubernetesAccountValidator.ensureKubectlExists(p);
    } else {
        p.addProblem(Problem.Severity.FATAL, "Account " + accountName + " is not in a provider that supports distributed installation of Spinnaker yet");
    }
}
Also used : KubernetesAccount(com.netflix.spinnaker.halyard.config.model.v1.providers.kubernetes.KubernetesAccount) Account(com.netflix.spinnaker.halyard.config.model.v1.node.Account) GoogleAccount(com.netflix.spinnaker.halyard.config.model.v1.providers.google.GoogleAccount) GoogleAccount(com.netflix.spinnaker.halyard.config.model.v1.providers.google.GoogleAccount) ConfigNotFoundException(com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException) KubernetesAccount(com.netflix.spinnaker.halyard.config.model.v1.providers.kubernetes.KubernetesAccount) DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)

Example 55 with DeploymentConfiguration

use of com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration in project halyard by spinnaker.

the class CanaryService method setCanary.

public void setCanary(String deploymentName, Canary newCanary) {
    DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
    deploymentConfiguration.setCanary(newCanary);
}
Also used : DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)

Aggregations

DeploymentConfiguration (com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)39 HalException (com.netflix.spinnaker.halyard.core.error.v1.HalException)9 SpinnakerRuntimeSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings)9 DeploymentDetails (com.netflix.spinnaker.halyard.deploy.deployment.v1.DeploymentDetails)7 DeploymentEnvironment (com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentEnvironment)6 AccountDeploymentDetails (com.netflix.spinnaker.halyard.deploy.deployment.v1.AccountDeploymentDetails)6 Account (com.netflix.spinnaker.halyard.config.model.v1.node.Account)5 ConfigProblemBuilder (com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemBuilder)5 SpinnakerService (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerService)5 ConfigNotFoundException (com.netflix.spinnaker.halyard.config.error.v1.ConfigNotFoundException)4 Notifications (com.netflix.spinnaker.halyard.config.model.v1.node.Notifications)4 Provider (com.netflix.spinnaker.halyard.config.model.v1.node.Provider)4 Providers (com.netflix.spinnaker.halyard.config.model.v1.node.Providers)4 RemoteAction (com.netflix.spinnaker.halyard.core.RemoteAction)4 BakeDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.BakeDeployer)4 Deployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.Deployer)4 DistributedDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.DistributedDeployer)4 KubectlDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.KubectlDeployer)4 LocalDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.LocalDeployer)4 LocalGitDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.LocalGitDeployer)4