diff --git a/dev/diff/cli.js b/dev/diff/cli.js index 85ec7c63a..461b0c37a 100644 --- a/dev/diff/cli.js +++ b/dev/diff/cli.js @@ -653,9 +653,6 @@ async function main () { Tty: true, Hostname: 'appsource', HostConfig: { - Binds: [ - `${config.source}:/workspace` - ], NetworkMode: 'dt-diff-net' } }) @@ -672,9 +669,6 @@ async function main () { Tty: true, Hostname: 'apptarget', HostConfig: { - Binds: [ - `${config.target}:/workspace` - ], NetworkMode: 'dt-diff-net' } }) @@ -689,6 +683,63 @@ async function main () { } }) }, + // -------------------------------------------- + // Copy working files to Datatracker containers + // -------------------------------------------- + { + title: 'Copy working files to Datatracker docker containers', + task: (ctx, task) => task.newListr([ + { + title: 'Copying workfing files into source Datatracker docker container...', + task: async (subctx, subtask) => { + const tgzPath = path.join(config.source, 'diff-import.tgz') + await tar.c({ + gzip: true, + file: tgzPath, + cwd: config.source, + filter (path) { + if (path.includes('.git') || path.includes('node_modules')) { return false } + subtask.output = path + return true + } + }, ['.']) + subtask.output = 'Injecting into container...' + await containers.appSource.putArchive(tgzPath, { + path: '/workspace' + }) + await fs.remove(tgzPath) + subtask.title = `Imported working files into source Datatracker docker container (dt-diff-app-source) successfully.` + } + }, + { + title: 'Copying working files into target Datatracker docker container...', + task: async (subctx, subtask) => { + const tgzPath = path.join(config.target, 'diff-import.tgz') + await tar.c({ + gzip: true, + file: tgzPath, + cwd: config.target, + filter (path) { + if (path.includes('.git') || path.includes('node_modules')) { return false } + subtask.output = path + return true + } + }, ['.']) + subtask.output = 'Injecting into container...' + await containers.appTarget.putArchive(tgzPath, { + path: '/workspace' + }) + await fs.remove(tgzPath) + subtask.title = `Imported working files into target Datatracker docker container (dt-diff-app-target) successfully.` + } + } + ], { + concurrent: true, + rendererOptions: { + collapse: false + } + }) + }, // ------------------- // Run prepare scripts // -------------------