pmcf 2.42.0 → 2.43.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "2.42.0",
3
+ "version": "2.43.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/host.mjs CHANGED
@@ -119,6 +119,8 @@ export class Host extends ServiceOwner {
119
119
  }
120
120
  });
121
121
  }
122
+
123
+ this.extra = data.extra;
122
124
  }
123
125
 
124
126
  _applyExtends(host) {
@@ -451,7 +453,7 @@ export class Host extends ServiceOwner {
451
453
  }
452
454
 
453
455
  async *preparePackages(dir) {
454
- const packageData = {
456
+ let packageData = {
455
457
  dir,
456
458
  sources: [
457
459
  new FileContentProvider(
@@ -462,8 +464,7 @@ export class Host extends ServiceOwner {
462
464
  { base: this.directory, pattern: "*_key" },
463
465
  { destination: "/etc/ssh/", mode: 0o600 }
464
466
  ),
465
- new FileContentProvider(dir + "/"),
466
- new FileContentProvider(join(this.directory, "extra") + "/")
467
+ new FileContentProvider(dir + "/")
467
468
  ],
468
469
  outputs: this.outputs,
469
470
  properties: {
@@ -493,8 +494,10 @@ export class Host extends ServiceOwner {
493
494
  await generateKnownHosts(this.owner.hosts(), join(dir, "root", ".ssh"));
494
495
 
495
496
  for (const service of this.services) {
496
- if (service.systemdConfig) {
497
- const { serviceName, configFileName, content } = service.systemdConfig(this.name);
497
+ if (service.systemdConfig) {
498
+ const { serviceName, configFileName, content } = service.systemdConfig(
499
+ this.name
500
+ );
498
501
  await writeLines(dir, configFileName, sectionLines(...content));
499
502
 
500
503
  addHook(
@@ -506,5 +509,21 @@ export class Host extends ServiceOwner {
506
509
  }
507
510
 
508
511
  yield packageData;
512
+
513
+ if (this.extra) {
514
+ packageData = {
515
+ dir,
516
+ sources: [new FileContentProvider(join(this.directory, "extra") + "/")],
517
+ outputs: this.outputs,
518
+ properties: {
519
+ name: `${this.typeName}-extra-${this.owner.name}-${this.name}`,
520
+ description: `additional files for ${this.fullName}`,
521
+ access: "private",
522
+ dependencies: [`${this.typeName}-${this.owner.name}-${this.name}`]
523
+ }
524
+ };
525
+
526
+ yield packageData;
527
+ }
509
528
  }
510
529
  }
package/types/host.d.mts CHANGED
@@ -185,6 +185,7 @@ export class Host extends ServiceOwner {
185
185
  _vendor: any;
186
186
  _architecture: any;
187
187
  _serial: any;
188
+ extra: any;
188
189
  _applyExtends(host: any): void;
189
190
  set serial(value: any);
190
191
  get serial(): any;