mirror of
https://github.com/jc21/nginx-proxy-manager.git
synced 2024-08-30 18:22:48 +00:00
Fix flakey CI due to full stack network determination
This commit is contained in:
parent
bed387ebd4
commit
d3a654b546
@ -20,6 +20,8 @@ services:
|
|||||||
MYSQL_PASSWORD: 'npmpass'
|
MYSQL_PASSWORD: 'npmpass'
|
||||||
volumes:
|
volumes:
|
||||||
- mysql_vol:/var/lib/mysql
|
- mysql_vol:/var/lib/mysql
|
||||||
|
networks:
|
||||||
|
- fulltest
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mysql_vol:
|
mysql_vol:
|
||||||
|
@ -20,7 +20,7 @@ services:
|
|||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
networks:
|
networks:
|
||||||
default:
|
fulltest:
|
||||||
aliases:
|
aliases:
|
||||||
- website1.example.com
|
- website1.example.com
|
||||||
- website2.example.com
|
- website2.example.com
|
||||||
@ -32,7 +32,7 @@ services:
|
|||||||
- './dev/resolv.conf:/etc/resolv.conf:ro'
|
- './dev/resolv.conf:/etc/resolv.conf:ro'
|
||||||
- '/etc/localtime:/etc/localtime:ro'
|
- '/etc/localtime:/etc/localtime:ro'
|
||||||
networks:
|
networks:
|
||||||
default:
|
fulltest:
|
||||||
aliases:
|
aliases:
|
||||||
- ca.internal
|
- ca.internal
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- pdns-db
|
- pdns-db
|
||||||
networks:
|
networks:
|
||||||
default:
|
fulltest:
|
||||||
aliases:
|
aliases:
|
||||||
- ns1.pdns
|
- ns1.pdns
|
||||||
- ns2.pdns
|
- ns2.pdns
|
||||||
@ -75,11 +75,15 @@ services:
|
|||||||
- 'pdns_mysql_vol:/var/lib/mysql'
|
- 'pdns_mysql_vol:/var/lib/mysql'
|
||||||
- '/etc/localtime:/etc/localtime:ro'
|
- '/etc/localtime:/etc/localtime:ro'
|
||||||
- './dev/pdns-db.sql:/docker-entrypoint-initdb.d/01_init.sql:ro'
|
- './dev/pdns-db.sql:/docker-entrypoint-initdb.d/01_init.sql:ro'
|
||||||
|
networks:
|
||||||
|
- fulltest
|
||||||
|
|
||||||
dnsrouter:
|
dnsrouter:
|
||||||
image: jc21/dnsrouter
|
image: jc21/dnsrouter
|
||||||
volumes:
|
volumes:
|
||||||
- ./dev/dnsrouter-config.json.tmp:/dnsrouter-config.json:ro
|
- ./dev/dnsrouter-config.json.tmp:/dnsrouter-config.json:ro
|
||||||
|
networks:
|
||||||
|
- fulltest
|
||||||
|
|
||||||
cypress:
|
cypress:
|
||||||
image: "${IMAGE}-cypress:ci-${BUILD_NUMBER}"
|
image: "${IMAGE}-cypress:ci-${BUILD_NUMBER}"
|
||||||
@ -92,9 +96,15 @@ services:
|
|||||||
- 'cypress_logs:/results'
|
- 'cypress_logs:/results'
|
||||||
- './dev/resolv.conf:/etc/resolv.conf:ro'
|
- './dev/resolv.conf:/etc/resolv.conf:ro'
|
||||||
command: cypress run --browser chrome --config-file=cypress/config/ci.js
|
command: cypress run --browser chrome --config-file=cypress/config/ci.js
|
||||||
|
networks:
|
||||||
|
- fulltest
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
cypress_logs:
|
cypress_logs:
|
||||||
npm_data_ci:
|
npm_data_ci:
|
||||||
npm_le_ci:
|
npm_le_ci:
|
||||||
pdns_mysql_vol:
|
pdns_mysql_vol:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
fulltest:
|
||||||
|
name: "npm-${BRANCH_LOWER}-ci-${BUILD_NUMBER}"
|
||||||
|
@ -18,6 +18,7 @@ fi
|
|||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
BLUE='\E[1;34m'
|
BLUE='\E[1;34m'
|
||||||
|
RED='\E[1;31m'
|
||||||
CYAN='\E[1;36m'
|
CYAN='\E[1;36m'
|
||||||
GREEN='\E[1;32m'
|
GREEN='\E[1;32m'
|
||||||
RESET='\E[0m'
|
RESET='\E[0m'
|
||||||
@ -26,8 +27,7 @@ YELLOW='\E[1;33m'
|
|||||||
export BLUE CYAN GREEN RESET YELLOW
|
export BLUE CYAN GREEN RESET YELLOW
|
||||||
|
|
||||||
echo -e "${BLUE}❯ ${CYAN}Starting fullstack cypress testing ...${RESET}"
|
echo -e "${BLUE}❯ ${CYAN}Starting fullstack cypress testing ...${RESET}"
|
||||||
|
echo -e "${BLUE}❯ $(docker-compose config)${RESET}"
|
||||||
NETWORK_NAME="${COMPOSE_PROJECT_NAME}_default"
|
|
||||||
|
|
||||||
# $1: container_name
|
# $1: container_name
|
||||||
get_container_ip () {
|
get_container_ip () {
|
||||||
@ -35,17 +35,7 @@ get_container_ip () {
|
|||||||
local container
|
local container
|
||||||
local ip
|
local ip
|
||||||
container=$(docker-compose ps --all -q "${container_name}" | tail -n1)
|
container=$(docker-compose ps --all -q "${container_name}" | tail -n1)
|
||||||
ip=$(docker inspect -f "{{.NetworkSettings.Networks.${NETWORK_NAME}.IPAddress}}" "$container")
|
ip=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$container")
|
||||||
echo "$ip"
|
|
||||||
}
|
|
||||||
|
|
||||||
# $1: container_name
|
|
||||||
get_container_aliases () {
|
|
||||||
local container_name=$1
|
|
||||||
local container
|
|
||||||
local ip
|
|
||||||
container=$(docker-compose ps --all -q "${container_name}" | tail -n1)
|
|
||||||
ip=$(docker inspect -f "{{.NetworkSettings.Networks.${NETWORK_NAME}.Aliases}}" "$container")
|
|
||||||
echo "$ip"
|
echo "$ip"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,6 +54,11 @@ docker-compose up -d dnsrouter
|
|||||||
DNSROUTER_IP=$(get_container_ip "dnsrouter")
|
DNSROUTER_IP=$(get_container_ip "dnsrouter")
|
||||||
echo -e "${BLUE}❯ ${YELLOW}DNS Router IP is ${DNSROUTER_IP}"
|
echo -e "${BLUE}❯ ${YELLOW}DNS Router IP is ${DNSROUTER_IP}"
|
||||||
|
|
||||||
|
if [ "${DNSROUTER_IP:-}" = "" ]; then
|
||||||
|
echo -e "${RED}❯ ERROR: DNS Router IP is not set${RESET}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# mount the resolver
|
# mount the resolver
|
||||||
LOCAL_RESOLVE="$DIR/../../docker/dev/resolv.conf"
|
LOCAL_RESOLVE="$DIR/../../docker/dev/resolv.conf"
|
||||||
rm -rf "${LOCAL_RESOLVE}"
|
rm -rf "${LOCAL_RESOLVE}"
|
||||||
|
Loading…
Reference in New Issue
Block a user