Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
26490e8ddd | |||
38d2120c35 | |||
f80b8decbc | |||
28cd6d1b49 | |||
899e5b0a7d | |||
0eff7c7510 | |||
7789348f4e | |||
66a23a515b | |||
7c1082f5a9 | |||
15ea5adec6 | |||
da0dddcceb | |||
b5433e412f | |||
7eb6bf794c | |||
b244518fcb | |||
95d0396abb | |||
a830299cc9 | |||
10fc1d7fba | |||
614ed78928 |
@ -13,6 +13,7 @@ env:
|
|||||||
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
|
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
|
||||||
NPMCI_LOGIN_DOCKER_GITEA: ${{ github.server_url }}|${{ gitea.repository_owner }}|${{ secrets.GITEA_TOKEN }}
|
NPMCI_LOGIN_DOCKER_GITEA: ${{ github.server_url }}|${{ gitea.repository_owner }}|${{ secrets.GITEA_TOKEN }}
|
||||||
NPMCI_LOGIN_DOCKER_DOCKERREGISTRY: ${{ secrets.NPMCI_LOGIN_DOCKER_DOCKERREGISTRY }}
|
NPMCI_LOGIN_DOCKER_DOCKERREGISTRY: ${{ secrets.NPMCI_LOGIN_DOCKER_DOCKERREGISTRY }}
|
||||||
|
NPMCI_SECRET01: ${{ secrets.NPMCI_SECRET01 }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
security:
|
security:
|
||||||
|
54
changelog.md
54
changelog.md
@ -1,5 +1,59 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2024-11-06 - 4.3.8 - fix(api client)
|
||||||
|
Fixed localhost URL issue in test.client.ts
|
||||||
|
|
||||||
|
- Changed the cloudlyUrl in test.client.ts from 'localhost' to '127.0.0.1' to ensure consistency in network requests.
|
||||||
|
|
||||||
|
## 2024-11-06 - 4.3.7 - fix(tests)
|
||||||
|
Refactored test setup for consistency and isolated config initialization.
|
||||||
|
|
||||||
|
- test/helpers/cloudlyfactory.ts: Test configuration setup was refactored to ensure consistent initialization of cloudly configuration across tests.
|
||||||
|
- test/test.apiclient.ts: Updated cloudlyApiClient test setup to use testCloudlyConfig for dynamic port allocation.
|
||||||
|
|
||||||
|
## 2024-11-06 - 4.3.6 - fix(test)
|
||||||
|
Enhance test helpers with dynamic Hetzner token retrieval.
|
||||||
|
|
||||||
|
- Updated test/helpers/cloudlyfactory.ts to retrieve Hetzner token from environment variables.
|
||||||
|
- Expanded docker_tags workflow to securely handle and pass new environment secrets.
|
||||||
|
|
||||||
|
## 2024-11-06 - 4.3.5 - fix(helpers)
|
||||||
|
Add missing sslMode configuration to Cloudly config.
|
||||||
|
|
||||||
|
- Added the sslMode key with a value of 'none' to the Cloudly configuration object in test/helpers/cloudlyfactory.ts.
|
||||||
|
|
||||||
|
## 2024-11-06 - 4.3.4 - fix(testing)
|
||||||
|
Fixed Cloudly testing setup and dependencies
|
||||||
|
|
||||||
|
- Updated devDependency @push.rocks/tapbundle version from ^5.3.0 to ^5.4.3 in package.json.
|
||||||
|
- Updated devDependency @push.rocks/npmextra version from ^5.1.1 to ^5.1.2 in package.json.
|
||||||
|
- Improved the Cloudly test suite setup to ensure proper initialization of MongoDB and S3 services.
|
||||||
|
- Ensured asynchronous stopping and cleanup of MongoDB and S3 services post-test execution.
|
||||||
|
|
||||||
|
## 2024-11-05 - 4.3.3 - fix(core)
|
||||||
|
Fix configuration initialization by accepting a config argument
|
||||||
|
|
||||||
|
- Configuration initialization now accepts an optional config argument
|
||||||
|
- Updated test cloudly factory to use default public URL and port
|
||||||
|
- Updated dependencies versions
|
||||||
|
|
||||||
|
## 2024-11-05 - 4.3.2 - fix(npmextra)
|
||||||
|
Updated npm registry URL in npmextra.json
|
||||||
|
|
||||||
|
|
||||||
|
## 2024-11-05 - 4.3.1 - fix(package)
|
||||||
|
Update dependency version for @git.zone/tspublish
|
||||||
|
|
||||||
|
- Bump @git.zone/tspublish from version ^1.7.6 to ^1.7.7 in package.json
|
||||||
|
|
||||||
|
## 2024-11-05 - 4.3.0 - feat(dependencies)
|
||||||
|
Upgrade dependencies and include publish orders
|
||||||
|
|
||||||
|
- Upgraded @git.zone/tsbuild to version ^2.2.0
|
||||||
|
- Upgraded @git.zone/tspublish to version ^1.7.6
|
||||||
|
- Upgraded @types/node to version ^22.8.7
|
||||||
|
- Added publish order to ts_apiclient/tspublish.json and ts_interfaces/tspublish.json
|
||||||
|
|
||||||
## 2024-11-04 - 4.2.1 - fix(config)
|
## 2024-11-04 - 4.2.1 - fix(config)
|
||||||
Fix Docker image URL in Gitea workflow.
|
Fix Docker image URL in Gitea workflow.
|
||||||
|
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
"npmci": {
|
"npmci": {
|
||||||
"npmGlobalTools": [],
|
"npmGlobalTools": [],
|
||||||
"npmAccessLevel": "public",
|
"npmAccessLevel": "public",
|
||||||
"npmRegistryUrl": "verdaccio.lossless.one",
|
"npmRegistryUrl": "verdaccio.lossless.digital",
|
||||||
"dockerRegistryRepoMap": {
|
"dockerRegistryRepoMap": {
|
||||||
"registry.gitlab.com": "losslessone/services/servezone/cloudly"
|
"code.foss.global": "serve.zone/cloudly"
|
||||||
},
|
},
|
||||||
"dockerBuildargEnvMap": {
|
"dockerBuildargEnvMap": {
|
||||||
"NPMCI_TOKEN_NPM2": "NPMCI_TOKEN_NPM2"
|
"NPMCI_TOKEN_NPM2": "NPMCI_TOKEN_NPM2"
|
||||||
|
12
package.json
12
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@serve.zone/cloudly",
|
"name": "@serve.zone/cloudly",
|
||||||
"version": "4.2.1",
|
"version": "4.3.8",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.",
|
"description": "A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@ -22,14 +22,14 @@
|
|||||||
"docs": "tsdoc aidoc"
|
"docs": "tsdoc aidoc"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsbuild": "^2.1.85",
|
"@git.zone/tsbuild": "^2.2.0",
|
||||||
"@git.zone/tsbundle": "^2.1.0",
|
"@git.zone/tsbundle": "^2.1.0",
|
||||||
"@git.zone/tsdoc": "^1.4.2",
|
"@git.zone/tsdoc": "^1.4.2",
|
||||||
"@git.zone/tspublish": "^1.6.0",
|
"@git.zone/tspublish": "^1.7.7",
|
||||||
"@git.zone/tstest": "^1.0.90",
|
"@git.zone/tstest": "^1.0.90",
|
||||||
"@git.zone/tswatch": "^2.0.25",
|
"@git.zone/tswatch": "^2.0.25",
|
||||||
"@push.rocks/tapbundle": "^5.3.0",
|
"@push.rocks/tapbundle": "^5.4.3",
|
||||||
"@types/node": "^22.8.2"
|
"@types/node": "^22.9.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@api.global/typedrequest": "3.1.10",
|
"@api.global/typedrequest": "3.1.10",
|
||||||
@ -45,7 +45,7 @@
|
|||||||
"@design.estate/dees-element": "^2.0.39",
|
"@design.estate/dees-element": "^2.0.39",
|
||||||
"@git.zone/tsrun": "^1.3.3",
|
"@git.zone/tsrun": "^1.3.3",
|
||||||
"@push.rocks/early": "^4.0.3",
|
"@push.rocks/early": "^4.0.3",
|
||||||
"@push.rocks/npmextra": "^5.0.23",
|
"@push.rocks/npmextra": "^5.1.2",
|
||||||
"@push.rocks/projectinfo": "^5.0.1",
|
"@push.rocks/projectinfo": "^5.0.1",
|
||||||
"@push.rocks/qenv": "^6.0.5",
|
"@push.rocks/qenv": "^6.0.5",
|
||||||
"@push.rocks/smartacme": "^5.0.0",
|
"@push.rocks/smartacme": "^5.0.0",
|
||||||
|
1090
pnpm-lock.yaml
generated
1090
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -3,25 +3,46 @@ const testQenv = new Qenv('./', './.nogit/');
|
|||||||
|
|
||||||
import * as cloudly from '../../ts/index.js';
|
import * as cloudly from '../../ts/index.js';
|
||||||
|
|
||||||
|
const stopFunctions: Array<() => Promise<void>> = [];
|
||||||
|
|
||||||
|
const tapToolsNodeMod = await import('@push.rocks/tapbundle/node');
|
||||||
|
const smartmongo = await tapToolsNodeMod.tapNodeTools.createSmartmongo();
|
||||||
|
stopFunctions.push(async () => {
|
||||||
|
await smartmongo.stopAndDumpToDir('./.nogit/mongodump');
|
||||||
|
});
|
||||||
|
const smarts3 = await tapToolsNodeMod.tapNodeTools.createSmarts3();
|
||||||
|
await smarts3.createBucket('cloudly-test');
|
||||||
|
stopFunctions.push(async () => {
|
||||||
|
await smarts3.stop();
|
||||||
|
});
|
||||||
|
|
||||||
|
export const testCloudlyConfig: cloudly.ICloudlyConfig = {
|
||||||
|
cfToken: await testQenv.getEnvVarOnDemand('CF_TOKEN'),
|
||||||
|
environment: 'integration',
|
||||||
|
letsEncryptEmail: 'test@serve.zone',
|
||||||
|
publicUrl: '127.0.0.1',
|
||||||
|
publicPort: '8080',
|
||||||
|
mongoDescriptor: await smartmongo.getMongoDescriptor(),
|
||||||
|
s3Descriptor: await smarts3.getS3Descriptor(),
|
||||||
|
sslMode: 'none',
|
||||||
|
...(() => {
|
||||||
|
if (process.env.NPMCI_SECRET01) {
|
||||||
|
return {
|
||||||
|
hetznerToken: process.env.NPMCI_SECRET01,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
})(),
|
||||||
|
};
|
||||||
|
|
||||||
export const createCloudly = async () => {
|
export const createCloudly = async () => {
|
||||||
const cloudlyConfig: cloudly.ICloudlyConfig = {
|
const cloudlyInstance = new cloudly.Cloudly(testCloudlyConfig);
|
||||||
cfToken: await testQenv.getEnvVarOnDemand('CF_TOKEN'),
|
|
||||||
environment: 'integration',
|
|
||||||
letsEncryptEmail: await testQenv.getEnvVarOnDemand('LETSENCRYPT_EMAIL'),
|
|
||||||
publicUrl: await testQenv.getEnvVarOnDemand('SERVEZONE_URL'),
|
|
||||||
publicPort: await testQenv.getEnvVarOnDemand('SERVEZONE_PORT'),
|
|
||||||
mongoDescriptor: {
|
|
||||||
mongoDbName: await testQenv.getEnvVarOnDemand('MONGODB_DATABASE'),
|
|
||||||
mongoDbUser: await testQenv.getEnvVarOnDemand('MONGODB_USER'),
|
|
||||||
mongoDbPass: await testQenv.getEnvVarOnDemand('MONGODB_PASSWORD'),
|
|
||||||
mongoDbUrl: await testQenv.getEnvVarOnDemand('MONGODB_URL'),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
const cloudlyInstance = new cloudly.Cloudly();
|
|
||||||
return cloudlyInstance;
|
return cloudlyInstance;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
export const stopCloudly = async () => {
|
||||||
|
await Promise.all(stopFunctions.map((stopFunction) => stopFunction()));
|
||||||
|
};
|
||||||
|
|
||||||
export const getEnvVarOnDemand = async (envVarName: string) => {
|
export const getEnvVarOnDemand = async (envVarName: string) => {
|
||||||
return testQenv.getEnvVarOnDemand(envVarName);
|
return testQenv.getEnvVarOnDemand(envVarName);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ tap.preTask('should create a new machine user for testing', async () => {
|
|||||||
tap.test('should create a new cloudlyApiClient', async () => {
|
tap.test('should create a new cloudlyApiClient', async () => {
|
||||||
testClient = new cloudlyApiClient.CloudlyApiClient({
|
testClient = new cloudlyApiClient.CloudlyApiClient({
|
||||||
registerAs: 'api',
|
registerAs: 'api',
|
||||||
cloudlyUrl: `http://localhost:${await helpers.getEnvVarOnDemand('SERVEZONE_PORT')}`,
|
cloudlyUrl: `http://127.0.0.1:${helpers.testCloudlyConfig.publicPort}`,
|
||||||
});
|
});
|
||||||
await testClient.start();
|
await testClient.start();
|
||||||
expect(testClient).toBeTruthy();
|
expect(testClient).toBeTruthy();
|
||||||
@ -73,6 +73,7 @@ tap.test('should upload an image version', async () => {
|
|||||||
|
|
||||||
tap.test('should stop the apiclient', async (toolsArg) => {
|
tap.test('should stop the apiclient', async (toolsArg) => {
|
||||||
await toolsArg.delayFor(10000);
|
await toolsArg.delayFor(10000);
|
||||||
|
await helpers.stopCloudly();
|
||||||
await testClient.stop();
|
await testClient.stop();
|
||||||
await testCloudly.stop();
|
await testCloudly.stop();
|
||||||
})
|
})
|
||||||
|
@ -14,8 +14,10 @@ tap.test('should init cloudly', async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should end the service', async (tools) => {
|
tap.test('should end the service', async (tools) => {
|
||||||
|
await tools.delayFor(5000);
|
||||||
|
await helpers.stopCloudly();
|
||||||
await testCloudly.stop();
|
await testCloudly.stop();
|
||||||
tools.delayFor(1000).then(() => process.exit())
|
tools.delayFor(1000).then(() => process.exit());
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@serve.zone/cloudly',
|
name: '@serve.zone/cloudly',
|
||||||
version: '4.2.1',
|
version: '4.3.8',
|
||||||
description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.'
|
description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.'
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,9 @@ export class Cloudly {
|
|||||||
|
|
||||||
private readyDeferred = new plugins.smartpromise.Deferred();
|
private readyDeferred = new plugins.smartpromise.Deferred();
|
||||||
|
|
||||||
constructor() {
|
private configOptions: plugins.servezoneInterfaces.data.ICloudlyConfig;
|
||||||
|
constructor(configArg?: plugins.servezoneInterfaces.data.ICloudlyConfig) {
|
||||||
|
this.configOptions = configArg;
|
||||||
this.cloudlyInfo = new CloudlyInfo(this);
|
this.cloudlyInfo = new CloudlyInfo(this);
|
||||||
this.config = new CloudlyConfig(this);
|
this.config = new CloudlyConfig(this);
|
||||||
|
|
||||||
@ -90,7 +92,7 @@ export class Cloudly {
|
|||||||
*/
|
*/
|
||||||
public async start() {
|
public async start() {
|
||||||
// config
|
// config
|
||||||
await this.config.init();
|
await this.config.init(this.configOptions);
|
||||||
|
|
||||||
// manageers
|
// manageers
|
||||||
await this.authManager.start();
|
await this.authManager.start();
|
||||||
|
@ -15,7 +15,7 @@ export class CloudlyConfig {
|
|||||||
this.cloudlyRef = cloudlyRefArg;
|
this.cloudlyRef = cloudlyRefArg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async init() {
|
public async init(configArg?: plugins.servezoneInterfaces.data.ICloudlyConfig) {
|
||||||
this.appData =
|
this.appData =
|
||||||
await plugins.npmextra.AppData.createAndInit<plugins.servezoneInterfaces.data.ICloudlyConfig>(
|
await plugins.npmextra.AppData.createAndInit<plugins.servezoneInterfaces.data.ICloudlyConfig>(
|
||||||
{
|
{
|
||||||
@ -54,6 +54,7 @@ export class CloudlyConfig {
|
|||||||
'environment',
|
'environment',
|
||||||
'mongoDescriptor',
|
'mongoDescriptor',
|
||||||
],
|
],
|
||||||
|
overwriteObject: configArg,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"order": 1,
|
||||||
"name": "@serve.zone/api",
|
"name": "@serve.zone/api",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"@serve.zone/interfaces",
|
"@serve.zone/interfaces",
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"order": 0,
|
||||||
"name": "@serve.zone/interfaces",
|
"name": "@serve.zone/interfaces",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"@api.global/typedrequest-interfaces",
|
"@api.global/typedrequest-interfaces",
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@serve.zone/cloudly',
|
name: '@serve.zone/cloudly',
|
||||||
version: '4.2.1',
|
version: '4.3.8',
|
||||||
description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.'
|
description: 'A comprehensive tool for managing containerized applications across multiple cloud providers using Docker Swarmkit, featuring web, CLI, and API interfaces.'
|
||||||
}
|
}
|
||||||
|
@ -10,13 +10,13 @@
|
|||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@serve.zone/api": [
|
"@serve.zone/api": [
|
||||||
"./ts_apiclient/index.ts"
|
"./ts_apiclient/index.js"
|
||||||
],
|
],
|
||||||
"@serve.zone/cli": [
|
"@serve.zone/cli": [
|
||||||
"./ts_cliclient/index.ts"
|
"./ts_cliclient/index.js"
|
||||||
],
|
],
|
||||||
"@serve.zone/interfaces": [
|
"@serve.zone/interfaces": [
|
||||||
"./ts_interfaces/index.ts"
|
"./ts_interfaces/index.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user