npm package: @salesforce/plugin-evergreen-build
Description: An SFDX CLI plugin for building and testing images for Salesforce Evergreen functions and services
Author: @heroku
Latest version: 0.20.8

SFDX CLI Evergreen Build plugin
=================

An SFDX CLI plugin for building and testing images for Salesforce Evergreen functions and service.

Note: This feature is in beta and has been released early so we can collect feedback. It may contain significant problems, undergo major changes, or be discontinued. The use of this feature is governed by the [Salesforce.com Program Agreement](https://trailblazer.me/terms?lan=en).

[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![CircleCI](https://circleci.com/gh/heroku/evergreen-plugin-build.svg?style=svg)](https://circleci.com/gh/heroku/evergreen-plugin-build)
[![Version](https://img.shields.io/npm/v/heroku-build.svg)](https://npmjs.org/package/@heroku/evergreen-plugin-build)
[![Downloads/week](https://img.shields.io/npm/dw/heroku-build.svg)](https://npmjs.org/package/@heroku/evergreen-plugin-build)
[![License](https://img.shields.io/npm/l/heroku-build.svg)](https://github.com/heroku/evergreen-plugin-build/blob/master/package.json)

# Table of contents
<!-- toc -->
* [Table of contents](#table-of-contents)
* [Usage](#usage)
* [Commands](#commands)
* [Using a different builder](#using-a-different-builder)
<!-- tocstop -->

# Usage
```sh-session
$ sfdx plugins:install @salesforce/plugin-evergreen-build
running command...
$ sfdx evergreen --help [COMMAND]
USAGE
  $ sfdx evergreen:COMMAND
...
```

# Commands
<!-- commands -->
* [`sfdx evergreen:function:build IMAGE`](#sfdx-evergreenfunctionbuild-image)
* [`sfdx run:function`](#sfdx-runfunction)
* [`sfdx run:function:start`](#sfdx-runfunctionstart)

## `sfdx evergreen:function:build IMAGE`

build function source code into a deployable image

```
USAGE
  $ sfdx evergreen:function:build IMAGE

ARGUMENTS
  IMAGE  image name, must be in all lowercase

OPTIONS
  -e, --env=env          Build-time environment variable, in the form 'VAR=VALUE'or 'VAR'. When using latter value-less
                         form, value will be taken from current environment at the time this command is executed. This
                         flag may occur multiple times if more than one variable is desired.

  -p, --path=path        [default: /home/circleci/project] path to function dir

  -v, --verbose          output raw build logs

  --buildpack=buildpack  Buildpack ID, path to a Buildpack directory, or path/URL to a Buildpack .tgz file. Repeat for
                         each buildpack in order.

  --clear-cache          Clear image's associated cache before building.

  --env-file=env-file    Build-time environment variables file comprised of one variable per line, of the form
                         'VAR=VALUE' or 'VAR' When using latter value-less form, value will be taken from current
                         environment at the time this command is executed.

  --network=network      Connect and build containers to a network. This can be useful to build containers which require
                         a local resource.

  --no-pull              Skip pulling builder and run images before use.

EXAMPLE

       $ sfdx evergreen:function:build image-repo/myfunction:dev
       $ sfdx evergreen:function:build image-repo/myfunction:dev --path /path/to/function/src
       $ sfdx evergreen:function:build image-repo/myfunction:dev --network host
```

_See code: [src/commands/evergreen/function/build.ts](https://github.com/heroku/evergreen-plugin-build/blob/v0.20.8/src/commands/evergreen/function/build.ts)_

## `sfdx run:function`

send a cloudevent to a function

```
USAGE
  $ sfdx run:function

OPTIONS
  -H, --headers=headers                set headers
  -p, --payload=payload                set the payload of the cloudevent. also accepts @file.txt format
  -t, --targetusername=targetusername  username or alias for the target org; overrides default target org
  -u, --url=url                        (required) url of the function to run
  --structured                         set the cloudevent to be emitted as a structured cloudevent (json)

EXAMPLE

       $ sfdx run:function -u http://localhost:8080 -p '{"id": 12345}'
       $ sfdx run:function -u http://localhost:8080 -p '@file.json'
       $ echo '{"id": 12345}' | sfdx run:function -u http://localhost:8080
       $ sfdx run:function -u http://localhost:8080 -p '{"id": 12345}' --structured
```

_See code: [src/commands/run/function.ts](https://github.com/heroku/evergreen-plugin-build/blob/v0.20.8/src/commands/run/function.ts)_

## `sfdx run:function:start`

build and run function image locally

```
USAGE
  $ sfdx run:function:start

OPTIONS
  -d, --debug-port=debug-port  [default: 9229] port for remote debugging
  -e, --env=env                set environment variables (provided during build and run)
  -p, --port=port              [default: 8080] port for running the function
  -v, --verbose                output additional logs
  --builder=builder            set custom builder image
  --clear-cache                clear associated cache before executing.

  --network=network            Connect and build containers to a network. This can be useful to build containers which
                               require a local resource.

  --no-pull                    skip pulling builder image before use

EXAMPLE

       $ sfdx run:function:start
       $ sfdx run:function:start -e VAR=VALUE
       $ sfdx run:function:start --network host --no-pull --clear-cache --debug-port 9000 --port 5000
```

_See code: [src/commands/run/function/start.ts](https://github.com/heroku/evergreen-plugin-build/blob/v0.20.8/src/commands/run/function/start.ts)_
<!-- commandsstop -->

# Using a different builder

  - Grab the desired version from [here](https://github.com/heroku/builder/releases), `go get -u github.com/heroku/builder/cmd/builder`, or build it yourself.
  - `export BENNY_PATH=<path_to_built_binary>`
  - Now you can run your `sfdx` commands that require a builder and it will use the provided builder instead of the one downloaded during plugin install.