@spinnaker/appengine 0.0.0-2025.1-0
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 +981 -0
- package/LICENSE.txt +203 -0
- package/dist/appengine.logoc2c312af6aa99037.png +0 -0
- package/dist/appengine.module.d.ts +5 -0
- package/dist/appengine.settings.d.ts +7 -0
- package/dist/common/FormikAccountRegionSelector.d.ts +26 -0
- package/dist/common/appengineHealth.d.ts +3 -0
- package/dist/common/componentUrlDetails.component.d.ts +1 -0
- package/dist/common/conditionalDescriptionListItem.component.d.ts +1 -0
- package/dist/common/loadBalancerMessage.component.d.ts +1 -0
- package/dist/domain/IAppengineAccount.d.ts +6 -0
- package/dist/domain/IAppengineInstance.d.ts +20 -0
- package/dist/domain/IAppengineLoadBalancer.d.ts +19 -0
- package/dist/domain/IAppengineServerGroup.d.ts +11 -0
- package/dist/domain/IAppengineStageScope.d.ts +18 -0
- package/dist/domain/IAppengineTriggers.d.ts +11 -0
- package/dist/domain/index.d.ts +6 -0
- package/dist/helpContents/appengineHelpContents.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4084 -0
- package/dist/index.js.map +1 -0
- package/dist/instance/details/details.controller.d.ts +1 -0
- package/dist/loadBalancer/configure/wizard/advancedSettings.component.d.ts +1 -0
- package/dist/loadBalancer/configure/wizard/allocationConfigurationRow.component.d.ts +1 -0
- package/dist/loadBalancer/configure/wizard/basicSettings.component.d.ts +1 -0
- package/dist/loadBalancer/configure/wizard/stageAllocationConfigurationRow.component.d.ts +1 -0
- package/dist/loadBalancer/configure/wizard/wizard.controller.d.ts +2 -0
- package/dist/loadBalancer/details/details.controller.d.ts +1 -0
- package/dist/loadBalancer/loadBalancer.module.d.ts +1 -0
- package/dist/loadBalancer/transformer.d.ts +40 -0
- package/dist/pipeline/pipeline.module.d.ts +1 -0
- package/dist/pipeline/stages/appengineStage.controller.d.ts +12 -0
- package/dist/pipeline/stages/deployAppengineConfig/DeployAppengineConfigForm.d.ts +16 -0
- package/dist/pipeline/stages/deployAppengineConfig/DeployAppengineConfigurationConfig.d.ts +5 -0
- package/dist/pipeline/stages/deployAppengineConfig/deployAppengineConfigStage.d.ts +1 -0
- package/dist/pipeline/stages/destroyAsg/appengineDestroyAsgStage.d.ts +1 -0
- package/dist/pipeline/stages/disableAsg/appengineDisableAsgStage.d.ts +1 -0
- package/dist/pipeline/stages/editLoadBalancer/appengineEditLoadBalancerStage.d.ts +1 -0
- package/dist/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.controller.d.ts +1 -0
- package/dist/pipeline/stages/enableAsg/appengineEnableAsgStage.d.ts +1 -0
- package/dist/pipeline/stages/shrinkCluster/appengineShrinkClusterStage.d.ts +1 -0
- package/dist/pipeline/stages/startServerGroup/appengineStartServerGroupStage.d.ts +1 -0
- package/dist/pipeline/stages/stopServerGroup/appengineStopServerGroupStage.d.ts +1 -0
- package/dist/serverGroup/configure/serverGroupCommandBuilder.service.d.ts +74 -0
- package/dist/serverGroup/configure/wizard/ConfigFileArtifactList.d.ts +10 -0
- package/dist/serverGroup/configure/wizard/basicSettings.controller.d.ts +1 -0
- package/dist/serverGroup/configure/wizard/cloneServerGroup.controller.d.ts +2 -0
- package/dist/serverGroup/configure/wizard/configFileArtifactList.module.d.ts +1 -0
- package/dist/serverGroup/configure/wizard/configFiles.component.d.ts +20 -0
- package/dist/serverGroup/configure/wizard/dynamicBranchLabel.component.d.ts +1 -0
- package/dist/serverGroup/details/details.controller.d.ts +1 -0
- package/dist/serverGroup/transformer.d.ts +45 -0
- package/dist/serverGroup/writer/serverGroup.write.service.d.ts +8 -0
- package/dist/validation/ApplicationNameValidator.d.ts +1 -0
- package/package.json +46 -0
- package/src/appengine.module.ts +70 -0
- package/src/appengine.settings.ts +14 -0
- package/src/common/FormikAccountRegionSelector.tsx +107 -0
- package/src/common/appengineHealth.ts +3 -0
- package/src/common/componentUrlDetails.component.ts +29 -0
- package/src/common/conditionalDescriptionListItem.component.ts +37 -0
- package/src/common/loadBalancerMessage.component.html +33 -0
- package/src/common/loadBalancerMessage.component.ts +13 -0
- package/src/domain/IAppengineAccount.ts +8 -0
- package/src/domain/IAppengineInstance.ts +21 -0
- package/src/domain/IAppengineLoadBalancer.ts +21 -0
- package/src/domain/IAppengineServerGroup.ts +13 -0
- package/src/domain/IAppengineStageScope.ts +22 -0
- package/src/domain/IAppengineTriggers.ts +12 -0
- package/src/domain/index.ts +6 -0
- package/src/helpContents/appengineHelpContents.ts +141 -0
- package/src/index.ts +1 -0
- package/src/instance/details/details.controller.ts +116 -0
- package/src/instance/details/details.html +99 -0
- package/src/loadBalancer/configure/wizard/advancedSettings.component.ts +56 -0
- package/src/loadBalancer/configure/wizard/allocationConfigurationRow.component.ts +70 -0
- package/src/loadBalancer/configure/wizard/basicSettings.component.html +65 -0
- package/src/loadBalancer/configure/wizard/basicSettings.component.ts +98 -0
- package/src/loadBalancer/configure/wizard/stageAllocationConfigurationRow.component.html +117 -0
- package/src/loadBalancer/configure/wizard/stageAllocationConfigurationRow.component.ts +108 -0
- package/src/loadBalancer/configure/wizard/wizard.controller.ts +163 -0
- package/src/loadBalancer/configure/wizard/wizard.html +44 -0
- package/src/loadBalancer/configure/wizard/wizard.less +17 -0
- package/src/loadBalancer/details/details.controller.ts +151 -0
- package/src/loadBalancer/details/details.html +102 -0
- package/src/loadBalancer/loadBalancer.module.ts +21 -0
- package/src/loadBalancer/transformer.ts +170 -0
- package/src/logo/appengine.icon.svg +37 -0
- package/src/logo/appengine.logo.less +6 -0
- package/src/logo/appengine.logo.png +0 -0
- package/src/pipeline/pipeline.module.ts +20 -0
- package/src/pipeline/stages/appengineStage.controller.ts +45 -0
- package/src/pipeline/stages/deployAppengineConfig/DeployAppengineConfigForm.tsx +203 -0
- package/src/pipeline/stages/deployAppengineConfig/DeployAppengineConfigurationConfig.tsx +34 -0
- package/src/pipeline/stages/deployAppengineConfig/deployAppengineConfigStage.ts +19 -0
- package/src/pipeline/stages/destroyAsg/appengineDestroyAsgStage.ts +45 -0
- package/src/pipeline/stages/destroyAsg/destroyAsgStage.html +16 -0
- package/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html +1 -0
- package/src/pipeline/stages/disableAsg/appengineDisableAsgStage.ts +54 -0
- package/src/pipeline/stages/disableAsg/disableAsgStage.html +18 -0
- package/src/pipeline/stages/disableAsg/disableAsgStepLabel.html +1 -0
- package/src/pipeline/stages/editLoadBalancer/appengineEditLoadBalancerStage.ts +74 -0
- package/src/pipeline/stages/editLoadBalancer/editLoadBalancerExecutionDetails.html +33 -0
- package/src/pipeline/stages/editLoadBalancer/editLoadBalancerStage.html +51 -0
- package/src/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.controller.ts +65 -0
- package/src/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.html +45 -0
- package/src/pipeline/stages/enableAsg/appengineEnableAsgStage.ts +49 -0
- package/src/pipeline/stages/enableAsg/enableAsgStage.html +18 -0
- package/src/pipeline/stages/enableAsg/enableAsgStepLabel.html +1 -0
- package/src/pipeline/stages/shrinkCluster/appengineShrinkClusterStage.ts +62 -0
- package/src/pipeline/stages/shrinkCluster/shrinkClusterStage.html +41 -0
- package/src/pipeline/stages/startServerGroup/appengineStartServerGroupStage.ts +54 -0
- package/src/pipeline/stages/startServerGroup/startServerGroupExecutionDetails.html +26 -0
- package/src/pipeline/stages/startServerGroup/startServerGroupStage.html +18 -0
- package/src/pipeline/stages/startServerGroup/startServerGroupStepLabel.html +1 -0
- package/src/pipeline/stages/stopServerGroup/appengineStopServerGroupStage.ts +54 -0
- package/src/pipeline/stages/stopServerGroup/stopServerGroupExecutionDetails.html +26 -0
- package/src/pipeline/stages/stopServerGroup/stopServerGroupStage.html +18 -0
- package/src/pipeline/stages/stopServerGroup/stopServerGroupStepLabel.html +1 -0
- package/src/serverGroup/configure/serverGroupCommandBuilder.service.ts +235 -0
- package/src/serverGroup/configure/wizard/ConfigFileArtifactList.tsx +81 -0
- package/src/serverGroup/configure/wizard/advancedSettings.html +33 -0
- package/src/serverGroup/configure/wizard/basicSettings.controller.ts +151 -0
- package/src/serverGroup/configure/wizard/basicSettings.html +287 -0
- package/src/serverGroup/configure/wizard/cloneServerGroup.controller.ts +103 -0
- package/src/serverGroup/configure/wizard/configFileArtifactList.module.ts +18 -0
- package/src/serverGroup/configure/wizard/configFileArtifactList.spec.tsx +78 -0
- package/src/serverGroup/configure/wizard/configFiles.component.html +81 -0
- package/src/serverGroup/configure/wizard/configFiles.component.ts +121 -0
- package/src/serverGroup/configure/wizard/dynamicBranchLabel.component.ts +19 -0
- package/src/serverGroup/configure/wizard/serverGroupWizard.html +39 -0
- package/src/serverGroup/configure/wizard/serverGroupWizard.less +28 -0
- package/src/serverGroup/details/details.controller.ts +463 -0
- package/src/serverGroup/details/details.html +229 -0
- package/src/serverGroup/transformer.ts +92 -0
- package/src/serverGroup/transformet.spec.ts +40 -0
- package/src/serverGroup/writer/serverGroup.write.service.ts +57 -0
- package/src/validation/ApplicationNameValidator.ts +40 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { module } from 'angular';
|
|
2
|
+
|
|
3
|
+
import type { IArtifact, IArtifactAccountPair, IServerGroup } from '@spinnaker/core';
|
|
4
|
+
|
|
5
|
+
import type { IAppengineServerGroupCommand } from './configure/serverGroupCommandBuilder.service';
|
|
6
|
+
import type { GitCredentialType, IAppengineGitTrigger, IAppengineJenkinsTrigger } from '../domain/index';
|
|
7
|
+
|
|
8
|
+
export class AppengineDeployDescription {
|
|
9
|
+
public cloudProvider = 'appengine';
|
|
10
|
+
public provider = 'appengine';
|
|
11
|
+
public credentials: string;
|
|
12
|
+
public account: string;
|
|
13
|
+
public application: string;
|
|
14
|
+
public stack?: string;
|
|
15
|
+
public freeFormDetails?: string;
|
|
16
|
+
public repositoryUrl: string;
|
|
17
|
+
public branch: string;
|
|
18
|
+
public configFilepaths: string[];
|
|
19
|
+
public configFiles: string[];
|
|
20
|
+
public configArtifacts: IArtifactAccountPair[];
|
|
21
|
+
public applicationDirectoryRoot: string;
|
|
22
|
+
public promote?: boolean;
|
|
23
|
+
public stopPreviousVersion?: boolean;
|
|
24
|
+
public type: string;
|
|
25
|
+
public region: string;
|
|
26
|
+
public strategy?: string;
|
|
27
|
+
public strategyApplication?: string;
|
|
28
|
+
public strategyPipeline?: string;
|
|
29
|
+
public fromTrigger?: boolean;
|
|
30
|
+
public trigger?: IAppengineGitTrigger | IAppengineJenkinsTrigger;
|
|
31
|
+
public gitCredentialType: GitCredentialType;
|
|
32
|
+
public interestingHealthProviderNames: string[];
|
|
33
|
+
public expectedArtifactId: string;
|
|
34
|
+
public expectedArtifact: IArtifact;
|
|
35
|
+
public fromArtifact: boolean;
|
|
36
|
+
public sourceType: string;
|
|
37
|
+
public storageAccountName?: string;
|
|
38
|
+
public containerImageUrl?: string;
|
|
39
|
+
public suppressVersionString?: boolean;
|
|
40
|
+
|
|
41
|
+
constructor(command: IAppengineServerGroupCommand) {
|
|
42
|
+
this.credentials = command.credentials;
|
|
43
|
+
this.account = command.credentials;
|
|
44
|
+
this.application = command.application;
|
|
45
|
+
this.stack = command.stack;
|
|
46
|
+
this.freeFormDetails = command.freeFormDetails;
|
|
47
|
+
this.repositoryUrl = command.repositoryUrl;
|
|
48
|
+
this.branch = command.branch;
|
|
49
|
+
this.configFilepaths = command.configFilepaths;
|
|
50
|
+
this.promote = command.promote;
|
|
51
|
+
this.stopPreviousVersion = command.stopPreviousVersion;
|
|
52
|
+
this.type = command.type;
|
|
53
|
+
this.region = command.region;
|
|
54
|
+
this.strategy = command.strategy;
|
|
55
|
+
this.strategyApplication = command.strategyApplication;
|
|
56
|
+
this.strategyPipeline = command.strategyPipeline;
|
|
57
|
+
this.fromTrigger = command.fromTrigger;
|
|
58
|
+
this.trigger = command.trigger;
|
|
59
|
+
this.gitCredentialType = command.gitCredentialType;
|
|
60
|
+
this.configFiles = command.configFiles;
|
|
61
|
+
this.configArtifacts = command.configArtifacts.filter((a) => !!a.id || !!a.artifact);
|
|
62
|
+
this.applicationDirectoryRoot = command.applicationDirectoryRoot;
|
|
63
|
+
this.interestingHealthProviderNames = command.interestingHealthProviderNames || [];
|
|
64
|
+
this.expectedArtifactId = command.expectedArtifactId;
|
|
65
|
+
this.expectedArtifact = command.expectedArtifact;
|
|
66
|
+
this.fromArtifact = command.fromArtifact;
|
|
67
|
+
this.sourceType = command.sourceType;
|
|
68
|
+
this.storageAccountName = command.storageAccountName;
|
|
69
|
+
this.containerImageUrl = command.containerImageUrl;
|
|
70
|
+
this.suppressVersionString = command.suppressVersionString;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export class AppengineServerGroupTransformer {
|
|
75
|
+
public static $inject = ['$q'];
|
|
76
|
+
constructor(private $q: ng.IQService) {}
|
|
77
|
+
|
|
78
|
+
public normalizeServerGroup(serverGroup: IServerGroup): PromiseLike<IServerGroup> {
|
|
79
|
+
return this.$q.resolve(serverGroup);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public convertServerGroupCommandToDeployConfiguration(command: IAppengineServerGroupCommand) {
|
|
83
|
+
return new AppengineDeployDescription(command);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const APPENGINE_SERVER_GROUP_TRANSFORMER = 'spinnaker.appengine.serverGroup.transformer.service';
|
|
88
|
+
|
|
89
|
+
module(APPENGINE_SERVER_GROUP_TRANSFORMER, []).service(
|
|
90
|
+
'appengineServerGroupTransformer',
|
|
91
|
+
AppengineServerGroupTransformer,
|
|
92
|
+
);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AppengineServerGroupTransformer } from './transformer';
|
|
2
|
+
|
|
3
|
+
describe('command transforms', () => {
|
|
4
|
+
it('converts the command into an AppengineDeployDescription object', () => {
|
|
5
|
+
const transformer = new AppengineServerGroupTransformer(null);
|
|
6
|
+
const command: any = {
|
|
7
|
+
expectedArtifact: {
|
|
8
|
+
id: '1234',
|
|
9
|
+
type: 'docker/image',
|
|
10
|
+
name: 'gcr.io/hale-entry-305216/test',
|
|
11
|
+
version: 'test',
|
|
12
|
+
reference: 'gcr.io/hale-entry-305216/test:test',
|
|
13
|
+
artifactAccount: 'docker-registry',
|
|
14
|
+
customKind: true,
|
|
15
|
+
},
|
|
16
|
+
credentials: 'credentials',
|
|
17
|
+
region: 'us-central',
|
|
18
|
+
selectedProvider: 'appengine',
|
|
19
|
+
applicationDirectoryRoot: '',
|
|
20
|
+
viewState: {
|
|
21
|
+
mode: '',
|
|
22
|
+
submitButtonLabel: '',
|
|
23
|
+
disableStrategySelection: true,
|
|
24
|
+
},
|
|
25
|
+
expectedArtifactId: '',
|
|
26
|
+
interestingHealthProviderNames: [],
|
|
27
|
+
backingData: '',
|
|
28
|
+
fromArtifact: false,
|
|
29
|
+
sourceType: '',
|
|
30
|
+
configArtifacts: [],
|
|
31
|
+
application: 'dockerImageApp',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const transformed = transformer.convertServerGroupCommandToDeployConfiguration(command);
|
|
35
|
+
expect(transformed.cloudProvider).toBe('appengine');
|
|
36
|
+
expect(transformed.provider).toBe('appengine');
|
|
37
|
+
expect(transformed.application).toBe('dockerImageApp');
|
|
38
|
+
expect(transformed.expectedArtifact.name).toBe('gcr.io/hale-entry-305216/test');
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { module } from 'angular';
|
|
2
|
+
|
|
3
|
+
import type { Application, IJob, ITask, ITaskCommand } from '@spinnaker/core';
|
|
4
|
+
import { TaskExecutor } from '@spinnaker/core';
|
|
5
|
+
import type { IAppengineServerGroup } from '../../domain/index';
|
|
6
|
+
|
|
7
|
+
interface IAppengineServerGroupWriteJob extends IJob {
|
|
8
|
+
serverGroupName: string;
|
|
9
|
+
region: string;
|
|
10
|
+
credentials: string;
|
|
11
|
+
cloudProvider: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class AppengineServerGroupWriter {
|
|
15
|
+
public startServerGroup(serverGroup: IAppengineServerGroup, application: Application): PromiseLike<ITask> {
|
|
16
|
+
const job = this.buildJob(serverGroup, application, 'startAppEngineServerGroup');
|
|
17
|
+
|
|
18
|
+
const command: ITaskCommand = {
|
|
19
|
+
job: [job],
|
|
20
|
+
application,
|
|
21
|
+
description: `Start Server Group: ${serverGroup.name}`,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return TaskExecutor.executeTask(command);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public stopServerGroup(serverGroup: IAppengineServerGroup, application: Application): PromiseLike<ITask> {
|
|
28
|
+
const job = this.buildJob(serverGroup, application, 'stopAppEngineServerGroup');
|
|
29
|
+
|
|
30
|
+
const command: ITaskCommand = {
|
|
31
|
+
job: [job],
|
|
32
|
+
application,
|
|
33
|
+
description: `Stop Server Group: ${serverGroup.name}`,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return TaskExecutor.executeTask(command);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private buildJob(
|
|
40
|
+
serverGroup: IAppengineServerGroup,
|
|
41
|
+
application: Application,
|
|
42
|
+
type: string,
|
|
43
|
+
): IAppengineServerGroupWriteJob {
|
|
44
|
+
return {
|
|
45
|
+
type,
|
|
46
|
+
region: serverGroup.region,
|
|
47
|
+
serverGroupName: serverGroup.name,
|
|
48
|
+
credentials: serverGroup.account,
|
|
49
|
+
cloudProvider: 'appengine',
|
|
50
|
+
application: application.name,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const APPENGINE_SERVER_GROUP_WRITER = 'spinnaker.appengine.serverGroup.write.service';
|
|
56
|
+
|
|
57
|
+
module(APPENGINE_SERVER_GROUP_WRITER, []).service('appengineServerGroupWriter', AppengineServerGroupWriter);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { IApplicationNameValidator, IValidationResult } from '@spinnaker/core';
|
|
2
|
+
import { ApplicationNameValidator } from '@spinnaker/core';
|
|
3
|
+
|
|
4
|
+
// See https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version
|
|
5
|
+
class AppengineApplicationNameValidator implements IApplicationNameValidator {
|
|
6
|
+
public validate(name = ''): IValidationResult {
|
|
7
|
+
const warnings: string[] = [];
|
|
8
|
+
const errors: string[] = [];
|
|
9
|
+
if (name.length) {
|
|
10
|
+
this.validateSpecialCharacters(name, errors);
|
|
11
|
+
this.validateLength(name, warnings, errors);
|
|
12
|
+
}
|
|
13
|
+
return { warnings, errors };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
private validateSpecialCharacters(name: string, errors: string[]): void {
|
|
17
|
+
const pattern = /^[a-z0-9]*$/g;
|
|
18
|
+
if (!pattern.test(name)) {
|
|
19
|
+
errors.push('Only numbers and lowercase letters are allowed.');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
private validateLength(name: string, warnings: string[], errors: string[]): void {
|
|
24
|
+
if (name.length > 58) {
|
|
25
|
+
errors.push('The maximum length for an App Engine application name is 63 characters.');
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (name.length > 48) {
|
|
29
|
+
if (name.length >= 56) {
|
|
30
|
+
warnings.push('You will not be able to include a stack or detail field for clusters.');
|
|
31
|
+
} else {
|
|
32
|
+
const remaining = 56 - name.length;
|
|
33
|
+
warnings.push(`If you plan to include a stack or detail field for clusters, you will only have
|
|
34
|
+
${remaining} character${remaining > 1 ? 's' : ''} to do so.`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ApplicationNameValidator.registerValidator('appengine', new AppengineApplicationNameValidator());
|