Skip to content

Commit cac8189

Browse files
committed
ci: change to machine executor to enable docker caching
1 parent e571818 commit cac8189

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

.circleci/config.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
version: 2
22

3+
references:
4+
restore_repo: &restore_repo
5+
restore_cache:
6+
keys:
7+
- v1-repo-{{ .Branch }}-{{ .Revision }}
8+
- v1-repo-{{ .Branch }}
9+
- v1-repo
10+
save_repo: &save_repo
11+
save_cache:
12+
key: v1-repo-{{ .Branch }}-{{ .Revision }}
13+
paths:
14+
- ~/project
15+
316
jobs:
417
build_and_deploy:
5-
working_directory: /project
618
docker:
719
- image: docker:17.05.0-ce-git
20+
machine:
21+
docker_layer_caching: true
822
steps:
23+
- *restore_repo
924
- checkout
10-
- run:
11-
name: Install dependencies
12-
command: |
13-
apk add --no-cache py-pip=9.0.0-r1
14-
pip install awscli==1.11.76
15-
- setup_remote_docker
16-
- restore_cache:
17-
keys:
18-
- v1-{{ .Branch }}
19-
paths:
20-
- /caches/project.tar
21-
- run:
22-
name: Load Docker image layer cache
23-
command: |
24-
set +o pipefail
25-
docker load -i /caches/project.tar | true
25+
- *save_repo
2626
- run:
2727
name: Build application Docker image
2828
command: |
2929
VERSION=$(cat VERSION)
30-
docker build . -t developmentseed/geolambda:${VERSION} #--cache-from=project
30+
docker build . -t developmentseed/geolambda:${VERSION}
3131
- run:
3232
name: Save Docker image layer cache
3333
command: |
@@ -52,6 +52,7 @@ jobs:
5252
- deploy:
5353
name: Deploy public Lambda layers
5454
command: |
55+
pip install awscli
5556
VERSION=$(cat VERSION)
5657
docker run --rm -v $PWD:/home/geolambda --entrypoint package.sh -it developmentseed/geolambda:${VERSION}
5758
for region in [us-east-1, us-west-2, eu-central-1]

0 commit comments

Comments
 (0)