Skip to content

Support CI/CD Pipelines using Artifacts#123

Description

@lexi-ember

馃挕 Feature description

When an artifact is provided in serverless.yaml for a Rust function, skip building that function and use the provided artifact instead.

This should not cause the error for no Rust functions found to trigger, even if all Rust functions are skipped this way.

This is required to support CI/CD pipeline patterns where artifacts are built in one step, then verified, and then the verified artifact is deployed without recompiling which could introduce variance.

Nice To Have:

It would also be nice if the "no Rust functions" error could be suppressed, and if Rust functions could be discovered in a way that doesn't cause schema warnings.

馃捇 Basic example

For the following serverless.yaml:

service: barebones-service
provider:
  name: aws
  runtime: rust
  memorySize: 128
  stage: dev

package:
  individually: true

custom:
  rust:
    dockerless: true

plugins:
  - serverless-rust

functions:
  restApi:
    handler: "rest"
    events:
      - httpApi: '*'
    package:
      artifact: ${param:artifact,""}

This allows a build-and-deploy workflow:

serverless deploy --stage stage

Or an artifact workflow:

serverless package --stage stage
cp target/lambda/release/rest.zip artifacts/
# VERIFY PACKAGE
serverless deploy --stage stage --param="artifact=artifacts/rest.zip"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions