@spinnaker/cloudfoundry 0.0.0-main-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1085 -0
- package/LICENSE.txt +203 -0
- package/dist/cf.module.d.ts +24 -0
- package/dist/cf.settings.d.ts +7 -0
- package/dist/common/applicationName.validator.d.ts +1 -0
- package/dist/deploymentStrategy/CloudFoundryDeploymentStrategySelector.d.ts +21 -0
- package/dist/deploymentStrategy/strategies/redblack/redblack.strategy.d.ts +10 -0
- package/dist/deploymentStrategy/strategies/rollingredblack/AdditionalFields.d.ts +22 -0
- package/dist/domain/ICloudFoundryAccount.d.ts +7 -0
- package/dist/domain/ICloudFoundryApplication.d.ts +4 -0
- package/dist/domain/ICloudFoundryCluster.d.ts +5 -0
- package/dist/domain/ICloudFoundryDroplet.d.ts +19 -0
- package/dist/domain/ICloudFoundryInstance.d.ts +4 -0
- package/dist/domain/ICloudFoundryLoadBalancer.d.ts +25 -0
- package/dist/domain/ICloudFoundryServerGroup.d.ts +41 -0
- package/dist/domain/ICloudFoundrySpace.d.ts +9 -0
- package/dist/domain/index.d.ts +8 -0
- package/dist/help/cloudfoundry.help.d.ts +1 -0
- package/dist/image/image.reader.cf.d.ts +4 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5929 -0
- package/dist/index.js.map +1 -0
- package/dist/instance/details/CloudFoundryInstanceActions.d.ts +11 -0
- package/dist/instance/details/CloudFoundryInstanceDetails.d.ts +23 -0
- package/dist/instance/details/index.d.ts +1 -0
- package/dist/instance/details/sections/CloudFoundryInstanceDetailsSection.d.ts +9 -0
- package/dist/instance/details/sections/index.d.ts +1 -0
- package/dist/loadBalancer/configure/CloudFoundryMapLoadBalancerModal.d.ts +33 -0
- package/dist/loadBalancer/configure/loadBalancerDetails.d.ts +32 -0
- package/dist/loadBalancer/details/CloudFoundryLoadBalancerActions.d.ts +10 -0
- package/dist/loadBalancer/details/CloudFoundryLoadBalancerDetails.d.ts +26 -0
- package/dist/loadBalancer/details/index.d.ts +1 -0
- package/dist/loadBalancer/details/sections/CloudFoundryLoadBalancerDetailsSection.d.ts +9 -0
- package/dist/loadBalancer/details/sections/CloudFoundryLoadBalancerLinksSection.d.ts +9 -0
- package/dist/loadBalancer/details/sections/CloudFoundryLoadBalancerStatusSection.d.ts +9 -0
- package/dist/loadBalancer/details/sections/index.d.ts +3 -0
- package/dist/loadBalancer/index.d.ts +3 -0
- package/dist/loadBalancer/loadBalancer.transformer.d.ts +25 -0
- package/dist/pipeline/config/validation/cfTargetImpedance.validator.d.ts +9 -0
- package/dist/pipeline/config/validation/instanceSize.validator.d.ts +15 -0
- package/dist/pipeline/config/validation/requiredRoutes.validator.d.ts +4 -0
- package/dist/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfig.d.ts +7 -0
- package/dist/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfigForm.d.ts +13 -0
- package/dist/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestDetailsTab.d.ts +6 -0
- package/dist/pipeline/stages/bakeCloudFoundryManifest/bakeCloudFoundryManifestStage.d.ts +1 -0
- package/dist/pipeline/stages/cloneServerGroup/CloudFoundryCloneServerGroupStageConfig.d.ts +11 -0
- package/dist/pipeline/stages/cloneServerGroup/cloudFoundryCloneServerGroupStage.module.d.ts +1 -0
- package/dist/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsConfig.d.ts +9 -0
- package/dist/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsStageConfigForm.d.ts +26 -0
- package/dist/pipeline/stages/createServiceBindings/cloudFoundryCreateServiceBindingsStage.d.ts +1 -0
- package/dist/pipeline/stages/createServiceKey/CloudFoundryCreateServiceKeyStageConfig.d.ts +19 -0
- package/dist/pipeline/stages/createServiceKey/cloudFoundryCreateServiceKeyStage.module.d.ts +1 -0
- package/dist/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsConfig.d.ts +10 -0
- package/dist/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsStageConfigForm.d.ts +20 -0
- package/dist/pipeline/stages/deleteServiceBindings/cloudFoundryDeleteServiceBindingsStage.d.ts +1 -0
- package/dist/pipeline/stages/deleteServiceKey/CloudFoundryDeleteServiceKeyStageConfig.d.ts +19 -0
- package/dist/pipeline/stages/deleteServiceKey/cloudFoundryDeleteServiceKeyStage.module.d.ts +1 -0
- package/dist/pipeline/stages/deployService/CloudFoundryDeployServiceStageConfig.d.ts +24 -0
- package/dist/pipeline/stages/deployService/CreateServiceInstanceDirectInput.d.ts +29 -0
- package/dist/pipeline/stages/deployService/CreateUserProvidedInput.d.ts +19 -0
- package/dist/pipeline/stages/deployService/ICloudFoundryServiceManifestSource.d.ts +24 -0
- package/dist/pipeline/stages/deployService/ServiceTagsInput.d.ts +17 -0
- package/dist/pipeline/stages/deployService/cloudFoundryDeployServiceStage.module.d.ts +1 -0
- package/dist/pipeline/stages/destroyAsg/cloudFoundryDestroyAsgStage.module.d.ts +1 -0
- package/dist/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfig.d.ts +5 -0
- package/dist/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfigForm.d.ts +19 -0
- package/dist/pipeline/stages/destroyService/cloudFoundryDestroyServiceStage.module.d.ts +1 -0
- package/dist/pipeline/stages/disableAsg/cloudFoundryDisableAsgStage.module.d.ts +1 -0
- package/dist/pipeline/stages/enableAsg/cloudFoundryEnableAsgStage.module.d.ts +1 -0
- package/dist/pipeline/stages/mapLoadBalancers/cloudFoundryMapLoadBalancersStage.module.d.ts +1 -0
- package/dist/pipeline/stages/resizeAsg/CloudFoundryResizeAsgStageConfig.d.ts +17 -0
- package/dist/pipeline/stages/resizeAsg/cloudFoundryResizeAsgStage.module.d.ts +1 -0
- package/dist/pipeline/stages/rollbackCluster/CloudFoundryRollbackClusterStageConfig.d.ts +17 -0
- package/dist/pipeline/stages/rollbackCluster/cloudFoundryRollbackClusterStage.module.d.ts +1 -0
- package/dist/pipeline/stages/runJob/CloudFoundryRunJobStageConfig.d.ts +14 -0
- package/dist/pipeline/stages/runJob/RunJobExecutionDetails.d.ts +6 -0
- package/dist/pipeline/stages/runJob/cloudFoundryRunJob.module.d.ts +1 -0
- package/dist/pipeline/stages/shareService/CloudFoundryShareServiceExecutionDetails.d.ts +6 -0
- package/dist/pipeline/stages/shareService/CloudFoundryShareServiceStageConfig.d.ts +21 -0
- package/dist/pipeline/stages/shareService/cloudFoundryShareServiceStage.module.d.ts +1 -0
- package/dist/pipeline/stages/unmapLoadBalancers/cloudFoundryUnmapLoadBalancersStage.module.d.ts +1 -0
- package/dist/pipeline/stages/unshareService/CloudFoundryUnshareServiceExecutionDetails.d.ts +6 -0
- package/dist/pipeline/stages/unshareService/CloudFoundryUnshareServiceStageConfig.d.ts +18 -0
- package/dist/pipeline/stages/unshareService/cloudFoundryUnshareServiceStage.module.d.ts +1 -0
- package/dist/presentation/forms/index.d.ts +2 -0
- package/dist/presentation/forms/inputs/FormikConfigField.d.ts +10 -0
- package/dist/presentation/forms/inputs/index.d.ts +1 -0
- package/dist/presentation/forms/serverGroup/Buildpacks.d.ts +8 -0
- package/dist/presentation/forms/serverGroup/EnvironmentVariables.d.ts +8 -0
- package/dist/presentation/forms/serverGroup/HealthCheck.d.ts +12 -0
- package/dist/presentation/forms/serverGroup/InstanceParameters.d.ts +12 -0
- package/dist/presentation/forms/serverGroup/Routes.d.ts +10 -0
- package/dist/presentation/forms/serverGroup/Services.d.ts +5 -0
- package/dist/presentation/forms/serverGroup/index.d.ts +6 -0
- package/dist/presentation/index.d.ts +3 -0
- package/dist/presentation/pipeline/index.d.ts +1 -0
- package/dist/presentation/pipeline/stages/CloudFoundryAsgStageConfig.d.ts +14 -0
- package/dist/presentation/pipeline/stages/CloudFoundryLoadBalancersExecutionDetails.d.ts +6 -0
- package/dist/presentation/pipeline/stages/CloudFoundryLoadBalancersStageConfig.d.ts +25 -0
- package/dist/presentation/pipeline/stages/CloudFoundryServiceExecutionDetails.d.ts +6 -0
- package/dist/presentation/pipeline/stages/CloudFoundryServiceKeyExecutionDetails.d.ts +6 -0
- package/dist/presentation/pipeline/stages/index.d.ts +5 -0
- package/dist/presentation/widgets/accountRegionClusterSelector/AccountRegionClusterSelector.d.ts +33 -0
- package/dist/presentation/widgets/accountRegionClusterSelector/FormikAccountRegionClusterSelector.d.ts +32 -0
- package/dist/presentation/widgets/accountRegionClusterSelector/index.d.ts +2 -0
- package/dist/presentation/widgets/index.d.ts +1 -0
- package/dist/presentation/widgets/recentLogs/CloudFoundryRecentLogs.d.ts +27 -0
- package/dist/routeDomains/index.d.ts +1 -0
- package/dist/routeDomains/routeDomainSelectField.d.ts +15 -0
- package/dist/serverGroup/configure/index.d.ts +4 -0
- package/dist/serverGroup/configure/serverGroupCommandBuilder.service.cf.d.ts +12 -0
- package/dist/serverGroup/configure/serverGroupCommandBuilderShim.service.cf.d.ts +14 -0
- package/dist/serverGroup/configure/serverGroupConfigurationModel.cf.d.ts +65 -0
- package/dist/serverGroup/configure/wizard/CreateServerGroupModal.d.ts +31 -0
- package/dist/serverGroup/configure/wizard/ServerGroupTemplateSelection.d.ts +16 -0
- package/dist/serverGroup/configure/wizard/sections/artifactSettings/ArtifactSettings.cf.d.ts +17 -0
- package/dist/serverGroup/configure/wizard/sections/artifactSettings/ConstantArtifactSettings.cf.d.ts +11 -0
- package/dist/serverGroup/configure/wizard/sections/basicSettings/BasicSettings.cf.d.ts +24 -0
- package/dist/serverGroup/configure/wizard/sections/cloneSettings/CloneSettings.cf.d.ts +21 -0
- package/dist/serverGroup/configure/wizard/sections/configurationSettings/ConfigurationSettings.cf.d.ts +22 -0
- package/dist/serverGroup/details/cfServerGroupDetailsGetter.d.ts +4 -0
- package/dist/serverGroup/details/cloudFoundryServerGroupActions.d.ts +24 -0
- package/dist/serverGroup/details/mapLoadBalancers/CloudFoundryMapLoadBalancersModal.d.ts +28 -0
- package/dist/serverGroup/details/mapLoadBalancers/CloudFoundryUnmapLoadBalancersModal.d.ts +28 -0
- package/dist/serverGroup/details/resize/CloudFoundryResizeServerGroupModal.d.ts +37 -0
- package/dist/serverGroup/details/rollback/CloudFoundryRollbackServerGroupModal.d.ts +36 -0
- package/dist/serverGroup/details/sections/ApplicationManagerSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/BoundServicesSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/BuildSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/EnvironmentVariablesSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/HealthCheckSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/ICloudFoundryServerGroupDetailsSectionProps.d.ts +5 -0
- package/dist/serverGroup/details/sections/MetricsSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/PackageSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/ServerGroupInformationSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/ServerGroupSizingSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/index.d.ts +9 -0
- package/dist/serverGroup/index.d.ts +5 -0
- package/dist/serverGroup/serverGroup.transformer.d.ts +10 -0
- package/package.json +52 -0
- package/src/cf.module.ts +85 -0
- package/src/cf.settings.ts +14 -0
- package/src/common/applicationName.validator.ts +43 -0
- package/src/common/cloudFoundry.less +16 -0
- package/src/deploymentStrategy/CloudFoundryDeploymentStrategySelector.tsx +175 -0
- package/src/deploymentStrategy/strategies/redblack/redblack.strategy.ts +11 -0
- package/src/deploymentStrategy/strategies/rollingredblack/AdditionalFields.tsx +161 -0
- package/src/domain/ICloudFoundryAccount.ts +9 -0
- package/src/domain/ICloudFoundryApplication.ts +5 -0
- package/src/domain/ICloudFoundryCluster.ts +6 -0
- package/src/domain/ICloudFoundryDroplet.ts +22 -0
- package/src/domain/ICloudFoundryInstance.ts +5 -0
- package/src/domain/ICloudFoundryLoadBalancer.ts +29 -0
- package/src/domain/ICloudFoundryServerGroup.ts +47 -0
- package/src/domain/ICloudFoundrySpace.ts +10 -0
- package/src/domain/index.ts +8 -0
- package/src/help/cloudfoundry.help.ts +31 -0
- package/src/image/image.reader.cf.ts +17 -0
- package/src/index.ts +7 -0
- package/src/instance/details/CloudFoundryInstanceActions.tsx +59 -0
- package/src/instance/details/CloudFoundryInstanceDetails.tsx +154 -0
- package/src/instance/details/index.ts +1 -0
- package/src/instance/details/sections/CloudFoundryInstanceDetailsSection.tsx +49 -0
- package/src/instance/details/sections/index.ts +1 -0
- package/src/loadBalancer/configure/CloudFoundryMapLoadBalancerModal.tsx +210 -0
- package/src/loadBalancer/configure/loadBalancerDetails.tsx +228 -0
- package/src/loadBalancer/details/CloudFoundryLoadBalancerActions.tsx +61 -0
- package/src/loadBalancer/details/CloudFoundryLoadBalancerDetails.tsx +148 -0
- package/src/loadBalancer/details/index.ts +1 -0
- package/src/loadBalancer/details/sections/CloudFoundryLoadBalancerDetailsSection.tsx +63 -0
- package/src/loadBalancer/details/sections/CloudFoundryLoadBalancerLinksSection.tsx +34 -0
- package/src/loadBalancer/details/sections/CloudFoundryLoadBalancerStatusSection.tsx +27 -0
- package/src/loadBalancer/details/sections/index.ts +3 -0
- package/src/loadBalancer/index.ts +3 -0
- package/src/loadBalancer/loadBalancer.transformer.ts +144 -0
- package/src/logo/cf.icon.svg +12 -0
- package/src/logo/cf.logo.less +5 -0
- package/src/logo/cf.logo.svg +12 -0
- package/src/pipeline/config/validation/cfTargetImpedance.validator.ts +60 -0
- package/src/pipeline/config/validation/instanceSize.validator.ts +66 -0
- package/src/pipeline/config/validation/requiredRoutes.validator.ts +26 -0
- package/src/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfig.tsx +62 -0
- package/src/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestConfigForm.tsx +174 -0
- package/src/pipeline/stages/bakeCloudFoundryManifest/BakeCloudFoundryManifestDetailsTab.tsx +35 -0
- package/src/pipeline/stages/bakeCloudFoundryManifest/bakeCloudFoundryManifestConfig.spec.tsx +80 -0
- package/src/pipeline/stages/bakeCloudFoundryManifest/bakeCloudFoundryManifestStage.ts +35 -0
- package/src/pipeline/stages/cloneServerGroup/CloudFoundryCloneServerGroupStageConfig.tsx +113 -0
- package/src/pipeline/stages/cloneServerGroup/cloudFoundryCloneServerGroupStage.module.ts +14 -0
- package/src/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsConfig.spec.tsx +35 -0
- package/src/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsConfig.tsx +69 -0
- package/src/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsStageConfigForm.tsx +230 -0
- package/src/pipeline/stages/createServiceBindings/cloudFoundryCreateServiceBindingsStage.ts +19 -0
- package/src/pipeline/stages/createServiceBindings/cloudFoundryCreateServiceBindingsStageForm.spec.tsx +50 -0
- package/src/pipeline/stages/createServiceKey/CloudFoundryCreateServiceKeyStageConfig.tsx +116 -0
- package/src/pipeline/stages/createServiceKey/cloudFoundryCreateServiceKeyStage.module.ts +21 -0
- package/src/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsConfig.tsx +69 -0
- package/src/pipeline/stages/deleteServiceBindings/CloudFoundryDeleteServiceBindingsStageConfigForm.tsx +158 -0
- package/src/pipeline/stages/deleteServiceBindings/cloudFoundryDeleteServiceBindingsStage.ts +19 -0
- package/src/pipeline/stages/deleteServiceBindings/cloudFoundryDeleteServiceBindingsStageForm.spec.tsx +49 -0
- package/src/pipeline/stages/deleteServiceKey/CloudFoundryDeleteServiceKeyStageConfig.tsx +116 -0
- package/src/pipeline/stages/deleteServiceKey/cloudFoundryDeleteServiceKeyStage.module.ts +22 -0
- package/src/pipeline/stages/deployService/CloudFoundryDeployServiceStageConfig.tsx +198 -0
- package/src/pipeline/stages/deployService/CreateServiceInstanceDirectInput.tsx +164 -0
- package/src/pipeline/stages/deployService/CreateUserProvidedInput.tsx +116 -0
- package/src/pipeline/stages/deployService/ICloudFoundryServiceManifestSource.ts +27 -0
- package/src/pipeline/stages/deployService/ServiceTagsInput.tsx +89 -0
- package/src/pipeline/stages/deployService/cloudFoundryDeployServiceStage.module.ts +153 -0
- package/src/pipeline/stages/deployService/cloudfoundryDeployServiceStage.less +12 -0
- package/src/pipeline/stages/destroyAsg/cloudFoundryDestroyAsgStage.module.ts +23 -0
- package/src/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfig.tsx +46 -0
- package/src/pipeline/stages/destroyService/CloudFoundryDestroyServiceStageConfigForm.tsx +134 -0
- package/src/pipeline/stages/destroyService/cloudFoundryDestroyServiceStage.module.ts +20 -0
- package/src/pipeline/stages/disableAsg/cloudFoundryDisableAsgStage.module.ts +18 -0
- package/src/pipeline/stages/enableAsg/cloudFoundryEnableAsgStage.module.ts +18 -0
- package/src/pipeline/stages/mapLoadBalancers/cloudFoundryMapLoadBalancersStage.module.ts +21 -0
- package/src/pipeline/stages/resizeAsg/CloudFoundryResizeAsgStageConfig.tsx +148 -0
- package/src/pipeline/stages/resizeAsg/cloudFoundryResizeAsgStage.module.ts +52 -0
- package/src/pipeline/stages/rollbackCluster/CloudFoundryRollbackClusterStageConfig.tsx +90 -0
- package/src/pipeline/stages/rollbackCluster/cloudFoundryRollbackClusterStage.module.ts +19 -0
- package/src/pipeline/stages/runJob/CloudFoundryRunJobStageConfig.tsx +100 -0
- package/src/pipeline/stages/runJob/RunJobExecutionDetails.tsx +62 -0
- package/src/pipeline/stages/runJob/cloudFoundryRunJob.module.ts +24 -0
- package/src/pipeline/stages/shareService/CloudFoundryShareServiceExecutionDetails.tsx +52 -0
- package/src/pipeline/stages/shareService/CloudFoundryShareServiceStageConfig.tsx +141 -0
- package/src/pipeline/stages/shareService/cloudFoundryShareServiceStage.module.ts +21 -0
- package/src/pipeline/stages/unmapLoadBalancers/cloudFoundryUnmapLoadBalancersStage.module.ts +21 -0
- package/src/pipeline/stages/unshareService/CloudFoundryUnshareServiceExecutionDetails.tsx +46 -0
- package/src/pipeline/stages/unshareService/CloudFoundryUnshareServiceStageConfig.tsx +114 -0
- package/src/pipeline/stages/unshareService/cloudFoundryUnshareServiceStage.module.ts +21 -0
- package/src/presentation/forms/index.ts +2 -0
- package/src/presentation/forms/inputs/FormikConfigField.tsx +28 -0
- package/src/presentation/forms/inputs/index.ts +1 -0
- package/src/presentation/forms/serverGroup/Buildpacks.tsx +69 -0
- package/src/presentation/forms/serverGroup/EnvironmentVariables.tsx +94 -0
- package/src/presentation/forms/serverGroup/HealthCheck.tsx +57 -0
- package/src/presentation/forms/serverGroup/InstanceParameters.tsx +63 -0
- package/src/presentation/forms/serverGroup/Routes.tsx +74 -0
- package/src/presentation/forms/serverGroup/Services.tsx +62 -0
- package/src/presentation/forms/serverGroup/index.ts +6 -0
- package/src/presentation/index.ts +3 -0
- package/src/presentation/pipeline/index.ts +1 -0
- package/src/presentation/pipeline/stages/CloudFoundryAsgStageConfig.tsx +67 -0
- package/src/presentation/pipeline/stages/CloudFoundryLoadBalancersExecutionDetails.tsx +53 -0
- package/src/presentation/pipeline/stages/CloudFoundryLoadBalancersStageConfig.tsx +116 -0
- package/src/presentation/pipeline/stages/CloudFoundryServiceExecutionDetails.tsx +46 -0
- package/src/presentation/pipeline/stages/CloudFoundryServiceKeyExecutionDetails.tsx +52 -0
- package/src/presentation/pipeline/stages/index.ts +5 -0
- package/src/presentation/widgets/accountRegionClusterSelector/AccountRegionClusterSelector.spec.tsx +385 -0
- package/src/presentation/widgets/accountRegionClusterSelector/AccountRegionClusterSelector.tsx +231 -0
- package/src/presentation/widgets/accountRegionClusterSelector/FormikAccountRegionClusterSelector.tsx +164 -0
- package/src/presentation/widgets/accountRegionClusterSelector/index.ts +2 -0
- package/src/presentation/widgets/index.ts +1 -0
- package/src/presentation/widgets/recentLogs/CloudFoundryRecentLogs.tsx +112 -0
- package/src/routeDomains/index.ts +1 -0
- package/src/routeDomains/routeDomainSelectField.tsx +48 -0
- package/src/serverGroup/configure/index.ts +4 -0
- package/src/serverGroup/configure/serverGroupCommandBuilder.service.cf.ts +168 -0
- package/src/serverGroup/configure/serverGroupCommandBuilderShim.service.cf.ts +64 -0
- package/src/serverGroup/configure/serverGroupConfigurationModel.cf.ts +77 -0
- package/src/serverGroup/configure/wizard/CreateServerGroupModal.tsx +194 -0
- package/src/serverGroup/configure/wizard/ServerGroupTemplateSelection.tsx +55 -0
- package/src/serverGroup/configure/wizard/sections/artifactSettings/ArtifactSettings.cf.tsx +78 -0
- package/src/serverGroup/configure/wizard/sections/artifactSettings/ConstantArtifactSettings.cf.tsx +49 -0
- package/src/serverGroup/configure/wizard/sections/basicSettings/BasicSettings.cf.tsx +163 -0
- package/src/serverGroup/configure/wizard/sections/cloneSettings/CloneSettings.cf.tsx +101 -0
- package/src/serverGroup/configure/wizard/sections/configurationSettings/ConfigurationSettings.cf.tsx +230 -0
- package/src/serverGroup/configure/wizard/serverGroup.less +3 -0
- package/src/serverGroup/details/cfServerGroupDetailsGetter.ts +60 -0
- package/src/serverGroup/details/cloudFoundryServerGroupActions.tsx +365 -0
- package/src/serverGroup/details/mapLoadBalancers/CloudFoundryMapLoadBalancersModal.tsx +137 -0
- package/src/serverGroup/details/mapLoadBalancers/CloudFoundryUnmapLoadBalancersModal.tsx +137 -0
- package/src/serverGroup/details/resize/CloudFoundryResizeServerGroupModal.tsx +232 -0
- package/src/serverGroup/details/rollback/CloudFoundryRollbackServerGroupModal.tsx +179 -0
- package/src/serverGroup/details/sections/ApplicationManagerSection.tsx +28 -0
- package/src/serverGroup/details/sections/BoundServicesSection.tsx +39 -0
- package/src/serverGroup/details/sections/BuildSection.tsx +61 -0
- package/src/serverGroup/details/sections/EnvironmentVariablesSection.tsx +34 -0
- package/src/serverGroup/details/sections/HealthCheckSection.tsx +28 -0
- package/src/serverGroup/details/sections/ICloudFoundryServerGroupDetailsSectionProps.ts +6 -0
- package/src/serverGroup/details/sections/MetricsSection.tsx +28 -0
- package/src/serverGroup/details/sections/PackageSection.tsx +27 -0
- package/src/serverGroup/details/sections/ServerGroupInformationSection.tsx +58 -0
- package/src/serverGroup/details/sections/ServerGroupSizingSection.tsx +27 -0
- package/src/serverGroup/details/sections/index.ts +9 -0
- package/src/serverGroup/index.ts +5 -0
- package/src/serverGroup/serverGroup.transformer.ts +42 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { get, has, upperFirst } from 'lodash';
|
|
2
|
+
|
|
3
|
+
import type { IPipeline, IStage, IStageOrTriggerValidator, ITrigger, IValidatorConfig } from '@spinnaker/core';
|
|
4
|
+
import { PipelineConfigValidator } from '@spinnaker/core';
|
|
5
|
+
|
|
6
|
+
export interface IInstanceFieldSizeValidationConfig extends IValidatorConfig {
|
|
7
|
+
fieldName: string;
|
|
8
|
+
fieldLabel?: string;
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
message?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class CfInstanceSizeFieldValidator implements IStageOrTriggerValidator {
|
|
15
|
+
public validate(
|
|
16
|
+
pipeline: IPipeline,
|
|
17
|
+
stage: IStage | ITrigger,
|
|
18
|
+
validationConfig: IInstanceFieldSizeValidationConfig,
|
|
19
|
+
): string {
|
|
20
|
+
if (!this.passesValidation(stage, validationConfig)) {
|
|
21
|
+
return this.validationMessage(validationConfig, pipeline);
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
protected passesValidation(stage: IStage | ITrigger, validationConfig: IInstanceFieldSizeValidationConfig): boolean {
|
|
27
|
+
return this.fieldIsValid(stage, validationConfig);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
protected validationMessage(validationConfig: IInstanceFieldSizeValidationConfig, pipeline: IPipeline): string {
|
|
31
|
+
const fieldLabel: string = this.printableFieldLabel(validationConfig);
|
|
32
|
+
const hasMin = has(validationConfig, 'min');
|
|
33
|
+
const min: any = hasMin ? get(validationConfig, 'min') : 'NA';
|
|
34
|
+
const hasMax = has(validationConfig, 'max');
|
|
35
|
+
const max: any = hasMax ? get(validationConfig, 'max') : 'NA';
|
|
36
|
+
let message = ``;
|
|
37
|
+
if (hasMin) {
|
|
38
|
+
if (hasMax) {
|
|
39
|
+
message = `<strong>${fieldLabel}</strong> should be from ${min} to ${max} in ${pipeline.name}.`;
|
|
40
|
+
} else {
|
|
41
|
+
message = `<strong>${fieldLabel}</strong> should be at least ${min} in ${pipeline.name}.`;
|
|
42
|
+
}
|
|
43
|
+
} else if (hasMax) {
|
|
44
|
+
message = `<strong>${fieldLabel}</strong> should be no more than ${max} in ${pipeline.name}.`;
|
|
45
|
+
}
|
|
46
|
+
return validationConfig.message || message;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
protected printableFieldLabel(config: IInstanceFieldSizeValidationConfig): string {
|
|
50
|
+
const fieldLabel: string = config.fieldLabel || config.fieldName;
|
|
51
|
+
return upperFirst(fieldLabel);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
protected fieldIsValid(stage: IStage | ITrigger, config: IInstanceFieldSizeValidationConfig): boolean {
|
|
55
|
+
const fieldExists = has(stage, config.fieldName);
|
|
56
|
+
const field: any = get(stage, config.fieldName);
|
|
57
|
+
const hasMax: boolean = has(config, 'max');
|
|
58
|
+
const hasMin: boolean = has(config, 'min');
|
|
59
|
+
const max: number = get(config, 'max');
|
|
60
|
+
const min: number = get(config, 'min');
|
|
61
|
+
|
|
62
|
+
return fieldExists && (!hasMax || (hasMax && field <= max)) && (!hasMin || (hasMin && field >= min));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
PipelineConfigValidator.registerValidator('cfInstanceSizeField', new CfInstanceSizeFieldValidator());
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { get } from 'lodash';
|
|
2
|
+
|
|
3
|
+
import type { IPipeline, IStage, IStageOrTriggerValidator, ITrigger } from '@spinnaker/core';
|
|
4
|
+
import { PipelineConfigValidator } from '@spinnaker/core';
|
|
5
|
+
|
|
6
|
+
export class CfRequiredRoutesFieldValidator implements IStageOrTriggerValidator {
|
|
7
|
+
public validate(_pipeline: IPipeline, stage: IStage | ITrigger, validationConfig: any): string {
|
|
8
|
+
const routes: string[] = get(stage, validationConfig.fieldName);
|
|
9
|
+
const routeErrors = routes
|
|
10
|
+
.map((route: string) => {
|
|
11
|
+
const regex = /^([-\w]+)\.([-.\w]+)(:\d+)?([-/\w]+)?$/gm;
|
|
12
|
+
route = route || '';
|
|
13
|
+
if (regex.exec(route) === null) {
|
|
14
|
+
const spelRegex = /^\${.*}$/g;
|
|
15
|
+
if (spelRegex.exec(route) === null) {
|
|
16
|
+
return `"${route}" did not match the expected format "host.some.domain[:9999][/some/path]"`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
})
|
|
21
|
+
.filter((err) => err != null);
|
|
22
|
+
return (routeErrors && routeErrors.length && routeErrors[0]) || null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
PipelineConfigValidator.registerValidator('cfRequiredRoutesField', new CfRequiredRoutesFieldValidator());
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { FormikErrors } from 'formik';
|
|
2
|
+
import { cloneDeep } from 'lodash';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import type { IArtifact, IExpectedArtifact, IStage, IStageConfigProps } from '@spinnaker/core';
|
|
6
|
+
import { FormikStageConfig, FormValidator } from '@spinnaker/core';
|
|
7
|
+
|
|
8
|
+
import { BakeCloudFoundryManifestConfigForm } from './BakeCloudFoundryManifestConfigForm';
|
|
9
|
+
|
|
10
|
+
export function BakeCloudFoundryManifestConfig({ application, pipeline, stage, updateStage }: IStageConfigProps) {
|
|
11
|
+
const stageWithDefaults = React.useMemo(() => {
|
|
12
|
+
return {
|
|
13
|
+
inputArtifacts: [],
|
|
14
|
+
...cloneDeep(stage),
|
|
15
|
+
};
|
|
16
|
+
}, []);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<FormikStageConfig
|
|
20
|
+
application={application}
|
|
21
|
+
onChange={updateStage}
|
|
22
|
+
pipeline={pipeline}
|
|
23
|
+
stage={stageWithDefaults}
|
|
24
|
+
validate={validateBakeCloudFoundryManifestStage}
|
|
25
|
+
render={(props) => <BakeCloudFoundryManifestConfigForm {...props} />}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function validateBakeCloudFoundryManifestStage(stage: IStage): FormikErrors<IStage> {
|
|
31
|
+
const formValidator = new FormValidator(stage);
|
|
32
|
+
|
|
33
|
+
formValidator
|
|
34
|
+
.field('expectedArtifacts', 'Produced artifacts')
|
|
35
|
+
.required()
|
|
36
|
+
.withValidators((artifacts: IExpectedArtifact[]) => {
|
|
37
|
+
if (validateProducedArtifacts(artifacts)) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
return 'Exactly one expected artifact of type embedded/base64 must be configured in the Produces Artifacts section';
|
|
41
|
+
});
|
|
42
|
+
formValidator.field('outputName', 'Name').required();
|
|
43
|
+
formValidator
|
|
44
|
+
.field('inputArtifacts', 'Template and Variables Artifacts')
|
|
45
|
+
.required()
|
|
46
|
+
.withValidators((artifacts: IArtifact[]) => {
|
|
47
|
+
if (validateInputArtifacts(artifacts)) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
return 'There should be one manifest template and at least one variables artifact';
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
return formValidator.validateForm();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function validateProducedArtifacts(artifacts: IExpectedArtifact[]): boolean {
|
|
57
|
+
return artifacts?.length === 1 && artifacts[0]?.matchArtifact?.type === 'embedded/base64';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function validateInputArtifacts(artifacts: IArtifact[]): boolean {
|
|
61
|
+
return artifacts?.length >= 2;
|
|
62
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { IArtifact, IExpectedArtifact, IFormikStageConfigInjectedProps } from '@spinnaker/core';
|
|
4
|
+
import {
|
|
5
|
+
ArtifactTypePatterns,
|
|
6
|
+
excludeAllTypesExcept,
|
|
7
|
+
StageArtifactSelectorDelegate,
|
|
8
|
+
StageConfigField,
|
|
9
|
+
TextInput,
|
|
10
|
+
} from '@spinnaker/core';
|
|
11
|
+
|
|
12
|
+
export class BakeCloudFoundryManifestConfigForm extends React.Component<IFormikStageConfigInjectedProps> {
|
|
13
|
+
private static readonly excludedArtifactTypes = excludeAllTypesExcept(
|
|
14
|
+
ArtifactTypePatterns.BITBUCKET_FILE,
|
|
15
|
+
ArtifactTypePatterns.CUSTOM_OBJECT,
|
|
16
|
+
ArtifactTypePatterns.EMBEDDED_BASE64,
|
|
17
|
+
ArtifactTypePatterns.GCS_OBJECT,
|
|
18
|
+
ArtifactTypePatterns.GITHUB_FILE,
|
|
19
|
+
ArtifactTypePatterns.GITLAB_FILE,
|
|
20
|
+
ArtifactTypePatterns.S3_OBJECT,
|
|
21
|
+
ArtifactTypePatterns.HTTP_FILE,
|
|
22
|
+
ArtifactTypePatterns.ORACLE_OBJECT,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
public componentDidMount() {
|
|
26
|
+
const stage = this.props.formik.values;
|
|
27
|
+
if (stage.inputArtifacts && stage.inputArtifacts.length === 0) {
|
|
28
|
+
this.props.formik.setFieldValue('inputArtifacts', [
|
|
29
|
+
{
|
|
30
|
+
account: '',
|
|
31
|
+
id: '',
|
|
32
|
+
},
|
|
33
|
+
]);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private onTemplateArtifactEdited = (artifact: IArtifact, index: number) => {
|
|
38
|
+
this.props.formik.setFieldValue(`inputArtifacts[${index}].id`, null);
|
|
39
|
+
this.props.formik.setFieldValue(`inputArtifacts[${index}].artifact`, artifact);
|
|
40
|
+
this.props.formik.setFieldValue(`inputArtifacts[${index}].account`, artifact.artifactAccount);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
private onTemplateArtifactSelected = (id: string, index: number) => {
|
|
44
|
+
this.props.formik.setFieldValue(`inputArtifacts[${index}].id`, id);
|
|
45
|
+
this.props.formik.setFieldValue(`inputArtifacts[${index}].artifact`, null);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
private addInputArtifact = () => {
|
|
49
|
+
const stage = this.props.formik.values;
|
|
50
|
+
const newInputArtifacts = [
|
|
51
|
+
...stage.inputArtifacts,
|
|
52
|
+
{
|
|
53
|
+
account: '',
|
|
54
|
+
id: '',
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
this.props.formik.setFieldValue('inputArtifacts', newInputArtifacts);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
private removeInputArtifact = (index: number) => {
|
|
62
|
+
const stage = this.props.formik.values;
|
|
63
|
+
const newInputArtifacts = [...stage.inputArtifacts];
|
|
64
|
+
newInputArtifacts.splice(index, 1);
|
|
65
|
+
this.props.formik.setFieldValue('inputArtifacts', newInputArtifacts);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
private getInputArtifact = (stage: any, index: number) => {
|
|
69
|
+
if (!stage.inputArtifacts || stage.inputArtifacts.length === 0) {
|
|
70
|
+
return {
|
|
71
|
+
account: '',
|
|
72
|
+
id: '',
|
|
73
|
+
};
|
|
74
|
+
} else {
|
|
75
|
+
return stage.inputArtifacts[index];
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
private outputNameChange = (outputName: string) => {
|
|
80
|
+
const stage = this.props.formik.values;
|
|
81
|
+
const expectedArtifacts = stage.expectedArtifacts;
|
|
82
|
+
if (
|
|
83
|
+
expectedArtifacts &&
|
|
84
|
+
expectedArtifacts.length === 1 &&
|
|
85
|
+
expectedArtifacts[0].matchArtifact &&
|
|
86
|
+
expectedArtifacts[0].matchArtifact.type === 'embedded/base64'
|
|
87
|
+
) {
|
|
88
|
+
this.props.formik.setFieldValue('expectedArtifacts', [
|
|
89
|
+
{
|
|
90
|
+
...expectedArtifacts[0],
|
|
91
|
+
matchArtifact: {
|
|
92
|
+
...expectedArtifacts[0].matchArtifact,
|
|
93
|
+
name: outputName,
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
]);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
public render() {
|
|
101
|
+
const stage = this.props.formik.values;
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<>
|
|
105
|
+
<h4>Manifest Options</h4>
|
|
106
|
+
<StageConfigField fieldColumns={3} label={'Name'} helpKey={'pipeline.config.bake.cf.manifest.name'}>
|
|
107
|
+
<TextInput
|
|
108
|
+
onChange={(e: React.ChangeEvent<any>) => {
|
|
109
|
+
this.props.formik.setFieldValue('outputName', e.target.value);
|
|
110
|
+
this.outputNameChange(e.target.value);
|
|
111
|
+
}}
|
|
112
|
+
value={stage.outputName}
|
|
113
|
+
/>
|
|
114
|
+
</StageConfigField>
|
|
115
|
+
<h4>Manifest Template</h4>
|
|
116
|
+
<StageArtifactSelectorDelegate
|
|
117
|
+
artifact={this.getInputArtifact(stage, 0).artifact}
|
|
118
|
+
excludedArtifactTypePatterns={BakeCloudFoundryManifestConfigForm.excludedArtifactTypes}
|
|
119
|
+
expectedArtifactId={this.getInputArtifact(stage, 0).id}
|
|
120
|
+
label="Template Artifact"
|
|
121
|
+
onArtifactEdited={(artifact) => {
|
|
122
|
+
this.onTemplateArtifactEdited(artifact, 0);
|
|
123
|
+
}}
|
|
124
|
+
helpKey={'pipeline.config.bake.cf.manifest.templateArtifact'}
|
|
125
|
+
onExpectedArtifactSelected={(artifact: IExpectedArtifact) => this.onTemplateArtifactSelected(artifact.id, 0)}
|
|
126
|
+
pipeline={this.props.pipeline}
|
|
127
|
+
stage={stage}
|
|
128
|
+
/>
|
|
129
|
+
<h4>Manifest Variables</h4>
|
|
130
|
+
{stage.inputArtifacts && stage.inputArtifacts.length > 1 && (
|
|
131
|
+
<div className="row form-group">
|
|
132
|
+
{stage.inputArtifacts.slice(1).map((a: any, index: number) => {
|
|
133
|
+
return (
|
|
134
|
+
<div key={index}>
|
|
135
|
+
<div className="col-md-offset-1 col-md-9">
|
|
136
|
+
<StageArtifactSelectorDelegate
|
|
137
|
+
artifact={a.artifact}
|
|
138
|
+
excludedArtifactTypePatterns={[]}
|
|
139
|
+
expectedArtifactId={a.id}
|
|
140
|
+
label="Variables Artifact"
|
|
141
|
+
onArtifactEdited={(artifact) => {
|
|
142
|
+
this.onTemplateArtifactEdited(artifact, index + 1);
|
|
143
|
+
}}
|
|
144
|
+
onExpectedArtifactSelected={(artifact: IExpectedArtifact) =>
|
|
145
|
+
this.onTemplateArtifactSelected(artifact.id, index + 1)
|
|
146
|
+
}
|
|
147
|
+
helpKey={'pipeline.config.bake.cf.manifest.varsArtifact'}
|
|
148
|
+
pipeline={this.props.pipeline}
|
|
149
|
+
stage={stage}
|
|
150
|
+
/>
|
|
151
|
+
</div>
|
|
152
|
+
<div className="col-md-1">
|
|
153
|
+
<div className="form-control-static">
|
|
154
|
+
<button onClick={() => this.removeInputArtifact(index + 1)}>
|
|
155
|
+
<span className="glyphicon glyphicon-trash" />
|
|
156
|
+
<span className="sr-only">Remove field</span>
|
|
157
|
+
</button>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
);
|
|
162
|
+
})}
|
|
163
|
+
</div>
|
|
164
|
+
)}
|
|
165
|
+
<StageConfigField fieldColumns={8} label={''}>
|
|
166
|
+
<button className="btn btn-block btn-sm add-new" onClick={() => this.addInputArtifact()}>
|
|
167
|
+
<span className="glyphicon glyphicon-plus-sign" />
|
|
168
|
+
Add variables artifact
|
|
169
|
+
</button>
|
|
170
|
+
</StageConfigField>
|
|
171
|
+
</>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { IArtifact, IExecutionDetailsSectionProps } from '@spinnaker/core';
|
|
4
|
+
import {
|
|
5
|
+
decodeUnicodeBase64,
|
|
6
|
+
ExecutionDetailsSection,
|
|
7
|
+
ManifestYaml,
|
|
8
|
+
Overridable,
|
|
9
|
+
StageFailureMessage,
|
|
10
|
+
} from '@spinnaker/core';
|
|
11
|
+
|
|
12
|
+
@Overridable('bakeManifest.bakeManifestDetailsTab')
|
|
13
|
+
export class BakeCloudFoundryManifestDetailsTab extends React.Component<IExecutionDetailsSectionProps> {
|
|
14
|
+
public static title = 'bakedManifest';
|
|
15
|
+
|
|
16
|
+
public render() {
|
|
17
|
+
const { current, name, stage } = this.props;
|
|
18
|
+
const bakedArtifacts: IArtifact[] = (stage.context.artifacts || []).filter(
|
|
19
|
+
(a: IArtifact) => a.type === 'embedded/base64',
|
|
20
|
+
);
|
|
21
|
+
return (
|
|
22
|
+
<ExecutionDetailsSection name={name} current={current}>
|
|
23
|
+
<StageFailureMessage stage={stage} message={stage.failureMessage} />
|
|
24
|
+
{bakedArtifacts.map((artifact, i) => (
|
|
25
|
+
<ManifestYaml
|
|
26
|
+
key={i}
|
|
27
|
+
linkName={bakedArtifacts.length > 1 ? `Baked Manifest ${i} YAML` : 'Baked Manifest YAML'}
|
|
28
|
+
manifestText={decodeUnicodeBase64(artifact.reference)}
|
|
29
|
+
modalTitle="Baked Manifest"
|
|
30
|
+
/>
|
|
31
|
+
))}
|
|
32
|
+
</ExecutionDetailsSection>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { IArtifact, IExpectedArtifact } from '@spinnaker/core';
|
|
2
|
+
|
|
3
|
+
import { validateInputArtifacts, validateProducedArtifacts } from './BakeCloudFoundryManifestConfig';
|
|
4
|
+
|
|
5
|
+
describe('Bake Cloud Foundry Form Validators', () => {
|
|
6
|
+
describe('Validate Input Artifacts', () => {
|
|
7
|
+
it('should fail when given empty input artifacts', () => {
|
|
8
|
+
const inputArtifacts: IArtifact[] = [];
|
|
9
|
+
expect(validateInputArtifacts(inputArtifacts)).toBe(false);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('should fail when given less than 2 input artifacts', () => {
|
|
13
|
+
const inputArtifacts: IArtifact[] = [
|
|
14
|
+
{
|
|
15
|
+
id: 'abc123',
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
expect(validateInputArtifacts(inputArtifacts)).toBe(false);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should pass when given 2 or more input artifacts', () => {
|
|
22
|
+
const inputArtifacts: IArtifact[] = [
|
|
23
|
+
{
|
|
24
|
+
id: 'abc123',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'abc12345',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'abc12345678',
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
expect(validateInputArtifacts(inputArtifacts)).toBe(true);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
describe('Validate Expected Artifacts', () => {
|
|
37
|
+
it('should fail when expected artifacts are empty', () => {
|
|
38
|
+
const expectedArtifacts: IExpectedArtifact[] = [];
|
|
39
|
+
expect(validateProducedArtifacts(expectedArtifacts)).toBe(false);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('should pass when there is 1 expected artifact of type base64', () => {
|
|
43
|
+
const expectedArtifacts: IExpectedArtifact[] = [
|
|
44
|
+
{
|
|
45
|
+
id: 'abc123',
|
|
46
|
+
matchArtifact: {
|
|
47
|
+
type: 'embedded/base64',
|
|
48
|
+
id: 'abc123',
|
|
49
|
+
},
|
|
50
|
+
usePriorArtifact: false,
|
|
51
|
+
useDefaultArtifact: true,
|
|
52
|
+
defaultArtifact: {
|
|
53
|
+
id: 'abc123',
|
|
54
|
+
},
|
|
55
|
+
displayName: 'temp',
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
expect(validateProducedArtifacts(expectedArtifacts)).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('should fail when there is expected artifact of wrong type', () => {
|
|
62
|
+
const expectedArtifacts: IExpectedArtifact[] = [
|
|
63
|
+
{
|
|
64
|
+
id: 'abc123',
|
|
65
|
+
matchArtifact: {
|
|
66
|
+
type: 'NOTembedded/base64',
|
|
67
|
+
id: 'abc123',
|
|
68
|
+
},
|
|
69
|
+
usePriorArtifact: false,
|
|
70
|
+
useDefaultArtifact: true,
|
|
71
|
+
defaultArtifact: {
|
|
72
|
+
id: 'abc123',
|
|
73
|
+
},
|
|
74
|
+
displayName: 'temp',
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
expect(validateProducedArtifacts(expectedArtifacts)).toBe(false);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { IArtifact, IStage } from '@spinnaker/core';
|
|
2
|
+
import {
|
|
3
|
+
ArtifactReferenceService,
|
|
4
|
+
ExecutionArtifactTab,
|
|
5
|
+
ExecutionDetailsTasks,
|
|
6
|
+
ExpectedArtifactService,
|
|
7
|
+
Registry,
|
|
8
|
+
} from '@spinnaker/core';
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
BakeCloudFoundryManifestConfig,
|
|
12
|
+
validateBakeCloudFoundryManifestStage,
|
|
13
|
+
} from './BakeCloudFoundryManifestConfig';
|
|
14
|
+
import { BakeCloudFoundryManifestDetailsTab } from './BakeCloudFoundryManifestDetailsTab';
|
|
15
|
+
|
|
16
|
+
export const BAKE_CF_MANIFEST_STAGE_KEY = 'bakeCloudFoundryManifest';
|
|
17
|
+
|
|
18
|
+
Registry.pipeline.registerStage({
|
|
19
|
+
label: 'Bake CloudFoundry Manifest',
|
|
20
|
+
description: 'Bake a CF manifest using external variables files.',
|
|
21
|
+
key: BAKE_CF_MANIFEST_STAGE_KEY,
|
|
22
|
+
component: BakeCloudFoundryManifestConfig,
|
|
23
|
+
producesArtifacts: true,
|
|
24
|
+
cloudProvider: 'cloudfoundry',
|
|
25
|
+
executionDetailsSections: [BakeCloudFoundryManifestDetailsTab, ExecutionDetailsTasks, ExecutionArtifactTab],
|
|
26
|
+
artifactExtractor: (fields: string[]) =>
|
|
27
|
+
ExpectedArtifactService.accumulateArtifacts<IArtifact>(['inputArtifacts'])(fields).map((a: IArtifact) => a.id),
|
|
28
|
+
artifactRemover: (stage: IStage, artifactId: string) => {
|
|
29
|
+
ArtifactReferenceService.removeArtifactFromFields(['expectedArtifactId'])(stage, artifactId);
|
|
30
|
+
const artifactDoesNotMatch = (artifact: IArtifact) => artifact.id !== artifactId;
|
|
31
|
+
stage.expectedArtifacts = (stage.expectedArtifacts ?? []).filter(artifactDoesNotMatch);
|
|
32
|
+
stage.inputArtifacts = (stage.inputArtifacts ?? []).filter(artifactDoesNotMatch);
|
|
33
|
+
},
|
|
34
|
+
validateFn: validateBakeCloudFoundryManifestStage,
|
|
35
|
+
});
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { IStageConfigProps } from '@spinnaker/core';
|
|
4
|
+
import { StageConstants } from '@spinnaker/core';
|
|
5
|
+
import { CloudFoundryServerGroupCommandBuilder } from '../../../serverGroup/configure';
|
|
6
|
+
import { CloudFoundryCreateServerGroupModal } from '../../../serverGroup/configure/wizard/CreateServerGroupModal';
|
|
7
|
+
|
|
8
|
+
export interface ICloudFoundryCloneServerGroupStageConfigState {
|
|
9
|
+
buttonText: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class CloudFoundryCloneServerGroupStageConfig extends React.Component<
|
|
13
|
+
IStageConfigProps,
|
|
14
|
+
ICloudFoundryCloneServerGroupStageConfigState
|
|
15
|
+
> {
|
|
16
|
+
constructor(props: IStageConfigProps) {
|
|
17
|
+
super(props);
|
|
18
|
+
this.props.updateStageField({
|
|
19
|
+
cloudProvider: 'cloudfoundry',
|
|
20
|
+
application: props.application.name,
|
|
21
|
+
});
|
|
22
|
+
this.state = {
|
|
23
|
+
buttonText: props.stage.destination ? 'Edit clone configuration' : 'Add clone configuration',
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
private handleResult = (command: any) => {
|
|
28
|
+
this.props.updateStageField({
|
|
29
|
+
credentials: command.credentials,
|
|
30
|
+
capacity: command.capacity,
|
|
31
|
+
account: command.account,
|
|
32
|
+
delayBeforeDisableSec: command.delayBeforeDisableSec,
|
|
33
|
+
freeFormDetails: command.freeFormDetails,
|
|
34
|
+
maxRemainingAsgs: command.maxRemainingAsgs,
|
|
35
|
+
region: command.region,
|
|
36
|
+
startApplication: command.startApplication,
|
|
37
|
+
stack: command.stack,
|
|
38
|
+
strategy: command.strategy,
|
|
39
|
+
target: command.target,
|
|
40
|
+
targetCluster: command.targetCluster,
|
|
41
|
+
manifest: command.manifest,
|
|
42
|
+
source: command.source,
|
|
43
|
+
});
|
|
44
|
+
this.setState({ buttonText: 'Edit clone configuration' });
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
private addCluster = () => {
|
|
48
|
+
const { application, stage, pipeline } = this.props;
|
|
49
|
+
const title = 'Clone Cluster';
|
|
50
|
+
const command = CloudFoundryServerGroupCommandBuilder.buildCloneServerGroupCommandFromPipeline(stage, pipeline);
|
|
51
|
+
CloudFoundryCreateServerGroupModal.show({
|
|
52
|
+
application,
|
|
53
|
+
command,
|
|
54
|
+
isSourceConstant: false,
|
|
55
|
+
title,
|
|
56
|
+
})
|
|
57
|
+
.then(this.handleResult)
|
|
58
|
+
.catch(() => {});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
public render() {
|
|
62
|
+
const { stage } = this.props;
|
|
63
|
+
const { buttonText } = this.state;
|
|
64
|
+
const cloneTargets = StageConstants.TARGET_LIST;
|
|
65
|
+
return (
|
|
66
|
+
<div className="form-horizontal">
|
|
67
|
+
<div>
|
|
68
|
+
<h4>Clone Source</h4>
|
|
69
|
+
<table className="table table-condensed table-deployStage">
|
|
70
|
+
<thead>
|
|
71
|
+
<tr>
|
|
72
|
+
<th>Account</th>
|
|
73
|
+
<th>Region</th>
|
|
74
|
+
<th>Cluster</th>
|
|
75
|
+
<th>Target</th>
|
|
76
|
+
</tr>
|
|
77
|
+
</thead>
|
|
78
|
+
<tbody>
|
|
79
|
+
<tr>
|
|
80
|
+
<td>{stage.source ? stage.source.account : ''}</td>
|
|
81
|
+
<td>{stage.source ? stage.source.region : ''}</td>
|
|
82
|
+
<td>{stage.source ? stage.source.clusterName : ''}</td>
|
|
83
|
+
<td>
|
|
84
|
+
{stage.source ? cloneTargets.filter((t) => t.val === stage.source.target).map((t) => t.label) : ''}
|
|
85
|
+
</td>
|
|
86
|
+
</tr>
|
|
87
|
+
</tbody>
|
|
88
|
+
</table>
|
|
89
|
+
</div>
|
|
90
|
+
<div>
|
|
91
|
+
<h4>Clone Destination</h4>
|
|
92
|
+
<table className="table table-condensed table-deployStage">
|
|
93
|
+
<thead>
|
|
94
|
+
<tr>
|
|
95
|
+
<th>Account</th>
|
|
96
|
+
<th>Region</th>
|
|
97
|
+
</tr>
|
|
98
|
+
</thead>
|
|
99
|
+
<tbody>
|
|
100
|
+
<tr>
|
|
101
|
+
<td>{stage.credentials}</td>
|
|
102
|
+
<td>{stage.region}</td>
|
|
103
|
+
</tr>
|
|
104
|
+
</tbody>
|
|
105
|
+
</table>
|
|
106
|
+
</div>
|
|
107
|
+
<button className="btn btn-block btn-sm add-new" onClick={() => this.addCluster()}>
|
|
108
|
+
<span className="glyphicon glyphicon-plus-sign" /> {buttonText}
|
|
109
|
+
</button>
|
|
110
|
+
</div>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IStage } from '@spinnaker/core';
|
|
2
|
+
import { Registry } from '@spinnaker/core';
|
|
3
|
+
|
|
4
|
+
import { CloudFoundryCloneServerGroupStageConfig } from './CloudFoundryCloneServerGroupStageConfig';
|
|
5
|
+
|
|
6
|
+
Registry.pipeline.registerStage({
|
|
7
|
+
accountExtractor: (stage: IStage) => [stage.context.credentials],
|
|
8
|
+
cloudProvider: 'cloudfoundry',
|
|
9
|
+
component: CloudFoundryCloneServerGroupStageConfig,
|
|
10
|
+
configAccountExtractor: (stage: IStage) => [stage.credentials],
|
|
11
|
+
key: 'cloneServerGroup',
|
|
12
|
+
provides: 'cloneServerGroup',
|
|
13
|
+
validators: [],
|
|
14
|
+
});
|
package/src/pipeline/stages/createServiceBindings/CloudFoundryCreateServiceBindingsConfig.spec.tsx
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ServiceBindingRequests } from './CloudFoundryCreateServiceBindingsConfig';
|
|
2
|
+
import { validateServiceBindingRequests } from './CloudFoundryCreateServiceBindingsConfig';
|
|
3
|
+
|
|
4
|
+
describe('Cloud Foundry Create Service Bindings Config', () => {
|
|
5
|
+
describe('validate Service Binding Requests', () => {
|
|
6
|
+
it('should return false when the array is empty', () => {
|
|
7
|
+
const bindingRequests: ServiceBindingRequests[] = [];
|
|
8
|
+
expect(validateServiceBindingRequests(bindingRequests)).toBe(false);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('should return false when at least one serviceInstanceName is null', () => {
|
|
12
|
+
const bindingRequests: ServiceBindingRequests[] = [
|
|
13
|
+
{ serviceInstanceName: 'instanceName' },
|
|
14
|
+
{ serviceInstanceName: null },
|
|
15
|
+
];
|
|
16
|
+
expect(validateServiceBindingRequests(bindingRequests)).toBe(false);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should return false when at least one serviceInstanceName is empty', () => {
|
|
20
|
+
const bindingRequests: ServiceBindingRequests[] = [
|
|
21
|
+
{ serviceInstanceName: 'instanceName' },
|
|
22
|
+
{ serviceInstanceName: '' },
|
|
23
|
+
];
|
|
24
|
+
expect(validateServiceBindingRequests(bindingRequests)).toBe(false);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should return true when all serviceInstanceName are not empty', () => {
|
|
28
|
+
const bindingRequests: ServiceBindingRequests[] = [
|
|
29
|
+
{ serviceInstanceName: 'instanceName' },
|
|
30
|
+
{ serviceInstanceName: 'instanceName2' },
|
|
31
|
+
];
|
|
32
|
+
expect(validateServiceBindingRequests(bindingRequests)).toBe(true);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|