apify-cli icon indicating copy to clipboard operation
apify-cli copied to clipboard

[feature] apify push with hooks

Open pocesar opened this issue 5 years ago • 2 comments

It's mostly an interop feature request, to be able to execute compilation/transpilation (babel/typescript), execute tests if any, then push to the platform. this ensures that you never push a broken / stale build. my use-case is compile to typescript, lint, run jest, then push

inspiration: https://www.npmjs.com/package/husky (for git) or "prepublish[Only]"

check package.json for a key that the apify cli could look for settings, like (there are a couple of packages that use this way, like parcel, browserslist, babel itself)

{
   "apify": {
    "prePush": "npm commands..."
   }
}

or maybe even reuse npm's prepublish as a quick way to get this done, and be this behavior by default, and using --no-hooks (or something that ignores the settings, like --force) to apify push

pocesar avatar Jan 18 '20 21:01 pocesar

If you are looking for a workaround, you can use any CI tool like GH actions. I wrote https://help.apify.com/en/articles/1861038-setting-up-continuous-integration-for-apify-actors-on-bitbucket some time ago how to do it on Bitbucket pipelines. I think it is a more common way, rather than using hooks.

drobnikj avatar Jan 20 '20 06:01 drobnikj

that's definitely the way to go

pocesar avatar Jan 20 '20 16:01 pocesar