mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 08:48:46 -03:30
Merge pull request #3975 from ansible/unit-test-base-image
Use tower_devel as base image for unit tests
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
|
.git
|
||||||
awx/ui/node_modules
|
awx/ui/node_modules
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -231,10 +231,14 @@ clean: clean-rpm clean-deb clean-ui clean-tar clean-packer clean-bundle
|
|||||||
rm -rf awx/public
|
rm -rf awx/public
|
||||||
rm -rf awx/lib/site-packages
|
rm -rf awx/lib/site-packages
|
||||||
rm -rf dist/*
|
rm -rf dist/*
|
||||||
|
rm -rf awx/job_status
|
||||||
|
rm -rf reports
|
||||||
|
rm -f awx/awx_test.sqlite3
|
||||||
rm -rf tmp
|
rm -rf tmp
|
||||||
mkdir tmp
|
mkdir tmp
|
||||||
rm -rf build $(NAME)-$(VERSION) *.egg-info
|
rm -rf build $(NAME)-$(VERSION) *.egg-info
|
||||||
find . -type f -regex ".*\.py[co]$$" -delete
|
find . -type f -regex ".*\.py[co]$$" -delete
|
||||||
|
find . -type d -name "__pycache__" -delete
|
||||||
|
|
||||||
# convenience target to assert environment variables are defined
|
# convenience target to assert environment variables are defined
|
||||||
guard-%:
|
guard-%:
|
||||||
|
|||||||
@@ -1,39 +1,13 @@
|
|||||||
# FROM gcr.io/ansible-tower-engineering/tower_devel:latest
|
FROM gcr.io/ansible-tower-engineering/tower_devel:latest
|
||||||
FROM centos
|
|
||||||
|
|
||||||
RUN yum install -y epel-release
|
RUN yum install -y bzip2 gcc-c++
|
||||||
|
|
||||||
RUN yum install -y \
|
# We need to install dependencies somewhere other than /ansible-tower.
|
||||||
bzip2 \
|
# Anything in /ansible-tower will be overwritten by the bind-mount.
|
||||||
python-pip \
|
# We switch the WORKDIR to /ansible-tower further down.
|
||||||
python-virtualenv \
|
WORKDIR "/tmp/"
|
||||||
make \
|
|
||||||
swig \
|
|
||||||
git \
|
|
||||||
libffi-devel \
|
|
||||||
openssl-devel \
|
|
||||||
libxml2-devel \
|
|
||||||
xmlsec1-devel \
|
|
||||||
xmlsec1-openssl-devel \
|
|
||||||
gcc \
|
|
||||||
gcc-c++ \
|
|
||||||
/usr/bin/pg_config \
|
|
||||||
openldap-devel \
|
|
||||||
postgresql-devel \
|
|
||||||
rabbitmq-server \
|
|
||||||
libtool-ltdl-devel \
|
|
||||||
fontconfig
|
|
||||||
|
|
||||||
# NOTE: The following steps work for tower-3.0.0
|
# Build front-end deps
|
||||||
# RUN curl -LO https://rpm.nodesource.com/pub_0.12/el/7/x86_64/nodejs-0.12.9-1nodesource.el7.centos.x86_64.rpm
|
|
||||||
# RUN yum install -y nodejs-0.12.9-1nodesource.el7.centos.x86_64.rpm
|
|
||||||
# RUN rm nodejs-0.12.9-1nodesource.el7.centos.x86_64.rpm
|
|
||||||
|
|
||||||
# Remove the 2 lines below and uncomment the 3 lines above to build
|
|
||||||
# RPMs with the old JS build system.
|
|
||||||
RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
|
|
||||||
|
|
||||||
RUN yum install -y nodejs
|
|
||||||
|
|
||||||
# https://github.com/npm/npm/issues/9863
|
# https://github.com/npm/npm/issues/9863
|
||||||
RUN cd $(npm root -g)/npm \
|
RUN cd $(npm root -g)/npm \
|
||||||
@@ -42,41 +16,15 @@ RUN cd $(npm root -g)/npm \
|
|||||||
|
|
||||||
RUN npm install -g npm@3.10.7
|
RUN npm install -g npm@3.10.7
|
||||||
|
|
||||||
# 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
|
|
||||||
COPY requirements/requirements.txt requirements/
|
|
||||||
COPY requirements/requirements_ansible.txt requirements/
|
|
||||||
COPY requirements/requirements_dev.txt requirements/
|
|
||||||
COPY requirements/requirements_jenkins.txt requirements/
|
|
||||||
|
|
||||||
|
|
||||||
# Copy __init__.py so the Makefile can retrieve `awx.__version__`
|
|
||||||
COPY awx/__init__.py awx/
|
|
||||||
|
|
||||||
# Copy Makefile
|
|
||||||
COPY Makefile .
|
|
||||||
|
|
||||||
# Install tower runtime virtualenvs
|
|
||||||
ENV SWIG_FEATURES="-cpperraswarn -includeall -I/usr/include/openssl"
|
|
||||||
RUN make requirements
|
|
||||||
|
|
||||||
# Install tower test requirements
|
|
||||||
ENV VENV_BASE=""
|
|
||||||
RUN make requirements_jenkins
|
|
||||||
|
|
||||||
# Build front-end deps
|
|
||||||
COPY awx/ui/package.json awx/ui/
|
COPY awx/ui/package.json awx/ui/
|
||||||
|
|
||||||
RUN npm set progress=false
|
RUN npm set progress=false
|
||||||
|
|
||||||
|
# Copy __init__.py so the Makefile can retrieve `awx.__version__`
|
||||||
|
COPY awx/__init__.py awx/
|
||||||
RUN make ui-deps
|
RUN make ui-deps
|
||||||
|
|
||||||
WORKDIR "/ansible-tower"
|
WORKDIR "/tower_devel"
|
||||||
|
|
||||||
# This entrypoint script takes care of moving the node_modules
|
# This entrypoint script takes care of moving the node_modules
|
||||||
# into the bind-mount, then exec's to whatever was passed as the CMD.
|
# into the bind-mount, then exec's to whatever was passed as the CMD.
|
||||||
|
|||||||
@@ -11,4 +11,4 @@ services:
|
|||||||
TEST_DIRS: awx/main/tests/unit awx/main/tests/functional
|
TEST_DIRS: awx/main/tests/unit awx/main/tests/functional
|
||||||
command: ["make test"]
|
command: ["make test"]
|
||||||
volumes:
|
volumes:
|
||||||
- ../../../:/ansible-tower
|
- ../../../:/tower_devel
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
mkdir -p /ansible-tower/awx/ui/
|
mkdir -p /tower_devel/awx/ui/
|
||||||
mv -n /tmp/ansible-tower/awx/ui/node_modules /ansible-tower/awx/ui
|
mv -n /tmp/awx/ui/node_modules /tmp/awx/ui/.deps_built /tower_devel/awx/ui
|
||||||
|
|
||||||
exec $@
|
exec $@
|
||||||
|
|||||||
Reference in New Issue
Block a user