mirror of
https://github.com/ansible/awx.git
synced 2026-01-25 00:11:23 -03:30
Get unit-test container working
node_modules was being overwritten by the bind-mount when the container started. This is kind of hacky, but it’s the only way to do this without changing everything.
This commit is contained in:
parent
2084999e78
commit
793ce37a07
@ -41,7 +41,10 @@ RUN cd $(npm root -g)/npm \
|
||||
|
||||
RUN npm install -g npm@3.10.7
|
||||
|
||||
WORKDIR "/ansible-tower"
|
||||
# We need to install dependencies somewhere other than /ansible-tower.
|
||||
# Anything in /ansible-tower will be overwritten by the bind-mount.
|
||||
# We switch the WORKDIR to /ansible-tower further down.
|
||||
WORKDIR "/tmp/ansible-tower"
|
||||
|
||||
# Copy requirements files
|
||||
# NOTE: '*' is not used as it invalidates docker caching
|
||||
@ -72,5 +75,12 @@ RUN npm set progress=false
|
||||
|
||||
RUN make ui-deps
|
||||
|
||||
ENTRYPOINT ["/bin/bash", "-c"]
|
||||
WORKDIR "/ansible-tower"
|
||||
|
||||
# This entrypoint script takes care of moving the node_modules
|
||||
# into the bind-mount, then exec's to whatever was passed as the CMD.
|
||||
ADD tools/docker-compose/unit-tests/entrypoint /usr/bin/
|
||||
RUN chmod +x /usr/bin/entrypoint
|
||||
|
||||
ENTRYPOINT ["entrypoint"]
|
||||
CMD ["bash"]
|
||||
|
||||
7
tools/docker-compose/unit-tests/entrypoint
Normal file
7
tools/docker-compose/unit-tests/entrypoint
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
mkdir -p /ansible-tower/awx/ui/
|
||||
mv -n /tmp/ansible-tower/awx/ui/node_modules /ansible-tower/awx/ui
|
||||
|
||||
exec $@
|
||||
Loading…
x
Reference in New Issue
Block a user