Skip to content

Commit 1e327a2

Browse files
committed
Test
1 parent ec816df commit 1e327a2

File tree

3 files changed

+23
-37
lines changed

3 files changed

+23
-37
lines changed

tools/docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ COPY entrypoint.sh $LIBBUILDER_PATH/entrypoint.sh
8383

8484
WORKDIR /opt/esp/lib-builder
8585
ENTRYPOINT [ "/opt/esp/lib-builder/entrypoint.sh" ]
86-
CMD [ "bash" ]
86+
CMD [ "python3", "tools/config_editor/app.py" ]

tools/docker/run.ps1

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
$ARDUINO_DIR = $args[0] -replace '\\', '/'
2+
if (-not $ARDUINO_DIR) {
3+
$ARDUINO_DIR = (Get-Location).Path + '/../'
4+
}
5+
6+
$ARDUINO_DIR = (Get-Item -Path $ARDUINO_DIR).FullName
7+
$DOCKER_ARGS = @()
8+
$DOCKER_ARGS += '-v', "$ARDUINO_DIR:/arduino-esp32"
9+
$DOCKER_ARGS += '-e', 'TERM=xterm-256color'
10+
$DOCKER_ARGS += '-e', "HOST_UID=$env:UID"
11+
12+
if ($env:LIBBUILDER_GIT_SAFE_DIR) {
13+
$DOCKER_ARGS += '-e', "LIBBUILDER_GIT_SAFE_DIR=$env:LIBBUILDER_GIT_SAFE_DIR"
14+
}
15+
16+
Write-Output "Running: docker run $($DOCKER_ARGS -join ' ') lucassvaz/esp32-arduino-lib-builder:latest"
17+
docker run @($DOCKER_ARGS) lucassvaz/esp32-arduino-lib-builder:latest python3 tools/config_editor/app.py

tools/docker/run.sh

+5-36
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,16 @@
11
#!/usr/bin/env bash
22

3-
i=0
4-
NEXT_ARG="false"
5-
ARDUINO_DIR=""
3+
ARDUINO_DIR=${1:-$PWD/../}
64
DOCKER_ARGS=()
7-
ORIGINAL_ARGS=("$@")
8-
TRIMMED_ARGS=()
9-
10-
while [ $i -lt ${#ORIGINAL_ARGS[@]} ]; do
11-
arg=${ORIGINAL_ARGS[$i]}
12-
if [ $arg == "-c" ]; then
13-
NEXT_ARG="true"
14-
elif [ $NEXT_ARG == "true" ]; then
15-
ARDUINO_DIR=$arg
16-
NEXT_ARG="false"
17-
else
18-
TRIMMED_ARGS+=($arg)
19-
fi
20-
i=$((i + 1))
21-
done
22-
23-
if [ -n "$ARDUINO_DIR" ]; then
24-
if [ ! -d "$ARDUINO_DIR" ]; then
25-
echo "Arduino directory \"$ARDUINO_DIR\" does not exist"
26-
exit 1
27-
fi
28-
ARDUINO_DIR=$(echo $(cd $ARDUINO_DIR; pwd))
29-
DOCKER_ARGS+=(-v $ARDUINO_DIR:/arduino-esp32)
30-
TRIMMED_ARGS+=(-c /arduino-esp32)
31-
fi
325

6+
ARDUINO_DIR=$(echo $(cd $ARDUINO_DIR; pwd))
7+
DOCKER_ARGS+=(-v $ARDUINO_DIR:/arduino-esp32)
338
DOCKER_ARGS+=(-e TERM=xterm-256color)
349
DOCKER_ARGS+=(-e HOST_UID=$UID)
3510

3611
if [ -n "$LIBBUILDER_GIT_SAFE_DIR" ]; then
3712
DOCKER_ARGS+=(-e LIBBUILDER_GIT_SAFE_DIR=$LIBBUILDER_GIT_SAFE_DIR)
3813
fi
3914

40-
if [ "$VERBOSE_OUTPUT" -eq 1 ]; then
41-
echo "Arguments:"
42-
echo "DOCKER_ARGS = ${DOCKER_ARGS[@]}"
43-
echo "TRIMMED_ARGS = ${TRIMMED_ARGS[@]}"
44-
echo "Running: docker run ${DOCKER_ARGS[@]} lucassvaz/esp32-arduino-lib-builder ./build.sh ${TRIMMED_ARGS[@]}"
45-
fi
46-
47-
docker run ${DOCKER_ARGS[@]} lucassvaz/esp32-arduino-lib-builder ./build.sh ${TRIMMED_ARGS[@]}
15+
echo "Running: docker run ${DOCKER_ARGS[@]} lucassvaz/esp32-arduino-lib-builder:latest"
16+
docker run ${DOCKER_ARGS[@]} lucassvaz/esp32-arduino-lib-builder:latest python3 tools/config_editor/app.py

0 commit comments

Comments
 (0)