2.0.2 • Published 5 years ago

node-riffraff-artefact v2.0.2

Weekly downloads
224
License
ISC
Repository
github
Last release
5 years ago

Node RiffRaff Artefact

Plugin for building deployable RiffRaff artefacts in Node. Supports RiffRaff deployment types:

  • cloud-formation
  • aws-lambda
  • autoscaling

Getting Started

This is a node plugin for creating RiffRaff artefacts that can then be deployed by RiffRaff. It builds the same package structure as the SBT equivalent.

To use it, ensure you have a package.json located in the root directory of your project. There must be at the very minimum the name field.

In your project root directory, type:

npm install node-riffraff-artefact --save

Options - these sit at the root level of your package.json

  • isAwsLambda: true or false (optional - defaults to false)
  • cloudformation: false or the location of your cloudformation (optional - defaults to cloudformation.json)
  • projectName: a string with the name you want to appear in RiffRaff dropdown (e.g. team::project - defaults to name in package.json)
  • cloudformationAppTag: a string with the value of the App tag for the cloudformation stack and the name of the cloudformation deployment in riff-raff.yaml (e.g. name-cloudformation - defaults to name in package.json with -cloudformation appended)
  • riffraffFile: path to a RiffRaff riff-raff.yaml for your app. Defaults to ./riff-raff.yaml.
  • uploadArtefact: true or false (optional - defaults to true). Determines if the artefact should be uploaded to S3.

Some example riff-raff.yaml:

AWS Lambda deploy with Cloudformation

...
deployments:
  name-from-package-json:
    type: aws-lambda
    parameters:
      ...
      functionNames:
      - name-from-package-json-
  cloudformationAppTag-from-package-json:
    type: cloud-formation
    parameters:
      templatePath: 'cloudformation/cloudformation.yaml'

Some example package.json:

Autoscaling deploy with Cloudformation

{
  "name": "s3watcher",
  "...": "...",
  "cloudformation": "my_cloudformation.json",
  "cloudformationAppTag": "s3watcher-cloudformation"
}

AWS Lambda deploy without Cloudformation

{
  "name": "s3watcher",
  "...": "...",
  "isAwsLambda": true,
  "cloudformation": false
}

You should also have a riff-raff.yaml in your root directory that can be read by RiffRaff, although the plugin will work without one.

Once you've set up the equivalent package.json, you will need to add an npm task riffraff-artefact. Running this will then generate the artefact for you and upload it to S3.

You may then wish to add build hooks into whatever continuous deployment you're using to deploy your artefact.

You can enable more verbose logging setting the environment variable VERBOSE=true.

Configuring the Default build directory

By default, this plugin will build the tgz file from the default directory (the root). You can configure this by setting buildDir to whatever you want in the package.json file. Note that this is the root directory that node will be run on. So a package.json with relevant run scripts must be present.

Build environment support

Works on:

  • Circle CI
  • Travis
  • Jenkins with the Git plugin
  • Teamcity. Note - you need to manually pass the branch name as an environment variable. Under Parameters, create an environment variable called TEAMCITY_BRANCH with the value teamcity.build.vcs.branch.<your build configuration ID>

If you want to support other continuous integration tools, have a look at settings.js and configure the relevant environment variables to get information about the build.

Contributing

  • Clone
  • Update the code
  • npm build
  • Commit
2.0.2

5 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.8.4

8 years ago

1.8.3

8 years ago

1.8.2

8 years ago

1.8.1

8 years ago

1.8.0

8 years ago

1.7.2

8 years ago

1.7.1

8 years ago

1.7.0

8 years ago

1.6.5

9 years ago

1.6.4

9 years ago

1.6.3

9 years ago

1.6.2

9 years ago

1.6.1

9 years ago

1.6.0

9 years ago

1.5.1

9 years ago

1.5.0

9 years ago

1.4.0

9 years ago

1.3.8

9 years ago

1.3.7

9 years ago

1.3.6

9 years ago

1.3.5

9 years ago

1.3.4

9 years ago

1.3.3

9 years ago

1.3.2

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.12

9 years ago

1.2.10

9 years ago

1.2.9

9 years ago

1.2.8

9 years ago

1.2.7

9 years ago

1.2.6

9 years ago

1.2.5

9 years ago

1.2.4

9 years ago

1.2.3

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.6

9 years ago

1.1.5

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago