Skip to content

Commit 28547cc

Browse files
author
jakubk
committed
generate dockerfiles in ci + rm dockerfiles
- do not store dockerfiles in repo - cache base dockerfile in deploy step that was generated in `compare_base_dockerfiles` step - use global `working_directory`
1 parent 126831e commit 28547cc

File tree

3 files changed

+11
-461
lines changed

3 files changed

+11
-461
lines changed

.circleci/config.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ jobs:
77
steps:
88
- checkout:
99
path: /home/circleci/nipype
10+
- setup_remote_docker
1011
- run:
11-
name: Prune base Dockerfile in preparation for cache check
12+
name: Generate and prune base Dockerfile in preparation for cache check
1213
working_directory: /home/circleci/nipype/docker
1314
command: |
1415
mkdir -p /tmp/docker
16+
ash ./generate_dockerfiles.sh -b
17+
1518
# Use the sha256 sum of the pruned Dockerfile as the cache key.
1619
ash prune_dockerfile.sh Dockerfile.base > /tmp/docker/Dockerfile.base-pruned
1720
- restore_cache:
@@ -29,6 +32,7 @@ jobs:
2932
- persist_to_workspace:
3033
root: /tmp
3134
paths:
35+
- docker/Dockerfile.base-pruned
3236
- docker/get_base_image.sh
3337

3438

@@ -37,26 +41,26 @@ jobs:
3741
machine:
3842
# Ubuntu 14.04 with Docker 17.10.0-ce
3943
image: circleci/classic:201710-02
44+
working_directory: /home/circleci/nipype
4045
steps:
4146
- checkout:
4247
path: /home/circleci/nipype
4348
- attach_workspace:
4449
at: /tmp
4550
- run:
46-
name: Get test dependencies
51+
name: Get test dependencies and generate Dockerfiles
4752
command: |
4853
pip install --no-cache-dir codecov
54+
make gen-dockerfiles
4955
- run:
5056
name: Modify Nipype version if necessary
51-
working_directory: /home/circleci/nipype
5257
command: |
5358
if [ "$CIRCLE_TAG" != "" ]; then
5459
sed -i -E "s/(__version__ = )'[A-Za-z0-9.-]+'/\1'$CIRCLE_TAG'/" nipype/info.py
5560
fi
5661
- run:
5762
name: Get base image (pull or build)
5863
no_output_timeout: 60m
59-
working_directory: /home/circleci/nipype
6064
command: |
6165
source /tmp/docker/get_base_image.sh
6266
if [ "$GET_BASE" == "PULL" ]; then
@@ -72,7 +76,6 @@ jobs:
7276
- run:
7377
name: Build main image (py36)
7478
no_output_timeout: 60m
75-
working_directory: /home/circleci/nipype
7679
command: |
7780
e=1 && for i in {1..5}; do
7881
docker build \
@@ -87,7 +90,6 @@ jobs:
8790
- run:
8891
name: Build main image (py27)
8992
no_output_timeout: 60m
90-
working_directory: /home/circleci/nipype
9193
command: |
9294
e=1 && for i in {1..5}; do
9395
docker build \
@@ -151,8 +153,6 @@ jobs:
151153
docker:
152154
- image: docker:17.10.0-ce-git
153155
steps:
154-
- checkout:
155-
path: /home/circleci/nipype
156156
- setup_remote_docker
157157
- attach_workspace:
158158
at: /tmp
@@ -171,12 +171,10 @@ jobs:
171171
docker push nipype/nipype:py36
172172
docker push nipype/nipype:py27
173173
- run:
174-
name: Prune base Dockerfile to update cache
175-
working_directory: /home/circleci/nipype/docker
174+
name: Move pruned Dockerfile to /tmp/docker/cache directory
176175
command: |
177-
mkdir -p /tmp/docker/cache
178-
# Use the sha256 sum of the pruned Dockerfile as the cache key.
179-
ash prune_dockerfile.sh Dockerfile.base > /tmp/docker/cache/Dockerfile.base-pruned
176+
mkdir -p /tmp/docker/cache/
177+
mv /tmp/docker/Dockerfile.base-pruned /tmp/docker/cache/Dockerfile.base-pruned
180178
- save_cache:
181179
paths:
182180
- /tmp/docker/cache/Dockerfile.base-pruned

Dockerfile

Lines changed: 0 additions & 233 deletions
This file was deleted.

0 commit comments

Comments
 (0)