You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently apify push pushes all files except those in .gitignore and .git directory. This is fine default behavior for interpreted languages, but not so much for compiled languages.
The usual docker building workflow with compiled languages is to have in .gitignore all results of compilation and have different set of files used for docker image building as defined in .dockerignore. Typically the .dockerignore would differ from .gitignore that it would ignore all sources but it would include compilation result.
There are ugly workarounds for the current apify push:
commit compilation results and have sources needlessly included in the actor docker
manually update gitignore everytime before apify push
but these are both really ugly.
This I believe is applicable to all compiled languages. And as apify is mostly for JavaScript it seems like a rare edge case. But hey, don't you want to welcome compiled languages too?
A specific example is minimal actor in ClojureScript I made: https://github.com/VaclavSynacek/apify-cljs-whats-my-name . ClojureScript is a compile-to-JavaScript language (but all of above is applicable also for compile-to-binary languages). In this example, ideally the compiled/main.js file would be included in the actor and src directory containing cljs source files (which the platform cannot understand anyway) does not need to be included. This is reflected in the .dockerignore file. But apify push only honors .gitignore so pushing this actor as-is will not work. If I manually change the .gitignore to not ignore compiled and to do ignore src than apify push pushes correct actor that actually does work.
The text was updated successfully, but these errors were encountered:
I got your point, but you have to think about apify push like git push which pushes your source code to apify platform. In this case, it makes sense to have all code on apify platform and view it in UI.
Of course, there is a bonus of apify push which build your actor. But the build is simple docker build command and it follows .dockerignore.
Hello @drobnikj,
maybe (mis)using .dockerignore is neither a good idea. But I still see the need to sometimes have different set of files in git and in apify. Especially for the compiled languages.
How about having an .apifyignore file that would overwrite .gitignore if it exists. If it does not, than fall back to current behaviour. Pull request for this attached.
Currently
apify push
pushes all files except those in.gitignore
and.git
directory. This is fine default behavior for interpreted languages, but not so much for compiled languages.The usual docker building workflow with compiled languages is to have in
.gitignore
all results of compilation and have different set of files used for docker image building as defined in.dockerignore
. Typically the.dockerignore
would differ from.gitignore
that it would ignore all sources but it would include compilation result.There are ugly workarounds for the current
apify push
:gitignore
everytime beforeapify push
but these are both really ugly.
This I believe is applicable to all compiled languages. And as apify is mostly for JavaScript it seems like a rare edge case. But hey, don't you want to welcome compiled languages too?
A specific example is minimal actor in ClojureScript I made: https://github.com/VaclavSynacek/apify-cljs-whats-my-name . ClojureScript is a compile-to-JavaScript language (but all of above is applicable also for compile-to-binary languages). In this example, ideally the
compiled/main.js
file would be included in the actor andsrc
directory containing cljs source files (which the platform cannot understand anyway) does not need to be included. This is reflected in the.dockerignore
file. Butapify push
only honors.gitignore
so pushing this actor as-is will not work. If I manually change the.gitignore
to not ignorecompiled
and to do ignoresrc
thanapify push
pushes correct actor that actually does work.The text was updated successfully, but these errors were encountered: