Watch-cloud-folder in ci/cd

Is the moralis-admin-cli watch-cloud-folder command also intended to be used in the CI/CD process?

Let’s say on merge to main I want to update the code from the folder.

Can I do that with watch-cloud-folder command?
Will the command fail the CI/CD pipeline if it didn’t manage to update the cloud functions successfully?

It may be easier to upload a single js file for all cloud functions.

Why? I have a lot of defined cloud functions as well as helper functions in other file.
Its easier to organize it like this imo.

I remembered about someone that used an intermediate step to create a single file from current folder before uploading. Watching a cloud folder should do something similar anyway.

So i just tried the watch-cloud-folder function in github actions.
The logs says that the

ncc: Compiling file index.js into CJS
Changes Uploaded Correctly

But it doesn’t exit successfully on the success which is expected thing to do. Is there any way to accomplish this? I think its quite important to have a proper development process.

This is how it looks like when i manually cancel the github workflow.

After checking the moralis-admin-cli code it seems that it should be straightforward to add the ci/cd support maybe as autosave parameter -1?

Then the process.exit(1) needs to be placed where there can be an error (e.g. syntax, upload etc) and otherwise process.exit(0) i.e. success should be posted if everything was fine.

It may be faster for you to have that fix if you update it locally on your side until we are going to make moralis-admin-cli open source and anyone can contribute after that.

1 Like

I can confirm that I managed to edit the file locally and use it as such in the github ci cd pipeline.

When you opensource the moralis-admin-cli let me know and I can submit a PR.

Thx.

1 Like