Merge "Cache Ansible Galaxy on CI mirror servers"
This commit is contained in:
commit
6bcf28b5a2
|
@ -110,6 +110,14 @@ ErrorLogFormat "[%{cu}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% , \
|
|||
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_URI} !-d
|
||||
RewriteRule (.*)-(.*) $1.$2 [N]
|
||||
|
||||
# Ansible Galaxy
|
||||
CacheEnable disk "/galaxy"
|
||||
ProxyPass "/galaxy/" "https://galaxy.ansible.com/" ttl=120 keepalive=On retry=0
|
||||
ProxyPassReverse "/galaxy/" "https://galaxy.ansible.com/"
|
||||
CacheEnable disk "/galaxy-s3"
|
||||
ProxyPass "/galaxy-s3/" "https://ansible-galaxy.s3.amazonaws.com/" ttl=120 keepalive=On retry=0
|
||||
ProxyPassReverse "/galaxy-s3/" "https://ansible-galaxy.s3.amazonaws.com/"
|
||||
|
||||
ErrorLog /var/log/apache2/mirror_$port_error.log
|
||||
LogLevel warn
|
||||
CustomLog /var/log/apache2/mirror_$port_access.log combined-cache
|
||||
|
|
|
@ -88,3 +88,40 @@ def test_quay_mirror(host):
|
|||
assert 'quay' in cmd.stdout
|
||||
|
||||
# TODO test RHRegistryMirror
|
||||
|
||||
def test_galaxy_mirror(host):
|
||||
for addr in host.addr(host.backend.host).ipv4_addresses:
|
||||
cmd = host.run(
|
||||
"wget --no-check-certificate -qO- https://%s/galaxy/" % addr)
|
||||
assert 'Ansible Galaxy' in cmd.stdout
|
||||
|
||||
cmd = host.run("wget -qO- http://%s/galaxy/" % addr)
|
||||
assert 'Ansible Galaxy' in cmd.stdout
|
||||
|
||||
cmd = host.run("wget --no-check-certificate -O- "
|
||||
"https://%s/galaxy/download/community-general-4.0.2.tar.gz" %
|
||||
addr)
|
||||
assert '/galaxy-s3/artifact/' in cmd.stderr
|
||||
|
||||
cmd = host.run("wget -O- "
|
||||
"http://%s/galaxy/download/community-general-4.0.2.tar.gz" %
|
||||
addr)
|
||||
assert '/galaxy-s3/artifact/' in cmd.stderr
|
||||
|
||||
for addr in host.addr(host.backend.host).ipv6_addresses:
|
||||
cmd = host.run("wget --no-check-certificate -qO- "
|
||||
"https://[%s]/galaxy/" % addr)
|
||||
assert 'Ansible Galaxy' in cmd.stdout
|
||||
|
||||
cmd = host.run("wget -qO- http://[%s]/galaxy/" % addr)
|
||||
assert 'Ansible Galaxy' in cmd.stdout
|
||||
|
||||
cmd = host.run("wget --no-check-certificate -O- "
|
||||
"https://[%s]/galaxy/download/community-general-4.0.2.tar.gz" %
|
||||
addr)
|
||||
assert '/galaxy-s3/artifact/' in cmd.stderr
|
||||
|
||||
cmd = host.run("wget -O- "
|
||||
"http://[%s]/galaxy/download/community-general-4.0.2.tar.gz" %
|
||||
addr)
|
||||
assert '/galaxy-s3/artifact/' in cmd.stderr
|
||||
|
|
Loading…
Reference in New Issue