ci: extract enabling ipv6 on docker into a script

This commit is contained in:
Pietro Albini 2019-10-08 11:46:55 +02:00
parent bc9a0dc1b3
commit d264e954dc
No known key found for this signature in database
GPG Key ID: 3E06ABE80BAAF19C
2 changed files with 19 additions and 9 deletions

View File

@ -111,15 +111,11 @@ steps:
displayName: Install ninja
condition: and(succeeded(), not(variables.SKIP_JOB))
# Looks like docker containers have IPv6 disabled by default, so let's turn it
# on since libstd tests require it
- bash: |
set -e
sudo mkdir -p /etc/docker
echo '{"ipv6":true,"fixed-cidr-v6":"fd9a:8454:6789:13f7::/64"}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
displayName: Enable IPv6
condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['Agent.OS'], 'Linux'))
- bash: src/ci/scripts/enable-docker-ipv6.sh
env:
AGENT_OS: $(Agent.OS)
displayName: Enable IPv6 on Docker
condition: and(succeeded(), not(variables.SKIP_JOB))
# Disable automatic line ending conversion (again). On Windows, when we're
# installing dependencies, something switches the git configuration directory or

View File

@ -0,0 +1,14 @@
#!/bin/bash
# Looks like docker containers have IPv6 disabled by default, so let's turn it
# on since libstd tests require it
set -euo pipefail
IFS=$'\n\t'
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
if isLinux; then
sudo mkdir -p /etc/docker
echo '{"ipv6":true,"fixed-cidr-v6":"fd9a:8454:6789:13f7::/64"}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
fi