Search in sources :

Example 46 with SpinnakerRuntimeSettings

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

the class ConsulClientService method getProfiles.

@Override
public List<Profile> getProfiles(DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
    List<Profile> result = new ArrayList<>();
    for (Map.Entry<Type, ServiceSettings> entry : endpoints.getAllServiceSettings().entrySet()) {
        ServiceSettings settings = entry.getValue();
        Type type = entry.getKey();
        if (!settings.getSidecar() && settings.getEnabled()) {
            String serviceName = type.getCanonicalName();
            String profileName = consulClientService(serviceName);
            String profilePath = Paths.get(CLIENT_OUTPUT_PATH, serviceName + ".json").toString();
            ProfileFactory factory = consulServiceProfileFactoryBuilder.build(type, settings);
            result.add(factory.getProfile(profileName, profilePath, deploymentConfiguration, endpoints));
        }
    }
    String profileName = clientProfileName;
    String profilePath = Paths.get(CLIENT_OUTPUT_PATH, profileName.split("/")[1]).toString();
    result.add(consulClientProfileFactory.getProfile(profileName, profilePath, deploymentConfiguration, endpoints));
    return result;
}
Also used : ProfileFactory(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.ProfileFactory) ConsulClientProfileFactory(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.consul.ConsulClientProfileFactory) Profile(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile)

Example 47 with SpinnakerRuntimeSettings

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

the class MetricRegistryProfileFactoryBuilder method build.

public ProfileFactory build(ServiceSettings settings) {
    return new ProfileFactory() {

        @Override
        protected ArtifactService getArtifactService() {
            return artifactService;
        }

        @Override
        protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
            URI uri;
            try {
                String baseUrl;
                if (settings.getBasicAuthEnabled() != null && settings.getBasicAuthEnabled()) {
                    baseUrl = settings.getAuthBaseUrl();
                } else {
                    baseUrl = settings.getBaseUrl();
                }
                uri = new URIBuilder(baseUrl).setHost("localhost").setPath("/spectator/metrics").build();
            } catch (URISyntaxException e) {
                throw new HalException(Problem.Severity.FATAL, "Unable to build service URL: " + e.getMessage());
            }
            profile.appendContents("metrics_url: " + uri.toString());
        }

        @Override
        protected Profile getBaseProfile(String name, String version, String outputFile) {
            return new Profile(name, version, outputFile, "");
        }

        @Override
        public SpinnakerArtifact getArtifact() {
            return SpinnakerArtifact.SPINNAKER_MONITORING_DAEMON;
        }

        @Override
        protected String commentPrefix() {
            return "## ";
        }
    };
}
Also used : HalException(com.netflix.spinnaker.halyard.core.error.v1.HalException) SpinnakerRuntimeSettings(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI) DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration) URIBuilder(org.apache.http.client.utils.URIBuilder)

Example 48 with SpinnakerRuntimeSettings

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

the class FiatService method getProfiles.

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

Example 49 with SpinnakerRuntimeSettings

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

the class GateService method getProfiles.

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

Example 50 with SpinnakerRuntimeSettings

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

the class OrcaBootstrapService method getProfiles.

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

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