Skip to content

Commit f2138bb

Browse files
author
Bryan Kendall
committed
allow adding of shrinkwrap file
1 parent 4084fe5 commit f2138bb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • ansible/roles/builder/templates/basic_node

ansible/roles/builder/templates/basic_node/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ RUN {{ command }}
2525
# Add package.json from the current build context (`.` is the repo) second
2626
ADD ./repo/package.json /{{ name }}/package.json
2727

28+
# Add shrinkwrap from the current build context (`.` is the repo) first
29+
# If we change a non first-level dependency, this will break cache as expected
30+
{% if has_shrinkwrap %}
31+
ADD ./repo/npm-shrinkwrap.json /{{ name }}/npm-shrinkwrap.json
32+
{% endif %}
33+
2834
# install, should will skip if no package.json change
2935
WORKDIR /{{ name }}
3036
RUN npm install --production

0 commit comments

Comments
 (0)