speculate
Advanced tools
Comparing version 2.0.0-alpha.2 to 2.0.0-alpha.3
@@ -20,5 +20,6 @@ 'use strict'; | ||
environment: convertToKeyValueFromSpec(pkg.spec, 'environment'), | ||
serviceOptions: convertToKeyValueFromSpec(pkg.spec, 'serviceOptions') | ||
serviceOptions: convertToKeyValueFromSpec(pkg.spec, 'serviceOptions'), | ||
unitOptions: convertToKeyValueFromSpec(pkg.spec, 'unitOptions') | ||
} | ||
); | ||
}; |
{ | ||
"name": "speculate", | ||
"version": "2.0.0-alpha.2", | ||
"version": "2.0.0-alpha.3", | ||
"description": "Automatically generates an RPM Spec file for your Node.js project", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -292,2 +292,25 @@ # speculate | ||
#### Unit Options | ||
You can set specific [systemd unit options](https://www.freedesktop.org/software/systemd/man/systemd.unit.html) - in the `[Unit]` section of the .service file, you can specify these using the spec.unitOptions property: | ||
```json | ||
{ | ||
"spec": { | ||
"unitOptions": { | ||
"After": "my-cooler-api.service", | ||
"Before": "my-coolest-api.service", | ||
"Requires": "my-very-cool-api.service", | ||
} | ||
} | ||
} | ||
``` | ||
If you do not require any specific unit options Speculate will use default options: | ||
``` | ||
[Unit] | ||
Description=My Cool API | ||
After=network.target nss-lookup.target | ||
``` | ||
### Release Number | ||
@@ -294,0 +317,0 @@ |
@@ -39,2 +39,10 @@ 'use strict'; | ||
}); | ||
it('incudes unit options from the spec.unitOptions property in the package.json', () => { | ||
const pkg = require('./fixtures/my-cool-api-with-unit-options'); | ||
const expected = loadFixture('my-cool-api-with-unit-options.service'); | ||
const service = createServiceFile(pkg); | ||
assert.equal(service, expected); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
55849
56
922
332