-
-
Notifications
You must be signed in to change notification settings - Fork 194
Shipit-deploy: copy previous release #225
Comments
Copying files locally (on the remote) is faster than transferring all files from the local to the remote. So we assume that between two releases there is not a lot of changes. By coping previous release, the rsync will have less files to transfer. It results in a faster deploy process. |
@neoziro Okay, and the process automatically detects which files have changed and just upload them? |
Yes it is |
Great to know that. Does this check happen before copying from the previous version? I suspect that the |
@btxtiger oh yes probably, maybe we could optimize it! |
Hi! I just ran into this problem while renaming a file to use typescript (changed a Is anything planned to fix this unexpected behaviour? |
@fTrestour nothing planned, however I am open for PR. |
But there seems to be a fallback to @neoziro I'm currently searching for a way to copy only the required files. I noticed there is a parameter |
This works for me: async function copyPreviousRelease() {
// const copyParameter = shipit.config.copy || '-a'
if (!shipit.previousRelease || shipit.config.copy === false) return
shipit.log('Copy previous release to "%s"', shipit.releasePath)
const formatRsyncCommand = (options) => {
const excludes = options.excludes.reduce(
(args, current) => [...args, '--exclude', `"${current}"`],
[],
).join(' ');
return `rsync --recursive ${options.src} ${options.dest} ${excludes}`
};
await shipit.remote(
formatRsyncCommand(
{
src: path.join(shipit.releasesPath, shipit.previousRelease),
dest: shipit.releasePath,
excludes: shipit.config.ignores || []
}
)
// util.format(
// 'cp %s %s/. %s',
// copyParameter,
// path.join(shipit.releasesPath, shipit.previousRelease),
// shipit.releasePath,
// ),
)
} However the progress should be disabled, because the stdout crashes if too much files were copied (I included node_modules for testing). |
Instead of modifying the code you should set |
This should be in the docs. Great help. |
Glad to be useful. Sadly it looks like shipit is no more under active development. Last commit more than a year ago. |
When deploying with
shipit staging deploy
, i can see in terminal logs:Can you explain what it is used for? This task takes a lot of time, although it is not needed becuase new files were pulled/copied from local, and i can't see any of the copied files in the new directory. So I guess they were overwritten afterwards by my new files from
rsyncFrom
.The text was updated successfully, but these errors were encountered: