Search in sources :

Example 21 with DeploymentConfiguration

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

the class DeploymentEnvironmentService method setDeploymentEnvironment.

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

Example 22 with DeploymentConfiguration

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

the class DCOSAccount method dockerRegistriesOptions.

protected List<String> dockerRegistriesOptions(ConfigProblemSetBuilder psBuilder) {
    DeploymentConfiguration context = parentOfType(DeploymentConfiguration.class);
    DockerRegistryProvider dockerRegistryProvider = context.getProviders().getDockerRegistry();
    if (dockerRegistryProvider != null) {
        return dockerRegistryProvider.getAccounts().stream().map(Account::getName).collect(Collectors.toList());
    } else {
        return null;
    }
}
Also used : DockerRegistryProvider(com.netflix.spinnaker.halyard.config.model.v1.providers.dockerRegistry.DockerRegistryProvider) DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)

Example 23 with DeploymentConfiguration

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

the class ArtifactService method getBillOfMaterials.

BillOfMaterials getBillOfMaterials(String deploymentName) {
    DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
    String version = deploymentConfiguration.getVersion();
    return versionsService.getBillOfMaterials(version);
}
Also used : DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)

Example 24 with DeploymentConfiguration

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

the class ClouddriverProfileFactory method setProfile.

@Override
protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
    super.setProfile(profile, deploymentConfiguration, endpoints);
    // We need to make modifications to this deployment configuration, but can't use helpful objects
    // like the accountService on a clone. Therefore, we'll make the modifications in place and
    // restore to the original state when the modifications are written out.
    Providers originalProviders = deploymentConfiguration.getProviders().cloneNode(Providers.class);
    Providers modifiedProviders = deploymentConfiguration.getProviders();
    DeploymentEnvironment deploymentEnvironment = deploymentConfiguration.getDeploymentEnvironment();
    if (deploymentEnvironment.getBootstrapOnly() != null && deploymentEnvironment.getBootstrapOnly()) {
        String bootstrapAccountName = deploymentEnvironment.getAccountName();
        removeBootstrapOnlyAccount(modifiedProviders, deploymentConfiguration.getName(), bootstrapAccountName);
    }
    Artifacts artifacts = deploymentConfiguration.getArtifacts();
    List<String> files = backupRequiredFiles(modifiedProviders, deploymentConfiguration.getName());
    files.addAll(backupRequiredFiles(artifacts, deploymentConfiguration.getName()));
    if (deploymentConfiguration.getProviders() != null) {
        processProviders(deploymentConfiguration.getProviders());
    }
    profile.appendContents(yamlToString(modifiedProviders)).appendContents(yamlToString(new ArtifactWrapper(artifacts))).appendContents(profile.getBaseContents()).setRequiredFiles(files);
    deploymentConfiguration.setProviders(originalProviders);
}
Also used : Artifacts(com.netflix.spinnaker.halyard.config.model.v1.node.Artifacts) DeploymentEnvironment(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentEnvironment) Providers(com.netflix.spinnaker.halyard.config.model.v1.node.Providers)

Example 25 with DeploymentConfiguration

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

the class EchoProfileFactory method setProfile.

@Override
protected void setProfile(Profile profile, DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints) {
    super.setProfile(profile, deploymentConfiguration, endpoints);
    List<String> files = new ArrayList<>();
    profile.appendContents("global.spinnaker.timezone: " + deploymentConfiguration.getTimezone());
    profile.appendContents("spinnaker.baseUrl: " + endpoints.getServices().getDeck().getBaseUrl());
    Notifications notifications = deploymentConfiguration.getNotifications();
    if (notifications != null) {
        files.addAll(backupRequiredFiles(notifications, deploymentConfiguration.getName()));
        profile.appendContents(yamlToString(notifications));
    }
    Pubsubs pubsubs = deploymentConfiguration.getPubsub();
    if (pubsubs != null) {
        files.addAll(backupRequiredFiles(pubsubs, deploymentConfiguration.getName()));
        profile.appendContents(yamlToString(new PubsubWrapper(pubsubs)));
    }
    profile.appendContents(profile.getBaseContents()).setRequiredFiles(files);
}
Also used : Pubsubs(com.netflix.spinnaker.halyard.config.model.v1.node.Pubsubs) ArrayList(java.util.ArrayList) Notifications(com.netflix.spinnaker.halyard.config.model.v1.node.Notifications)

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