I had a project running circleci 2.0, with tests and deploy to AWS (based on tags)
On the other day, I’ve also added circleci 2.0 to another project (based on the same account), and basically made a copy from config file, only swapped the cache keys and folder.
Yet, the project #1 build started to fail. It breaks on the checkout code part, giving the error “Directory (/home/circleci/src) you are trying to checkout to is not empty and not git repository”.
I’ve tried to change the folder to another thing, yet, it always gives me the same error.
The build on the #2 project works fine, yet, #1 fails always.
I know that the working directory (and cache one) are the same directory on both projects, yet, I’ve tested with random folder names, and it gives me the same error on.
I’d expect both of them to fail, to be honest. You’re trying to save/restore ~/src to the cache, and also checkout to it. These strike me as conflicting operations, and you should do one or the other.
Thanks for the answer @halfer. Though, doesn’t seem to be the problem.
I’ve swapped the folders from #2 project to some other randomly, and it still builds without any problem.
Yet, on the #1 project, it keeps to give the same error (Directory (/home/circleci/up-hill/newfolder) you are trying to checkout to is not empty and not git repository)
I’ve disabled the save_cache and restore_cache steps, yet, same error
Put a new run step that does a ls -lR /home/circleci/src before your checkout. It’d be interesting to see what this comes up with
I wonder what the real value of “anotherfolder” is here ~/up-hill/anotherfolder. Is there any value in just getting rid of this? I don’t know what value there is in not using the default working dir.
Ooh, I just noticed you are doing yarn install before a checkout - does this not need the dependencies file in your repo in order to work?