Skip to content

Commit

Permalink
now as jsii pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Jun 17, 2024
1 parent e58cff0 commit cff795c
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const project = new cdk.JsiiProject({
projenrcTs: true,
repositoryUrl: '[email protected]:bluedynamics/cdk8s-plone.git',

// deps: [], /* Runtime dependencies of this module. */
deps: [
"cdk8s",
],
// description: undefined, /* The description is just a string that helps people understand the purpose of the package. */
// devDeps: [], /* Build dependencies for this module. */
// packageName: undefined, /* The "name" in package.json. */
Expand Down
39 changes: 39 additions & 0 deletions API.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions src/backend-deployment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { Construct } from 'constructs';

export interface PloneBackendDeploymentOptions {
/**
* Specify a custom image for Plone Backend.
* @default "plone/plone-backend:latest"
*/
readonly image?: string;

/**
* Number of replicas.
* @default 2
*/
readonly replicas?: number;

/**
* Port number.
* @default 8080
*/
readonly port?: number;

/**
* Extra labels to associate with resources.
* @default - none
*/
readonly labels?: { [name: string]: string };
}

export class PloneBackendDeployment extends Construct {

constructor(scope: Construct, id: string, options: PloneBackendDeploymentOptions = { }) {
super(scope, id);
const baseImage = options.image ?? 'plone/plone-backend:latest';
const replicas = options.replicas ?? 2;
const port = options.port ?? 8080;
const labels = options.labels ?? {};
}
}
24 changes: 24 additions & 0 deletions src/backend-service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Construct } from 'constructs';

export interface PloneBackendServiceOptions {
/**
* Port number.
* @default 8080
*/
readonly port?: number;

/**
* Extra labels to associate with resources.
* @default - none
*/
readonly labels?: { [name: string]: string };
}

export class PloneBackendService extends Construct {

constructor(scope: Construct, id: string, options: PloneBackendServiceOptions = {}) {
super(scope, id);
const port = options.port ?? 8080;
const labels = options.labels ?? {};
}
}
23 changes: 23 additions & 0 deletions src/backend.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Construct } from 'constructs';
import { PloneBackendDeploymentOptions, PloneBackendDeployment } from './backend-deployment';
import { PloneBackendServiceOptions, PloneBackendService } from './backend-service';

export interface PloneBackendOptions {
deployment?: PloneBackendDeploymentOptions;
service?: PloneBackendServiceOptions;
}

export class PloneBackend extends Construct {

constructor(scope: Construct, id: string, options: PloneBackendOptions = {}) {
super(scope, id);
const deployment = options.deployment ?? {};
const service = options.service ?? {};

// Create a deployment
new PloneBackendDeployment(this, 'deployment', deployment);

// Create a service
new PloneBackendService(this, 'service', service);
}
}
8 changes: 3 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export class Hello {
public sayHello() {
return 'hello, world!';
}
}
export * from './backend-deployment';
export * from './backend-service';
export * from './backend';
16 changes: 15 additions & 1 deletion yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cff795c

Please sign in to comment.