npmci/ts/connector.cloudly/cloudlyconnector.ts

31 lines
889 B
TypeScript
Raw Normal View History

2019-08-29 18:26:23 +00:00
import * as plugins from '../npmci.plugins';
2019-08-29 18:56:02 +00:00
import {Npmci} from '../npmci.classes.npmci';
import { logger } from '../npmci.logging';
2019-08-29 18:26:23 +00:00
/**
2019-08-29 18:56:02 +00:00
* connects to cloudly
2019-08-29 18:26:23 +00:00
*/
export class CloudlyConnector {
2019-08-29 18:56:02 +00:00
public npmciRef: Npmci;
constructor(npmciRefArg: Npmci) {
this.npmciRef = npmciRefArg;
}
public async announceDockerContainer(optionsArg: plugins.servezoneInterfaces.IVersionData) {
const cloudlyUrl = this.npmciRef.npmciConfig.getConfig().urlCloudly;
if (!cloudlyUrl) {
logger.log('warn', 'no cloudly url provided. Thus we cannot announce the newly built Dockerimage!');
return;
}
const typedrequest = new plugins.typedrequest.TypedRequest<
plugins.servezoneInterfaces.IRequest_Any_Cloudly_VersionManager_Update
>(`https://${cloudlyUrl}/versionmanager`, 'update');
const response = (await typedrequest.fire(optionsArg));
}
2019-08-29 18:38:44 +00:00
}