From 6aba5b470423d359e28973e93c3da9621f809d47 Mon Sep 17 00:00:00 2001 From: Vaclav Synacek Date: Sun, 17 May 2020 09:27:16 +0200 Subject: [PATCH 1/2] if .apifyignore exists, use it instead of .gitignore --- src/lib/utils.js | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/lib/utils.js b/src/lib/utils.js index 50fef5ec4..e3f5bb419 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -204,11 +204,29 @@ const createSourceFiles = async (paths) => { * Get actor local files, omit files defined in .gitignore and .git folder * All dot files(.file) and folders(.folder/) are included. */ -const getActorLocalFilePaths = () => globby(['*', '**/**'], { - ignore: ['.git/**'], - gitignore: true, - dot: true, -}); +const getActorLocalFilePaths = () => { + + let opt; + + if (fs.existsSync('.apifyignore')) { + info('Using .apifyignore for ignore list.'); + const ignorelist = fs.readFileSync('.apifyignore', 'UTF-8').split(/\r?\n/).filter( (line) => line !== ''); + opt = { + ignore: ['.git/**', ...ignorelist], + gitignore: false, + dot: true, + } + + } else { + info('Using .gitignore for ignore list.'); + opt = { + ignore: ['.git/**'], + gitignore: true, + dot: true, + } + } + return globby(['*', '**/**'], opt) +}; /** * Create zip file with all actor files specified with pathsToZip From 38ca1a782bb7f3837084e5b81b29e8e1b35e1a6b Mon Sep 17 00:00:00 2001 From: Vaclav Synacek Date: Sun, 17 May 2020 09:37:52 +0200 Subject: [PATCH 2/2] log files to be pushed and total size --- src/commands/push.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/commands/push.js b/src/commands/push.js index a3555e75d..0174e6939 100644 --- a/src/commands/push.js +++ b/src/commands/push.js @@ -67,6 +67,9 @@ class PushCommand extends ApifyCommand { const filePathsToPush = await getActorLocalFilePaths(); const filesSize = await sumFilesSizeInBytes(filePathsToPush); + outputs.info('Local files size is: ' + filesSize); + outputs.info('Local files to be pushed: ' + filePathsToPush); + let sourceType; let sourceFiles; let tarballUrl;