Skip to content

techzilla/autorpmspec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autorpmspec

Generate an RPM Spec from a NodeJS package

Installation

npm install --save autorpmspec

Features

  • Generates an RPM Spec
  • Creates a systemd service

Usage

npm start script

The systemd service file uses the npm start script to start your application.

{
  "scripts": {
    "start": "node server.js"
  }
}

Directory Structure

The following directories are used for your application:

Directory Purpose
/var/lib/:projectName application
/var/log/:projectName logs
the spec property inside your existing package.json file.

Dependencies

list the package dependencies in the requires array:

{
  "spec": {
    "requires": [
      "vim",
      "screen"
    ]
  }
}
{
  "spec": {
    "buildRequires": [
      "python"
    ]
  }
}

Executables

List files and directories that need to be executable:

{
  "spec": {
    "executable": [
      "./other-scripts/my-script.js",
      "./scripts"
    ]
  }
}

Scriptlet

{
  "spec": {
    "pre": [
      "echo example"
    ],
    "post": [
      "echo example"
    ],
    "preun": [
      "echo example"
    ],
    "postun": [
      "echo example"
    ]
  }
}

Environment variable

specify environment variables during startup:

{
  "spec": {
    "environment": {
      "NODE_ENV": "production",
      "NODE_INSTANCE": "%i"
    }
  }
}

Release Number

--release flag:

autorpmspec --release=7

Custom Name

--name flag:

autorpmspec --name=my-cool-api

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published