我正在运行 CI 管道来使用 plaitformio 和 bitbucket 管道为 ESP8266 构建固件,我的代码构建成功,现在我想缓存包含 platformio 库 (.piolibdeps) 的目录。以下是我的 platform.ini 文件的内容。
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
upload_port = 192.168.1.108
lib_deps =
<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e3a6b0b3a2909a8d80b7a0b3a3d2cdd2cdd3" rel="noreferrer noopener nofollow">[email protected]</a>
OneWire
Time
FauxmoESP
Blynk
DallasTemperature
ArduinoJson
Adafruit NeoPixel
如何在 BitBucket 管道中缓存此目录?请查看下面的 bitbucket-pipelines.yml 文件的内容,这样它就不会缓存定义的目录,这里出了什么问题?
image: eclipse/platformio
pipelines:
branches:
develop:
- step:
name: Build Project
caches: # caches the depende
- directories
script: # Modify the commands below to build your repository.
- pio ci --project-conf=./Code/UrbanAquarium.Firmware/platformio.ini ./Code/UrbanAquarium.Firmware/src
- pwd
definitions:
caches:
directories: ./Code/UrbanAquarium.Firmware/.piolibdeps
这是我的文件夹结构。
最佳答案
如果您仍在寻找答案 - 我认为您几乎是正确的,但可能需要指定自定义 --build-dir
(以便您可以指定相同的路径用于您的缓存)以及 --keep-build-dir
(请参阅 https://docs.platformio.org/en/latest/userguide/cmd_ci.html )。另外,我不确定您为什么指定 ./Code/UrbanAquarium.Firmware/
前缀。
也就是说,我已经尝试了上述方法,但它很快就变得丑陋了 - 现在我只缓存 ~/.platformio
以及默认的 pip
缓存:
image: python:2.7.16
pipelines:
default:
- step:
caches:
- pip
- pio
script:
- pip install -U platformio
- platformio update
- platformio ci src/ --project-conf=platformio.ini
definitions:
caches:
pio: ~/.platformio
关于esp8266 - 如何在 bitbucket 管道中缓存整个目录(platformio 依赖项)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47266025/