mirror of
https://github.com/ansible/awx.git
synced 2026-02-02 18:18:12 -03:30
Fix pip install in unit test container
The SWIG_FEATURES environment variable is to get pip install working with M2Crypto==0.22.3. It works without SWIG_FEATURES if we update to M2Crypto >= 0.23.0. Also did some organization, add README.
This commit is contained in:
40
tools/docker-compose/unit-tests/Dockerfile
Normal file
40
tools/docker-compose/unit-tests/Dockerfile
Normal file
@@ -0,0 +1,40 @@
|
||||
# FROM gcr.io/ansible-tower-engineering/tower_devel:latest
|
||||
FROM centos
|
||||
|
||||
RUN yum install -y epel-release
|
||||
|
||||
RUN yum install -y \
|
||||
python-pip \
|
||||
python-virtualenv \
|
||||
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 \
|
||||
libtool-ltdl-devel
|
||||
|
||||
# NOTE: The following steps work for tower-3.0.0
|
||||
# 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
|
||||
|
||||
RUN npm set progress=false
|
||||
|
||||
WORKDIR "/ansible-tower"
|
||||
|
||||
ENV VENV_BASE="/venv"
|
||||
ENTRYPOINT ["/bin/bash", "-c"]
|
||||
CMD ["bash"]
|
||||
15
tools/docker-compose/unit-tests/README.md
Normal file
15
tools/docker-compose/unit-tests/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
Run from the root of the repo:
|
||||
|
||||
```shell
|
||||
$ docker-compose -f tools/docker-compose/unit-tests/docker-compose.yml run unit-tests
|
||||
```
|
||||
|
||||
This will start the container, install the dependencies, and run the unit tests.
|
||||
|
||||
If you just want to pop into a shell and poke around, run:
|
||||
|
||||
```shell
|
||||
$ docker-compose -f tools/docker-compose/unit-tests/docker-compose.yml run unit-tests bash
|
||||
```
|
||||
|
||||
If you run into any weirdness, it's probably a good idea to just give up and `make clean`.
|
||||
13
tools/docker-compose/unit-tests/docker-compose.yml
Normal file
13
tools/docker-compose/unit-tests/docker-compose.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
version: '2'
|
||||
services:
|
||||
unit-tests:
|
||||
build:
|
||||
context: ../../../
|
||||
dockerfile: tools/docker-compose/unit-tests/Dockerfile
|
||||
environment:
|
||||
SWIG_FEATURES: "-cpperraswarn -includeall -I/usr/include/openssl"
|
||||
command: ["make requirements_test test"]
|
||||
|
||||
volumes:
|
||||
- ../../../:/ansible-tower
|
||||
Reference in New Issue
Block a user