Update httptester for httpbin==0.6.2

This commit is contained in:
Matt Martz 2018-03-08 15:58:30 -06:00 committed by Matt Clay
parent 6352e67ab2
commit 7c311ad615
4 changed files with 44 additions and 8 deletions

View file

@ -1,7 +1,13 @@
FROM nginx:alpine
# We are pinning at 1.13.8 due to the 1.13.9 image having a vastly different /etc/ssl/openssl.cnf that do not work with our below commands
FROM nginx:1.13.8-alpine
# The following packages are required to get httpbin/brotlipy/cffi installed
# openssl-dev python2-dev libffi-dev gcc libstdc++ make musl-dev
# Symlinking /usr/lib/libstdc++.so.6 to /usr/lib/libstdc++.so is specifically required for brotlipy
RUN set -x && \
apk add -U openssl py-pip && \
apk add --no-cache openssl ca-certificates py-pip openssl-dev python2-dev libffi-dev gcc libstdc++ make musl-dev && \
update-ca-certificates && \
ln -s /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so && \
mkdir -p /root/ca/certs /root/ca/private /root/ca/newcerts && \
echo 1000 > /root/ca/serial && \
touch /root/ca/index.txt && \
@ -23,7 +29,8 @@ RUN set -x && \
cp /root/ca/cacert.pem /usr/share/nginx/html/cacert.pem && \
cp /root/ca/client.ansible.http.tests-cert.pem /usr/share/nginx/html/client.pem && \
cp /root/ca/private/client.ansible.http.tests-key.pem /usr/share/nginx/html/client.key && \
pip install gunicorn httpbin==0.5.0
pip install gunicorn httpbin==0.6.2 && \
apk del openssl-dev python2-dev libffi-dev gcc libstdc++ make musl-dev
ADD services.sh /services.sh
ADD nginx.sites.conf /etc/nginx/conf.d/default.conf

View file

@ -6,15 +6,31 @@
apk:
- openssl
- py-pip
- ca-certificates
- openssl-dev
- python2-dev
- libffi-dev
- gcc
- libstdc\+\+
- make
- musl-dev
apt:
- openssl
- python-pip
- python-dev
- libffi-dev
yum:
- openssl
- python-pip
- python-devel
- gcc
- libffi-devel
dnf:
- openssl
- python-pip
- python-devel
- gcc
- libffi-devel
tasks:
- name: Check for nginx
stat:
@ -29,9 +45,15 @@
- name: Install OS Packages
package:
name: "{{ item }}"
name: "{{ os_packages[ansible_pkg_mgr] }}"
update_cache: "{{ (ansible_pkg_mgr == 'dnf')|ternary(omit, 'yes') }}"
with_items: "{{ os_packages[ansible_pkg_mgr] }}"
- name: Symlink libstdc++
file:
state: link
src: /usr/lib/libstdc++.so.6
dest: /usr/lib/libstdc++.so
when: ansible_pkg_mgr == 'apk'
- name: Create cert directories
file:
@ -134,7 +156,7 @@
with_items:
- name: gunicorn
- name: httpbin
version: '0.5.0'
version: '0.6.2'
- name: Copy services.sh script
copy:

View file

@ -28,6 +28,10 @@ server {
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;
}
}

View file

@ -1,8 +1,11 @@
{
"variables": {
"docker_image": "nginx:1.13.8-alpine"
},
"builders": [
{
"type": "docker",
"image": "nginx:alpine",
"image": "{{user `docker_image`}}",
"commit": true,
"run_command": [
"-d",
@ -22,7 +25,7 @@
"[ -f /usr/bin/dnf ] && /usr/bin/dnf -y install ansible python2-dnf || true",
"[ ! -f /usr/bin/dnf -a -f /usr/bin/yum ] && /usr/bin/yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-`grep -o [0-9] /etc/redhat-release | head -1`.noarch.rpm || true",
"[ ! -f /usr/bin/dnf -a -f /usr/bin/yum ] && /usr/bin/yum -y install ansible || true",
"[ -f /usr/bin/apt-get ] && /usr/bin/apt-get update && /usr/bin/apt-get -y install ansible || true"
"[ -f /usr/bin/apt-get ] && /usr/bin/apt-get update && /usr/bin/apt-get -y install software-properties-common && /usr/bin/add-apt-repository ppa:ansible/ansible && /usr/bin/apt-get update && /usr/bin/apt-get -y install ansible || true"
]
},
{