fix(ci): Fix Docker images and npm registry URL in CI workflows
This commit is contained in:
16
ts_interfaces/data/cloudlyconfig.ts
Normal file
16
ts_interfaces/data/cloudlyconfig.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
|
||||
export interface ICloudlyConfig {
|
||||
cfToken?: string;
|
||||
hetznerToken?: string;
|
||||
environment?: 'production' | 'integration';
|
||||
letsEncryptEmail?: string;
|
||||
letsEncryptPrivateKey?: string;
|
||||
jwtKeypair?: plugins.tsclass.network.IJwtKeypair;
|
||||
mongoDescriptor?: plugins.tsclass.database.IMongoDescriptor;
|
||||
s3Descriptor?: plugins.tsclass.storage.IS3Descriptor;
|
||||
publicUrl?: string;
|
||||
publicPort?: string;
|
||||
sslMode?: 'none' | 'letsencrypt' | 'external';
|
||||
servezoneAdminaccount?: string;
|
||||
}
|
36
ts_interfaces/data/cluster.ts
Normal file
36
ts_interfaces/data/cluster.ts
Normal file
@ -0,0 +1,36 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
|
||||
import { type IDockerRegistryInfo } from '../data/docker.js';
|
||||
import type { IServer } from './server.js';
|
||||
|
||||
export interface ICluster {
|
||||
id: string;
|
||||
data: {
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* a cluster has a machine user that governs access rights.
|
||||
*/
|
||||
userId: string;
|
||||
|
||||
/**
|
||||
* how can the cluster reach cloudly
|
||||
*/
|
||||
cloudlyUrl?: string;
|
||||
|
||||
/**
|
||||
* what servers are expected to be part of the cluster
|
||||
*/
|
||||
servers: IServer[];
|
||||
|
||||
/**
|
||||
* ACME info. This is used to get SSL certificates.
|
||||
*/
|
||||
acmeInfo: {
|
||||
serverAddress: string;
|
||||
serverSecret: string;
|
||||
};
|
||||
|
||||
sshKeys: plugins.tsclass.network.ISshKey[];
|
||||
};
|
||||
}
|
1
ts_interfaces/data/config.ts
Normal file
1
ts_interfaces/data/config.ts
Normal file
@ -0,0 +1 @@
|
||||
export type TConfigType = 'server' | 'cluster' | 'coreflow' | 'service';
|
14
ts_interfaces/data/deployment.ts
Normal file
14
ts_interfaces/data/deployment.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
|
||||
/**
|
||||
* results from a DeploymentDirective
|
||||
* tracks the status of a deployment
|
||||
*/
|
||||
export interface IDeployment {
|
||||
id: string;
|
||||
deploymentDirectiveId: string;
|
||||
affectedServiceIds: string[];
|
||||
usedImageId: string;
|
||||
deploymentLog: string[];
|
||||
status: 'scheduled' | 'running' | 'deployed' | 'failed';
|
||||
}
|
14
ts_interfaces/data/deploymentdirective.ts
Normal file
14
ts_interfaces/data/deploymentdirective.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import type { IServiceRessources } from "./docker.js";
|
||||
|
||||
/**
|
||||
* used for tellilng a cluster about a disired deployment
|
||||
* and specifies its configuration
|
||||
*/
|
||||
export interface IDeploymentDirective {
|
||||
id: string;
|
||||
name: string;
|
||||
imageClaim: string;
|
||||
ports: { hostPort: number; containerPort: number }[];
|
||||
environment: { [key: string]: string };
|
||||
resources?: IServiceRessources;
|
||||
}
|
15
ts_interfaces/data/docker.ts
Normal file
15
ts_interfaces/data/docker.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
|
||||
export interface IDockerRegistryInfo {
|
||||
serveraddress: string;
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface IServiceRessources {
|
||||
cpuLimit?: number;
|
||||
cpuReservation?: number;
|
||||
memorySizeLimitMB?: number;
|
||||
memorySizeReservationMB?: number;
|
||||
volumeMounts?: plugins.tsclass.container.IVolumeMount[];
|
||||
}
|
6
ts_interfaces/data/env.ts
Normal file
6
ts_interfaces/data/env.ts
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
export interface IEnvBundle {
|
||||
environment: string;
|
||||
timeSensitive: boolean;
|
||||
configKeyValueObject: {[key: string]: string};
|
||||
}
|
11
ts_interfaces/data/event.ts
Normal file
11
ts_interfaces/data/event.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
|
||||
export interface IEvent_Cloudly_ContainerVersionNotification
|
||||
extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedEvent<plugins.tsclass.container.IContainer>,
|
||||
IEvent_Cloudly_ContainerVersionNotification
|
||||
> {
|
||||
name: 'newContainerVersion';
|
||||
uniqueEventId: string;
|
||||
payload: plugins.tsclass.container.IContainer;
|
||||
}
|
15
ts_interfaces/data/image.ts
Normal file
15
ts_interfaces/data/image.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
|
||||
export interface IImage {
|
||||
id: string;
|
||||
data: {
|
||||
name: string;
|
||||
description: string;
|
||||
versions: Array<{
|
||||
versionString: string;
|
||||
storagePath?: string;
|
||||
size: number;
|
||||
createdAt: number;
|
||||
}>;
|
||||
};
|
||||
}
|
17
ts_interfaces/data/index.ts
Normal file
17
ts_interfaces/data/index.ts
Normal file
@ -0,0 +1,17 @@
|
||||
export * from './cloudlyconfig.js';
|
||||
export * from './cluster.js';
|
||||
export * from './config.js';
|
||||
export * from './deployment.js';
|
||||
export * from './deploymentdirective.js';
|
||||
export * from './docker.js';
|
||||
export * from './env.js';
|
||||
export * from './event.js';
|
||||
export * from './image.js';
|
||||
export * from './secretbundle.js';
|
||||
export * from './secretgroup.js'
|
||||
export * from './server.js';
|
||||
export * from './service.js';
|
||||
export * from './status.js';
|
||||
export * from './traffic.js';
|
||||
export * from './user.js';
|
||||
export * from './version.js';
|
42
ts_interfaces/data/secretbundle.ts
Normal file
42
ts_interfaces/data/secretbundle.ts
Normal file
@ -0,0 +1,42 @@
|
||||
export interface ISecretBundle {
|
||||
id: string;
|
||||
data: {
|
||||
name: string;
|
||||
description: string;
|
||||
|
||||
/**
|
||||
* determines if the secret is a service or an external secret
|
||||
* if external secret additional checks are put in place to protect the secret
|
||||
*/
|
||||
type: 'service' | 'npmci' | 'gitzone' | 'external';
|
||||
|
||||
/**
|
||||
* You can add specific secret groups using this
|
||||
*/
|
||||
includedSecretGroupIds: string[];
|
||||
|
||||
/**
|
||||
* You can add specific tags using this
|
||||
*/
|
||||
includedTags: {
|
||||
key: string;
|
||||
value?: string;
|
||||
}[];
|
||||
|
||||
/**
|
||||
* add images
|
||||
*/
|
||||
includedImages: {
|
||||
imageId: string;
|
||||
permissions: ('read' | 'write')[];
|
||||
}[];
|
||||
|
||||
/**
|
||||
* authrozations select a specific environment of a config bundle
|
||||
*/
|
||||
authorizations: Array<{
|
||||
secretAccessKey: string;
|
||||
environment: string;
|
||||
}>;
|
||||
};
|
||||
}
|
54
ts_interfaces/data/secretgroup.ts
Normal file
54
ts_interfaces/data/secretgroup.ts
Normal file
@ -0,0 +1,54 @@
|
||||
export interface ISecretGroup {
|
||||
/**
|
||||
* the insatnce id. This should be a random id, except for default
|
||||
*/
|
||||
id: string;
|
||||
|
||||
data: {
|
||||
name: string;
|
||||
description: string;
|
||||
|
||||
/**
|
||||
* the key of the secretgroup like CI_RUNNER_TOKEN
|
||||
*/
|
||||
key: string;
|
||||
|
||||
/**
|
||||
* the priority of the secretgroup
|
||||
* will be used to determine which secretgroup will be used
|
||||
* when there are multiple secretgroups with the same key
|
||||
*/
|
||||
priority?: number;
|
||||
|
||||
/**
|
||||
* any tags that can be used to filter the secretgroup
|
||||
* can be used for putting secrets into projects
|
||||
*/
|
||||
tags: {
|
||||
key: string;
|
||||
value: string;
|
||||
}[];
|
||||
/**
|
||||
* the values for this secretGroup
|
||||
*/
|
||||
environments: {
|
||||
[key: string]: {
|
||||
value: string;
|
||||
|
||||
/**
|
||||
* can be used to update the value
|
||||
*/
|
||||
updateToken?: string;
|
||||
|
||||
/**
|
||||
* the linux timestamp of the last update
|
||||
*/
|
||||
lastUpdated: number;
|
||||
history: {
|
||||
timestamp: string;
|
||||
value: string;
|
||||
}[];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
36
ts_interfaces/data/server.ts
Normal file
36
ts_interfaces/data/server.ts
Normal file
@ -0,0 +1,36 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
|
||||
import { type IDockerRegistryInfo } from './docker.js';
|
||||
|
||||
export interface IServerMetrics {
|
||||
serverId: string;
|
||||
cpuUsageInPercent: number;
|
||||
memoryUsageinMB: number;
|
||||
memoryAvailableInMB: number;
|
||||
containerCount: number;
|
||||
containerMetrics: Array<{
|
||||
containerId: string;
|
||||
containerName: string;
|
||||
cpuUsageInPercent: number;
|
||||
memoryUsageInMB: number;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface IServer {
|
||||
id: string;
|
||||
data: {
|
||||
type: 'baremetal' | 'hetzner';
|
||||
|
||||
assignedClusterId: string;
|
||||
|
||||
/**
|
||||
* a list of debian packages to be installed
|
||||
*/
|
||||
requiredDebianPackages: string[];
|
||||
|
||||
/**
|
||||
* a list of SSH keys to deploy
|
||||
*/
|
||||
sshKeys: plugins.tsclass.network.ISshKey[];
|
||||
};
|
||||
}
|
26
ts_interfaces/data/service.ts
Normal file
26
ts_interfaces/data/service.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import type { IServiceRessources } from './docker.js';
|
||||
|
||||
export interface IService {
|
||||
id: string;
|
||||
data: {
|
||||
name: string;
|
||||
imageId: string;
|
||||
imageVersion: string;
|
||||
environment: { [key: string]: string };
|
||||
secretBundleId: string;
|
||||
scaleFactor: number;
|
||||
balancingStrategy: 'round-robin' | 'least-connections';
|
||||
ports: {
|
||||
web: number;
|
||||
custom?: { [domain: string]: string };
|
||||
};
|
||||
resources?: IServiceRessources;
|
||||
domains: {
|
||||
name: string;
|
||||
port?: number;
|
||||
protocol?: 'http' | 'https' | 'ssh';
|
||||
}[];
|
||||
deploymentIds: string[];
|
||||
deploymentDirectiveIds: string[];
|
||||
};
|
||||
}
|
20
ts_interfaces/data/status.ts
Normal file
20
ts_interfaces/data/status.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
|
||||
export interface IClusterStatus {
|
||||
name: string;
|
||||
ip: string;
|
||||
nodesCount: number;
|
||||
containersUnderManagementCount: number;
|
||||
nodeStatusId: string;
|
||||
containerStatusArray: IContainerStatus[];
|
||||
}
|
||||
|
||||
export interface INodeStatus {
|
||||
nodeId: string;
|
||||
}
|
||||
|
||||
export interface IContainerStatus {
|
||||
serviceName: string;
|
||||
dockerImageUrl: string;
|
||||
dockerImageVersion: string;
|
||||
}
|
5
ts_interfaces/data/traffic.ts
Normal file
5
ts_interfaces/data/traffic.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
|
||||
interface IReverseProxyConfig extends plugins.tsclass.network.IReverseProxyConfig {}
|
||||
|
||||
export { type IReverseProxyConfig };
|
30
ts_interfaces/data/user.ts
Normal file
30
ts_interfaces/data/user.ts
Normal file
@ -0,0 +1,30 @@
|
||||
export interface IToken {
|
||||
token: string;
|
||||
expiresAt: number;
|
||||
assignedRoles: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* an identity is assumed by authentication as a user
|
||||
* an identity is ephemeral and has to be renewed regularly
|
||||
*/
|
||||
export interface IIdentity {
|
||||
name: string;
|
||||
userId: string;
|
||||
type: 'machine' | 'human';
|
||||
role: 'admin' | 'user' | 'api' | 'cluster';
|
||||
expiresAt: number;
|
||||
/** the jwt token should contain above data for verification */
|
||||
jwt: string;
|
||||
}
|
||||
|
||||
export interface IUser {
|
||||
id: string;
|
||||
data: {
|
||||
type: 'machine' | 'human';
|
||||
role: 'admin' | 'user' | 'api' | 'cluster';
|
||||
username?: string;
|
||||
password?: string;
|
||||
tokens?: IToken[];
|
||||
}
|
||||
}
|
11
ts_interfaces/data/version.ts
Normal file
11
ts_interfaces/data/version.ts
Normal file
@ -0,0 +1,11 @@
|
||||
export interface IContainerVersionData {
|
||||
/**
|
||||
* the docker image url
|
||||
* example: registry.gitlab.com/hosttoday/ht-docker-node:latest
|
||||
*/
|
||||
dockerImageUrl: string;
|
||||
/**
|
||||
* the docker image version. Note: This is different from docker tags that are often used for versions.
|
||||
*/
|
||||
dockerImageVersion: string;
|
||||
}
|
Reference in New Issue
Block a user