Fix WSL2 issues + cleanup scripts (#2846)

This commit is contained in:
Pascal Vizeli 2021-04-28 14:09:37 +02:00 committed by GitHub
parent cda66ba737
commit f785c4e909
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 44 deletions

View File

@ -41,6 +41,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
docker-ce \ docker-ce \
docker-ce-cli \ docker-ce-cli \
containerd.io \ containerd.io \
&& update-alternatives --set iptables /usr/sbin/iptables-legacy \
&& update-alternatives --set ip6tables /usr/sbin/iptables-legacy \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Install tools # Install tools

16
.vscode/tasks.json vendored
View File

@ -4,7 +4,7 @@
{ {
"label": "Run Supervisor", "label": "Run Supervisor",
"type": "shell", "type": "shell",
"command": "./scripts/run-supervisor.sh", "command": "./scripts/supervisor.sh",
"group": { "group": {
"kind": "test", "kind": "test",
"isDefault": true "isDefault": true
@ -15,20 +15,6 @@
}, },
"problemMatcher": [] "problemMatcher": []
}, },
{
"label": "Build Supervisor",
"type": "shell",
"command": "./scripts/build-supervisor.sh",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{ {
"label": "Run Supervisor CLI", "label": "Run Supervisor CLI",
"type": "shell", "type": "shell",

View File

@ -1,28 +0,0 @@
#!/bin/bash
source "${BASH_SOURCE[0]%/*}/common.sh"
set -eE
DOCKER_TIMEOUT=30
DOCKER_PID=0
function build_supervisor() {
docker pull homeassistant/amd64-builder:dev
docker run --rm \
--privileged \
-v /run/docker.sock:/run/docker.sock \
-v "$(pwd):/data" \
homeassistant/amd64-builder:dev \
--generic latest \
--target /data \
--test \
--amd64 \
--no-cache
}
echo "Build Supervisor"
start_docker
trap "stop_docker" ERR
build_supervisor

View File

@ -1,12 +1,26 @@
#!/bin/bash #!/bin/bash
source "${BASH_SOURCE[0]%/*}/common.sh" source "${BASH_SOURCE[0]%/*}/common.sh"
source "${BASH_SOURCE[0]%/*}/build-supervisor.sh"
set -eE set -eE
DOCKER_TIMEOUT=30 DOCKER_TIMEOUT=30
DOCKER_PID=0 DOCKER_PID=0
function build_supervisor() {
docker pull homeassistant/amd64-builder:dev
docker run --rm \
--privileged \
-v /run/docker.sock:/run/docker.sock \
-v "$(pwd):/data" \
homeassistant/amd64-builder:dev \
--generic latest \
--target /data \
--test \
--amd64 \
--no-cache
}
function cleanup_docker() { function cleanup_docker() {
echo "Cleaning up stopped containers..." echo "Cleaning up stopped containers..."