Create ArchLinux, RPM, Debian and Docker packages from npm packages.
In a package directory execute
npm-pkgbuild --rpm --debian --arch --content /destination:build --publish /some/directory
This will create a arch, rpm and a debian package of the build dir.
npm-pkgbuild --arch --content build --publish 'https://my.package-service.com/binaries/linux/{{type}}/{{access}}/{{arch}}'
You can specify the package content in package.json.
{
"pkgbuild": {
"content": {
"/some/location/" : { "base": "build" },
"/etc/myconfig.json" : "sample-config.json",
"/erc/secret" : { "name": "secret", "mode": "600" },
"/opt/myapp": [
{
"type": "npm-pack"
},
{
"type": "node-modules",
"withoutDevelpmentDependencies": true
}
]
},
"hooks" : "pkg/hooks",
"output": {
"debian" : {},
"rpm" : {},
"arch" : {}
},
"dependencies": { "nginx" : ">=1.12" }
}
}
Defining where the package content should come from.
content from the file system
content as provided by npm pack
content of all (production) dependencies
options: - withoutDevelpmentDependencies when to stip away dev dependencies (defaults to true)
You can import common configuration from other packages. See mf-hosting or mf-hosting-frontend modules.
- ContentProvider
- FileContentProvider
- NFTContentProvider
- utf8StreamOptions
- decodePassword
- FunctionDecl
- extractFunctions
- fieldProvider
- Expander
- copyEntries
- NodeModulesContentProvider
- NPMPackContentProvider
- pkgKeyValuePairOptions
- fields
- fields
- fields
- fields
- BUILDAH
- hookMapping
- hookMapping
- DEBIAN
- DOCKER
- OCI
- Packager
- Packager
- Field
- PublishingDetail
- createPublishingDetails
- publish
- quoteFile
- RPM
Source of package content.
definitions
entryProperties
List all entries.
Returns AsyncIterable<ContentEntry> all entries
Extends ContentProvider
Content provided form the file system.
-
entryProperties
Returns string name of the content provider
Extends ContentProvider
Content provided form the file system.
-
entryProperties
Returns string name of the content provider
Type: Object
encoding
BufferEncoding
Decode a password
password
string
Returns string plaintext password
Type: Object
Extract shell functions from a given text.
source
AsyncIterable<string>
Returns AsyncIterable<FunctionDecl>
Returns Function
Type: Function
path
string
Returns string
Copy content from source into destinationDirectory. Destination paths a generated without leading '/' (as for entry names too).
source
AsyncIterable<ContentEntry>destinationDirectory
stringexpander
Expander (optional, defaultv=>v
)
Extends ContentProvider
Content from node_modules. Requires .npmrc or NPM_TOKEN environment
definitions
entryProperties
Returns string name of the content provider
Extends ContentProvider
Content from npm pack.
dir
string
Returns string name of the content provider
Type: Object
well known package properties https://www.archlinux.org/pacman/PKGBUILD.5.html
- See: https://www.debian.org/doc/debian-policy/ch-controlfields.html
- See: https://linux.die.net/man/5/deb-control
Extends DOCKER
Use buildah @see https://buildah.io
map install hook named from arch to deb
map install hook named from arch to rpm
Extends Packager
Create .deb packages
Extends Packager
docker image build
Check for docker presence.
Returns Promise<boolean> true when docker executable is present
Extends Packager
Low level OCI compatible packager
properties
What is the package name in the package eco-system.
name
string
Returns string package name in the target eco-system
Create tmp directory.
Returns Promise<string> directory path
Prepares artifact generation
Returns Promise<{properties: Object, destination: string, tmpdir: string, staging: string}>
Execute package generation.
sources
Objecttransformer
Array<Object>dependencies
ObjectpublishingDetails
Array<PublishingDetail>options
Objectexpander
function (string): string
Returns Promise<string> identifier of the resulting package
Returns {named: object, others: []}
Base Packager
properties
Object
What is the package name in the package eco-system.
name
string
Returns string package name in the target eco-system
Create tmp directory.
Returns Promise<string> directory path
Prepares artifact generation
Returns Promise<{properties: Object, destination: string, tmpdir: string, staging: string}>
Execute package generation.
sources
Objecttransformer
Array<Object>dependencies
ObjectpublishingDetails
Array<PublishingDetail>options
Objectexpander
function (string): string
Returns Promise<string> identifier of the resulting package
Returns {named: object, others: []}
Type: Object
Type: Object
-
properties
Object?
Returns Array<PublishingDetail>
artifactIdentifier
stringpublishingDetail
PublishingDetail?properties
Object?logger
function (any): void (optional, defaultconsole.log
)
name
Extends Packager
produce rpm packages
Check for rpmbuild presence.
Returns Promise<boolean> true when rpmbuild executable is present
With npm do:
npm install npm-pkgbuild
BSD-2-Clause