Skip to content

Enable partial deployments #159

@dkundel

Description

@dkundel

Right now whenever you run deploy we'll create a new version of every single file in your project. This was initially necessary since there was no way for us to get the current content of a deployed Function or Asset using the API. As a result we weren't actually able to tell if something changed or not.

With the added /Content endpoint for Functions we can now do this at least for Functions should be able to do the same for Assets in the future.

Another ask that we've seen that goes into a similar direction it to only deploy some parts of an application.

Both of these involve some major changes to several components and should therefore only be done for the next major version v3 once we moved to the monorepo.

Changes to Behavior

Changed default behavior for Deploy

When collecting all Functions & Assets that should be deployed, a hash of the content is being computed. After that the deployment process is the same up to the point where the Function Version is being created. Instead we'll:

  • fetch the version associated with the previous deployment active in that environment
  • fetch the content of that version
  • compute the hash for that version
  • compare the hash with the new hash of the to-be-deployed file
  • create new versions where necessary and return the existing version otherwise
  • create a bundle with new and existing versions and deploy

Add support for selective flags

We should change the behavior from --no-functions and --no-assets to having --assets and --functions flags that can get glob patterns or lists of files to specify what should be deployed. --no-functions and --no-assets would be deprecated aliases for those to flags.

What won't change

If a file is not on the filesystem, it will not be part of the newly created deployment anymore. However, it won't delete the Function Resource or any Versions associated with it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions