use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile in project halyard by spinnaker.
the class BakeService method stageStartupScripts.
default String stageStartupScripts(DeploymentDetails details, GenerateService.ResolvedConfiguration resolvedConfiguration) {
Map<String, Profile> profiles = resolvedConfiguration.getProfilesForService(getService().getType());
List<String> allCommands = new ArrayList<>();
for (Map.Entry<String, Profile> entry : profiles.entrySet()) {
Profile profile = entry.getValue();
String source = profile.getStagedFile(getSpinnakerStagingPath(details.getDeploymentName()));
String dest = profile.getOutputFile();
allCommands.add(String.format("mkdir -p $(dirname %s)", dest));
allCommands.add(String.format("cp -p %s %s", source, dest));
if (profile.isExecutable()) {
allCommands.add(String.format("chmod +x %s", dest));
}
}
return Strings.join(allCommands, "\n");
}
use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile 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;
}
use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile in project halyard by spinnaker.
the class RoscoService method getProfiles.
@Override
public List<Profile> getProfiles(DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
List<Profile> profiles = super.getProfiles(deploymentConfiguration, endpoints);
String filename = "rosco.yml";
String path = Paths.get(getConfigOutputPath(), filename).toString();
Profile profile = roscoProfileFactory.getProfile(filename, path, deploymentConfiguration, endpoints);
appendCustomConfigDir(profile);
profiles.add(profile);
profiles.addAll(prefixProfileBuilder.build(deploymentConfiguration, getRoscoConfigPath(), getArtifact(), "packer"));
return profiles;
}
use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.Profile in project halyard by spinnaker.
the class SpinnakerMonitoringDaemonProfileFactory method setProfile.
@Override
protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
SpinnakerRuntimeSettings.Services services = endpoints.getServices();
ServiceSettings monitoringService = services.getMonitoringDaemon();
MetricStores metricStores = deploymentConfiguration.getMetricStores();
List<String> enabledMetricStores = new ArrayList<>();
List<String> files = new ArrayList<>();
DatadogStore datadogStore = metricStores.getDatadog();
if (datadogStore.isEnabled()) {
enabledMetricStores.add("datadog");
}
PrometheusStore prometheusStore = metricStores.getPrometheus();
if (prometheusStore.isEnabled()) {
enabledMetricStores.add("prometheus");
}
StackdriverStore stackdriverStore = metricStores.getStackdriver();
if (stackdriverStore.isEnabled()) {
enabledMetricStores.add("stackdriver");
files.addAll(backupRequiredFiles(stackdriverStore, deploymentConfiguration.getName()));
}
profile.appendContents(yamlToString(metricStores));
Server server = new Server().setHost(monitoringService.getHost()).setPort(monitoringService.getPort());
ServerConfig serverConfig = new ServerConfig();
serverConfig.setServer(server);
profile.appendContents(yamlToString(serverConfig));
Monitor monitor = new Monitor().setPeriod(metricStores.getPeriod()).setMetricStore(enabledMetricStores);
MonitorConfig monitorConfig = new MonitorConfig();
monitorConfig.setMonitor(monitor);
profile.appendContents(yamlToString(monitorConfig));
profile.appendContents(profile.getBaseContents());
profile.setRequiredFiles(files);
}
Aggregations