Skip to content

Commit 46f1b2c

Browse files
authored
Merge pull request #161 from sensebox/fix/cache
Fix Cache
2 parents 0211764 + 3451ff8 commit 46f1b2c

3 files changed

Lines changed: 17 additions & 16 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ RUN cp /tmp/OTAFiles/boards.txt /root/.arduino15/packages/esp32/hardware/esp32/$
4545
cp /tmp/OTAFiles/APOTA.bin /root/.arduino15/packages/esp32/hardware/esp32/${ESP32_VERSION}/variants/sensebox_mcu_esp32s2/ && \
4646
cp /tmp/OTAFiles/variant.cpp /root/.arduino15/packages/esp32/hardware/esp32/${ESP32_VERSION}/variants/sensebox_mcu_esp32s2/
4747

48+
RUN rm -rf /tmp/OTAFiles
4849

4950
# install Libraries with arduino-cli
5051
RUN arduino-cli lib install "Ethernet"

docker-compose.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
version: "2"
2-
31
services:
42
compiler:
5-
image: sensebox/sensebox-sketches
3+
image: ghcr.io/sensebox/sensebox-sketches:main
64
ports:
75
- 3000:3000
86
networks:
97
- compiler-network
108
volumes:
11-
- build-cache:/app/src/build-cache
9+
- build-cache:/root/.cache/arduino
1210
- sketch-cache:/tmp
1311

12+
1413
cleanup:
15-
image: alpine:latest
16-
command: |
17-
/bin/sh -c "
18-
set -e
19-
IFS=$$'\n\t'
20-
eval exec find /tmp/* -type d -maxdepth 0 -mmin +60 | xargs rm -rf
21-
"
14+
image: mcuadros/ofelia:latest
15+
command: daemon --docker
2216
volumes:
17+
- /var/run/docker.sock:/var/run/docker.sock:ro
2318
- sketch-cache:/tmp
19+
labels:
20+
ofelia.job-local.cleanup.schedule: "@daily"
21+
ofelia.job-local.cleanup.command: |
22+
/bin/sh -c "
23+
set -e
24+
IFS=$$'\n\t'
25+
eval exec find /tmp/* -type d -maxdepth 0 -mmin +60 | xargs rm -rf
26+
"
2427
2528
networks:
2629
compiler-network:
2730

2831
volumes:
2932
build-cache:
30-
sketch-cache:
33+
sketch-cache:

src/builder.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ export const boardBinaryFileextensions = {
1919
"sensebox-esp32s2": "bin",
2020
};
2121

22-
const baseArgs = ["--build-cache-path", `/app/src/build-cache`];
23-
2422
export const payloadValidator = function payloadValidator(req, res, next) {
2523
// reject all non application/json requests
2624
if (
@@ -85,10 +83,9 @@ const execBuilder = async function execBuilder({ board, sketch, buildDir }) {
8583

8684
await spawn(`arduino-cli`, [
8785
"compile",
88-
...baseArgs,
8986
"--fqbn",
9087
boardFQBNs[board],
91-
"--build-path",
88+
"--output-dir",
9289
buildDir,
9390
sketchDir,
9491
]);

0 commit comments

Comments
 (0)