platformOS Community

pos-cli deploy - handling of files not in build

Patrick - Combinate Nov 16 2021 at 02:41

We remove files from our codebase that users manage through our admin interface.

For example, we allow users to edit the YAML for tables to change configuration.
These files do not appear in our codebase so that a pos-cli deploy action does not revert there changes.

We also allow users to create new content that is not in our codebase

Lookling at

pos-cli deploy [options] [environment]

Options:
  -f --force                 deprecated
  -d --direct-assets-upload  deprecated, this is default strategy
  -o --old-assets-upload     use old assets upload strategy
  -p --partial-deploy        Partial deployment, does not remove data from directories missing from the build
  -h, --help                 output usage information

Does -p --partial-deploy suggest that the default behaviour is to remove items nbot include in the build? It has not been an issue so far, but we need to know if this is the intended behaviour or not as it would cause major issues if deploy started to remove missing items

Pawel Nov 16 2021 at 11:41

Partial deploy has been made to make it easy to deploy updates without interfering with any files that are already deployed.
Main use case were modules - it allows to deploy a module without even having app directory locally.

It enabled more complicated structuring of projects.
For example, one directory could have app, another directory could have modules regarding payments, and the next one could have shared modules.
When using partial deploy, all of them can be deployed (in that order) and system will just lay new files on top of existing deploy, instead of removing what is not present in app/ directory, as it is by default.

Patrick - Combinate Nov 17 2021 at 03:33

Thanks @Pawel

When using partial deploy, all of them can be deployed (in that order) and system will just lay new files on top of existing deploy, instead of removing what is not present in app/ directory, as it is by default.

This part concerns me
"instead of removing what is not present in app/ directory, as it is by default."

For example, our code base does not include YAML, pages or partials that are managed by our code base.
They are managed directly in the Insites Admin
For example, this client has added a News table

As this was added via the Insites Admin, we never have a copy of it in our code base.

We have just deployed a round of updates for other parts of the site and nothing was removed

I am happy with the fact that nothing is removed - we do not want our build files to overwrite what a client adds.
How do you view this? Should we expect files to be removed in the future if we use pos-cli deploy?

I would really like the current process to stay in place. If we need to delete items, we use sync or GraphQL to specifically delete items.

Please sign in or fill up your profile to answer a question