Update test_docker.yml

nginx & haproxy tests temp removed
This commit is contained in:
fab 2025-01-17 12:02:39 +01:00 committed by GitHub
parent 4eccf10943
commit ddb39751e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -112,48 +112,48 @@ jobs:
echo "Checking Apache container logs..." echo "Checking Apache container logs..."
sudo docker logs apache-waf sudo docker logs apache-waf
- name: Validate HAProxy configuration # - name: Validate HAProxy configuration
run: | # run: |
echo "Validating HAProxy configuration..." # echo "Validating HAProxy configuration..."
for file in waf_patterns/haproxy/*.acl; do # for file in waf_patterns/haproxy/*.acl; do
echo "Validating $file..." # echo "Validating $file..."
# Create a temporary haproxy.cfg file to include the ACL # # Create a temporary haproxy.cfg file to include the ACL
echo "global" > temp_haproxy.cfg # echo "global" > temp_haproxy.cfg
echo " log stdout format raw local0" >> temp_haproxy.cfg # echo " log stdout format raw local0" >> temp_haproxy.cfg
echo "defaults" >> temp_haproxy.cfg # echo "defaults" >> temp_haproxy.cfg
echo " log global" >> temp_haproxy.cfg # echo " log global" >> temp_haproxy.cfg
echo " timeout connect 10s" >> temp_haproxy.cfg # echo " timeout connect 10s" >> temp_haproxy.cfg
echo " timeout client 30s" >> temp_haproxy.cfg # echo " timeout client 30s" >> temp_haproxy.cfg
echo " timeout server 30s" >> temp_haproxy.cfg # echo " timeout server 30s" >> temp_haproxy.cfg
echo "frontend test" >> temp_haproxy.cfg # echo "frontend test" >> temp_haproxy.cfg
echo " bind *:${{ env.HAPROXY_PORT }}" >> temp_haproxy.cfg # echo " bind *:${{ env.HAPROXY_PORT }}" >> temp_haproxy.cfg
echo " default_backend test_backend" >> temp_haproxy.cfg # echo " default_backend test_backend" >> temp_haproxy.cfg
echo " $(cat "$file")" >> temp_haproxy.cfg # echo " $(cat "$file")" >> temp_haproxy.cfg
echo "backend test_backend" >> temp_haproxy.cfg # echo "backend test_backend" >> temp_haproxy.cfg
echo " server s1 127.0.0.1:${{ env.NGINX_PORT }}" >> temp_haproxy.cfg # echo " server s1 127.0.0.1:${{ env.NGINX_PORT }}" >> temp_haproxy.cfg
#
# # Validate the file using haproxy -c
# sudo docker run --rm -v $(pwd)/temp_haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro haproxy haproxy -c -f /usr/local/etc/haproxy/haproxy.cfg
# if [ $? -ne 0 ]; then
# echo "Error: Validation failed for $file"
# exit 1
# fi
# done
# Validate the file using haproxy -c # - name: Start HAProxy container with WAF rules
sudo docker run --rm -v $(pwd)/temp_haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro haproxy haproxy -c -f /usr/local/etc/haproxy/haproxy.cfg # run: |
if [ $? -ne 0 ]; then # echo "Starting HAProxy container..."
echo "Error: Validation failed for $file" # sudo docker run -d \
exit 1 # --name haproxy-waf \
fi # -p ${{ env.HAPROXY_PORT }}:80 \
done # -v $(pwd)/waf_patterns/haproxy:/usr/local/etc/haproxy \
# haproxy:latest
- name: Start HAProxy container with WAF rules # echo "HAProxy is running on port ${{ env.HAPROXY_PORT }}."
run: | #
echo "Starting HAProxy container..." # - name: Check HAProxy container logs
sudo docker run -d \ # run: |
--name haproxy-waf \ # echo "Checking HAProxy container logs..."
-p ${{ env.HAPROXY_PORT }}:80 \ # sudo docker logs haproxy-waf
-v $(pwd)/waf_patterns/haproxy:/usr/local/etc/haproxy \
haproxy:latest
echo "HAProxy is running on port ${{ env.HAPROXY_PORT }}."
- name: Check HAProxy container logs
run: |
echo "Checking HAProxy container logs..."
sudo docker logs haproxy-waf
- name: Validate Traefik configuration - name: Validate Traefik configuration
run: | run: |