citadel.nodes.npmrc module

class citadel.nodes.npmrc.Npmrc(yml, path)[source]
Synopsis:

Generate an .npmrc file in the current directory.

Requirements:

None

Platform:

Any

Parameters:
  • always_auth (optional) – Whether always-auth should be on/off.
  • strict_ssl (optional) – Whether strict-ssl should be on/off.
  • auth (optional) – The authentication token (often used when publishing).

Usage

1
2
3
4
5
6
7
build:
  npmrc:
    registry: http://artifactory.company.com/api/npm/npm-repo
    email: owner@company.com
    always_auth: false
    strict_ssl: false
    auth: d12a243482adasjnad

Warning

Avoid authentication tokens in plain text. CITADel does a best effort to remove them from the logs (anything containing the password string), but it’s a very imperfect method.

Generates an .npmrc file with the specified options. Any unknown options will be passed directly onto the .npmrc file.

The NPM (Node Package Manager) is often used to run builds for JavaScript and/or run the installation of packages. It’s up to the NPM command to know how to interpret these options, the module will simply generate the file.

If the default directory ($PWD) is an awkward location, use the script directive to change the directory before invoking the npmrc module.

Example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
build:
  script:
    - cd some/directory
  npmrc:
    registry: http://artifactory.company.com/api/npm/npm-repo
    email: owner@company.com
    always_auth: false
    strict_ssl: false
    auth: d12a243482adasjnad
  npm: start run
generate_npmrc(always_auth, strict_ssl)[source]

Generate an .npmrc file.