Skip to content

Commit 299aab4

Browse files
author
Piotr Obrzut
committed
Added support for WSL to the build and test scripts
Change-Id: I794456120aceda375faa60f5325a6bbb13831d08
1 parent 08d05e2 commit 299aab4

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
set -e
1717
source ./VERSION
1818

19+
if grep -q Microsoft /proc/version; then
20+
echo "Running on Windows Subsystem for Linux"
21+
# WSL doesn't have its own docker host, we have to use the one
22+
# from Windows itself.
23+
# https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4
24+
export DOCKER_HOST=localhost:2375
25+
fi
26+
1927
ARCH=amd64; [ -n "$1" ] && ARCH=$1
2028
MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}")
2129

manifest.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
set -e
1717
source ./VERSION
1818

19+
if grep -q Microsoft /proc/version; then
20+
echo "Running on Windows Subsystem for Linux"
21+
# WSL doesn't have its own docker host, we have to use the one
22+
# from Windows itself.
23+
# https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4
24+
export DOCKER_HOST=localhost:2375
25+
fi
26+
1927
REPO=mysql/mysql-server; [ -n "$1" ] && REPO=$1
2028

2129
for MAJOR_VERSION in ${MULTIARCH_VERSIONS}; do

test.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@
2020
set -e
2121
source ./VERSION
2222

23+
if grep -q Microsoft /proc/version; then
24+
echo "Running on Windows Subsystem for Linux"
25+
# WSL doesn't have its own docker host, we have to use the one
26+
# from Windows itself.
27+
# https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4
28+
export DOCKER_HOST=localhost:2375
29+
shopt -s expand_aliases
30+
alias inspec="cmd.exe /c C:/opscode/inspec/bin/inspec"
31+
fi
32+
2333
ARCH=amd64; [ -n "$1" ] && ARCH=$1
2434
MAJOR_VERSIONS=("${!MYSQL_SERVER_VERSIONS[@]}"); [ -n "$2" ] && MAJOR_VERSIONS=("${@:2}")
2535

0 commit comments

Comments
 (0)