version: 2.1
commands:
checkoutandverify:
description: "Checkout and Verify"
steps:
- add_ssh_keys:
fingerprints:
- "xxxxxx" # test user
- restore_cache:
keys:
- source-v2-{{ .Branch }}
- source-v2-master
- checkout
- run:
name: "Pull Submodules"
command: |
git submodule init
git submodule update
This repo has two submodules(schema1, schema2). If the commit updates submodules, checkout step will fail. If we remove restore_cache step, everything will work fine.
Here is log for restore_cache step
No cache is found for key: source-v2-sliu_test
Found a cache from build 2176 at source-v2-master
Size: 11 MB
Cached paths:
* /Users/distiller/project/.git
Downloading cache archive...
Validating cache...
Unarchiving cache...
Here is log for checkout step
remote: Enumerating objects: 29, done.
remote: Counting objects: 100% (29/29), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 40 (delta 21), reused 25 (delta 19), pack-reused 11
Unpacking objects: 100% (40/40), done.
From github.com:xxxxx/test
* [new branch] test -> origin/test
fatal: exec 'rev-list': cd to 'schema1' failed: No such file or directory
Fetching submodule schema
fatal: cannot chdir to '../../../schema1': No such file or directory
Exited with code 1
I tried to ssh into the machine with restored cache, and run all command line from check out step, everything works fine.