Search in sources :

Example 16 with SpinnakerRuntimeSettings

use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings in project halyard by spinnaker.

the class DeckDockerProfileFactory method setProfile.

@Override
protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
    super.setProfile(profile, deploymentConfiguration, endpoints);
    ServiceSettings deckSettings = endpoints.getServices().getDeck();
    ServiceSettings gateSettings = endpoints.getServices().getGate();
    ApacheSsl apacheSsl = deploymentConfiguration.getSecurity().getUiSecurity().getSsl();
    if (apacheSsl.isEnabled()) {
        Map<String, String> env = profile.getEnv();
        env.put("DECK_HOST", deckSettings.getHost());
        env.put("DECK_PORT", deckSettings.getPort() + "");
        env.put("API_HOST", gateSettings.getBaseUrl());
        env.put("AUTH_ENABLED", Boolean.toString(deploymentConfiguration.getSecurity().getAuthn().isEnabled()));
        env.put("DECK_CERT", apacheSsl.getSslCertificateFile());
        env.put("DECK_KEY", apacheSsl.getSslCertificateKeyFile());
        env.put("PASSPHRASE", apacheSsl.getSslCertificatePassphrase());
    }
}
Also used : ApacheSsl(com.netflix.spinnaker.halyard.config.model.v1.security.ApacheSsl) ServiceSettings(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ServiceSettings)

Example 17 with SpinnakerRuntimeSettings

use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings in project halyard by spinnaker.

the class ClouddriverService method getProfiles.

@Override
public List<Profile> getProfiles(DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
    List<Profile> profiles = super.getProfiles(deploymentConfiguration, endpoints);
    String filename = "clouddriver.yml";
    String path = Paths.get(getConfigOutputPath(), filename).toString();
    Profile profile = getClouddriverProfileFactory().getProfile(filename, path, deploymentConfiguration, endpoints);
    profiles.add(profile);
    return profiles;
}
Also used : Profile(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile)

Example 18 with SpinnakerRuntimeSettings

use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings in project halyard by spinnaker.

the class ConsulClientProfileFactory method getBindings.

@Override
protected Map<String, Object> getBindings(DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
    Map<String, Object> bindings = new HashMap<>();
    ServiceSettings consul = endpoints.getServices().getConsulClient();
    bindings.put("scheme", consul.getScheme());
    bindings.put("port", consul.getPort() + "");
    return bindings;
}
Also used : HashMap(java.util.HashMap) ServiceSettings(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ServiceSettings)

Example 19 with SpinnakerRuntimeSettings

use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings in project halyard by spinnaker.

the class SpinnakerServiceProvider method buildRuntimeSettings.

public SpinnakerRuntimeSettings buildRuntimeSettings(DeploymentConfiguration deploymentConfiguration) {
    SpinnakerRuntimeSettings endpoints = new SpinnakerRuntimeSettings();
    for (SpinnakerService.Type type : SpinnakerService.Type.values()) {
        SpinnakerService service = getSpinnakerService(type);
        if (service != null) {
            log.info("Building service settings entry for " + service.getServiceName());
            ServiceSettings settings = service.getDefaultServiceSettings(deploymentConfiguration);
            settings.mergePreferThis(service.buildServiceSettings(deploymentConfiguration));
            endpoints.setServiceSettings(type, settings);
        }
    }
    return endpoints;
}
Also used : SpinnakerRuntimeSettings(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings)

Example 20 with SpinnakerRuntimeSettings

use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings in project halyard by spinnaker.

the class DistributedService method buildDeployServerGroupPipeline.

default Map<String, Object> buildDeployServerGroupPipeline(AccountDeploymentDetails<A> details, SpinnakerRuntimeSettings runtimeSettings, List<ConfigSource> configSources, Integer maxRemaining, boolean scaleDown) {
    String accountName = details.getAccount().getName();
    String region = runtimeSettings.getServiceSettings(getService()).getLocation();
    Map<String, Object> deployDescription = getServerGroupDescription(details, runtimeSettings, configSources);
    deployDescription.put("name", "deploy");
    Map<String, String> source = new HashMap<>();
    RunningServiceDetails runningServiceDetails = getRunningServiceDetails(details, runtimeSettings);
    if (runningServiceDetails.getLatestEnabledVersion() == null) {
        throw new HalException(Problem.Severity.FATAL, "No prior server group to clone for " + getServiceName());
    }
    source.put("account", accountName);
    source.put("credentials", accountName);
    source.put("serverGroupName", getVersionedName(runningServiceDetails.getLatestEnabledVersion()));
    source.put("region", region);
    source.put("namespace", region);
    deployDescription.put("source", source);
    deployDescription.put("interestingHealthProviders", getHealthProviders());
    deployDescription.put("type", AtomicOperations.CLONE_SERVER_GROUP);
    deployDescription.put("cloudProvider", getProviderType().getId());
    deployDescription.put("refId", "deployredblack");
    deployDescription.put("region", getRegion(runtimeSettings.getServiceSettings(getService())));
    deployDescription.put("strategy", "redblack");
    if (maxRemaining != null) {
        deployDescription.put("maxRemainingAsgs", maxRemaining + "");
    }
    deployDescription.put("scaleDown", scaleDown + "");
    if (scaleDown) {
        deployDescription.put("allowShrinkDownActive", "true");
    }
    List<Map<String, Object>> stages = new ArrayList<>();
    stages.add(deployDescription);
    Map<String, Object> pipeline = new HashMap<>();
    pipeline.put("stages", stages);
    pipeline.put("application", "spin");
    pipeline.put("name", "Deploy/Upgrade " + getServiceName());
    pipeline.put("description", "Auto-generated by Halyard");
    return pipeline;
}
Also used : HashMap(java.util.HashMap) RunningServiceDetails(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.RunningServiceDetails) HalException(com.netflix.spinnaker.halyard.core.error.v1.HalException) ArrayList(java.util.ArrayList) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

ServiceSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ServiceSettings)28 SpinnakerRuntimeSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings)22 HalException (com.netflix.spinnaker.halyard.core.error.v1.HalException)20 RunningServiceDetails (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.RunningServiceDetails)20 ArrayList (java.util.ArrayList)20 Profile (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile)19 HashMap (java.util.HashMap)16 SpinnakerService (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerService)15 Map (java.util.Map)12 List (java.util.List)11 AccountDeploymentDetails (com.netflix.spinnaker.halyard.deploy.deployment.v1.AccountDeploymentDetails)9 Collectors (java.util.stream.Collectors)9 Names (com.netflix.frigga.Names)7 RemoteAction (com.netflix.spinnaker.halyard.core.RemoteAction)7 DistributedService (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.distributed.DistributedService)7 HashSet (java.util.HashSet)7 Problem (com.netflix.spinnaker.halyard.core.problem.v1.Problem)6 ConfigSource (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ConfigSource)6 Collections (java.util.Collections)6 DeploymentConfiguration (com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)5