Currently I have several git submodules in my root directory, and want to copy this into the container.
The docker instruction is as the following
COPY dir1/src /usr/dir1/src
Where the submodules lie inside the /dir1/src directory.
However, when I do git push to the resin app remote, the submodule directories exists, but the contents are empty.
However, when I do
sudo resin deploy <app_name> --build .
The COPY instructions work fine and the contents of the git submodules are copied properly.
Does this issue have something to do with the resin build server?
Hello @jalim, that’s because the builder doesn’t support submodules currently, so when you git push you only send the “umbrella” repository, not its submodules, so there are no files under dir1/src. The CLI doesn’t have any idea of git and merely builds what’s locally on the filesystem, hence you’re seeing it working fine.
@jalim, the reasons submodules aren’t supported on the builder are mostly related to how git works and there are no plans that I know of to support it. That said, you can use resin push to replace the git push workflow completely. This command does support submodules and uses the builder and supports some other goodies as well.
@jalim you would see that behaviour if your project source directory is extremely large. At that step resin-cli is packaging all of the files which are in your project directory into a tar archive, to upload to our build servers. How large is your project directory?
Also, sudo is not required for resin push. You can access the documentation for this command with:
➜ ~ resin help push
Usage: push <application>
This command can be used to start a build on the remote
resin.io cloud builders. The given source directory will be sent to the
resin.io builder, and the build will proceed. This can be used as a drop-in
replacement for git push to deploy.
Examples:
$ resin push myApp
$ resin push myApp --source <source directory>
$ resin push myApp -s <source directory>
Options:
--source, -s <source> The source that should be sent to the resin builder to be built (defaults to the current directory)