Prevent Docker from caching the git clone content

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
Aurélien Bompard 2020-09-17 11:44:47 +02:00
parent 2baa486616
commit 55e1575a53
No known key found for this signature in database
GPG key ID: 31584CFEB9BF64AD
2 changed files with 9 additions and 0 deletions

View file

@ -10,6 +10,12 @@
vars:
pre_tasks:
- name: create a file with random content to prevent docker from caching the git clone
copy:
dest: /etc/openshift_apps/fasjson/random-file
content: "{{ now() }}"
roles:
- role: openshift/project
app: fasjson

View file

@ -28,6 +28,9 @@ RUN dnf install -y \
python3-wheel && \
dnf autoremove -y && \
dnf clean all -y
# Add a file with random content to prevent Docker from caching the git clone step.
COPY random-file
RUN rm -f random-file
RUN git clone https://github.com/fedora-infra/fasjson.git && \
pushd fasjson && \
git checkout {{ (env == 'production')|ternary('stable', 'staging') }} && \