docker-Tasmota-platformio-e.../README.md
Lukas Endigo 3a1224ff29
Some checks are pending
Tasmota Docker test / build (ubuntu-20.04, 3.10) (push) Waiting to run
Tasmota Docker test / build (ubuntu-20.04, 3.11) (push) Waiting to run
Tasmota Docker test / build (ubuntu-22.04, 3.10) (push) Waiting to run
Tasmota Docker test / build (ubuntu-22.04, 3.11) (push) Waiting to run
Publish Docker / build (push) Waiting to run
first commit
2024-10-29 09:28:22 +05:00

186 lines
10 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Docker-Tasmota
Быстрая настройка среды для сборки [Tasmota](https://github.com/arendst/Tasmota) с использованием Docker.
## le_compile.sh и compile.sh
Этот скрипт на bash облегчает процесс компиляции, избавляя от необходимости вводить длинные команды каждый раз.
le_compile.sh и compile.sh предназначен для запуска на Linux-системе с установленными Docker и Git. Если каких-то из них не хватает, скрипт выдаст предупреждение с инструкциями по установке.
При первом запуске скрипт загрузит последний контейнер blakadder/docker-tasmota (можно изменить скрипт для использования собственного контейнера), клонирует последнюю ветку разработки Tasmota (для клонирования последней стабильной версии установите `USE_STABLE=1` *?(работает только когда используете скрипт compile.sh) ) и скопирует файлы platformio_override.ini и user_config_override.h в папку Tasmota.
Запуск скрипта с указанием одного или нескольких имен сборок (как указано в platformio_tasmota_env.ini) в качестве параметров скомпилирует только эти сборки, независимо от платформы, указанной в platformio.ini или platformio_override.ini.
Новый вариант скрипта:
`./le_compile.sh -stable=1 -tasmota=v14.2.0 -bins=tasmota-ir`
компилирует tasmota-sensors.bin и португальскую версию Tasmota:
`./compile.sh tasmota-sensors tasmota-PT`
Если у вас есть файлы `user_config_override.h` или `platformio_override.ini` с пользовательскими настройками, поместите их в папку скрипта, и они будут использованы при следующем запуске.
Скрипт будет обновлять папку репозитория до актуальной версии при каждом запуске.
Чтобы проверить логи компиляции, используйте `tail -f docker-tasmota.log` или `cat docker-tasmota.log`.
## Вариант 1: Настройка готового Docker-контейнера с использованием le_compile.sh
1. Клонируйте этот репозиторий и перейдите в каталог, где он был клонирован (оригинальая версия: https://github.com/tasmota/docker-tasmota):
```
git clone https://mygit.lkaz.ru/lukas91/docker-Tasmota-platformio-esp8266-esp32
cd docker-tasmota
```
2. Обновите файлы `user_config_override.h` и/или `platformio_override.ini` с вашими настройками сборки.
3. Запустите le_compile.sh с нужным именем сборки, например:
```
./le_compile.sh -bins=tasmota
```
или
```
./compile.sh tasmota
```
При необходимости скрипт `le_compile.sh` установит контейнер и репозиторий Tasmota, если вы введете «yes», когда будет предложено.
5. По завершении компиляции скомпилированные бинарные файлы и архивы будут находиться в `Tasmota/build_output/firmware`, и их можно будет прошить на устройства.
Примечание: Чтобы обновить ранее установленный образ Docker с помощью скрипта `compile.sh`, выполните:
```
docker pull blakadder/docker-tasmota
```
## Вариант 2: Настройка Docker-контейнера с нуля
1. Клонируйте этот репозиторий и перейдите в каталог, где он был клонирован (оригинальая версия: https://github.com/tasmota/docker-tasmota):
```
git clone https://mygit.lkaz.ru/lukas91/docker-Tasmota-platformio-esp8266-esp32
cd docker-tasmota
```
2. Запустите следующую команду для сборки Docker-контейнера:
`docker build -t docker-tasmota .`
3. Перейдите в директорию, куда вы хотите клонировать репозиторий Tasmota:
```
git clone https://github.com/arendst/Tasmota.git
```
Если у вас есть файлы `user_config_override.h` или `platformio_override.ini` с пользовательскими настройками, поместите их в папку `Tasmota/tasmota`.
4. Из той же директории выполните команду для компиляции нужной сборки:
`docker run -ti --rm -v $(pwd)/Tasmota:/tasmota -u $UID:$GID docker-tasmota -e tasmota-PT`
> `-e <buildname>`, где <buildname> может быть любой из [сборок, указанных в platformio.ini](https://github.com/arendst/Tasmota/blob/063611314777d4dd9dc8c25905f19f8b25f510aa/platformio.ini#L18). Если сборка не указана, будет скомпилирована ***каждая***.
5. По завершении компиляции скомпилированные бинарные файлы и архивы будут находиться в `Tasmota/build_output/firmware` для прошивки на устройства.
## Переход на ветку, отличную от development
`cd Tasmota`
Просмотрите доступные ветки с помощью `git branch -a`.
Перейдите на ветку release с командой:
`git checkout release`
Соберите и запустите:
```docker
docker run -ti --rm \
-v $(pwd)/Tasmota:/tasmota \
-u $UID:$GID docker-tasmota
```
# ENG:
# Docker-Tasmota
Quick setup for building [Tasmota](https://github.com/arendst/Tasmota) using Docker.
## le_compile.sh and compile.sh
This bash script simplifies the compilation process, avoiding the need to type long commands every time.
le_compile.sh and compile.sh are designed to run on a Linux system with Docker and Git installed. If any are missing, the script will show a warning with installation instructions.
When run for the first time, the script will pull the latest blakadder/docker-tasmota container (you can modify the script to use your own container), clone the latest Tasmota development branch (for cloning the latest stable version, set `USE_STABLE=1` *?(only works when using the compile.sh script) ), and copy the platformio_override.ini and user_config_override.h files into the Tasmota folder.
Running the script with one or more build names (as listed in platformio_tasmota_env.ini) as parameters will compile only those builds, regardless of platformio.ini or platformio_override.ini.
New script variant:
`./le_compile.sh -stable=1 -tasmota=v14.2.0 -bins=tasmota-ir`
compiles the tasmota-sensors.bin and Portuguese version of Tasmota:
`./compile.sh tasmota-sensors tasmota-PT`
If you have `user_config_override.h` or `platformio_override.ini` files with custom settings, place them in the script folder, and they will be used on the next run.
The script will update the repository folder with the latest version every time it runs.
To check compilation logs, use `tail -f docker-tasmota.log` or `cat docker-tasmota.log`.
## Option 1: Setup the prebuilt Docker container using le_compile.sh
1. Clone this repository and go to the directory where it was cloned (original version: https://github.com/tasmota/docker-tasmota):
```
git clone https://mygit.lkaz.ru/lukas91/docker-Tasmota-platformio-esp8266-esp32
cd docker-tasmota
```
2. Update the `user_config_override.h` and/or `platformio_override.ini` files with your custom build settings.
3. Run le_compile.sh with the desired build name, for example:
```
./le_compile.sh -bins=tasmota
```
or
```
./compile.sh tasmota
```
If necessary, the `le_compile.sh` script will install the container and Tasmota repository if you type "yes" when prompted.
5. When compilation finishes, the compiled binaries and gzipped files will be in `Tasmota/build_output/firmware` and can be flashed to your devices.
Note: To update a previously installed Docker image with the `compile.sh` script, run:
```
docker pull blakadder/docker-tasmota
```
## Option 2: Setting up a Docker container from scratch
1. Clone this repository and go to the directory where it was cloned (original version: https://github.com/tasmota/docker-tasmota):
```
git clone https://mygit.lkaz.ru/lukas91/docker-Tasmota-platformio-esp8266-esp32
cd docker-tasmota
```
2. Run the following command to build the Docker container:
`docker build -t docker-tasmota .`
3. Go to the directory where you want to clone the Tasmota repository:
```
git clone https://github.com/arendst/Tasmota.git
```
If you have `user_config_override.h` or `platformio_override.ini` files with custom settings, place them under `Tasmota/tasmota`.
4. From the same directory, run the command to compile the desired build:
`docker run -ti --rm -v $(pwd)/Tasmota:/tasmota -u $UID:$GID docker-tasmota -e tasmota-PT`
> `-e <buildname>`, where <buildname> can be any of the [builds listed in platformio.ini](https://github.com/arendst/Tasmota/blob/063611314777d4dd9dc8c25905f19f8b25f510aa/platformio.ini#L18). If no build is specified, ***every*** build will be compiled.
5. When compilation finishes, the compiled binaries and gzipped files will be in `Tasmota/build_output/firmware` for flashing to devices.
## Switching to a branch other than development
`cd Tasmota`
View available branches with `git branch -a`.
Switch to the release branch with:
`git checkout release`
Build it and run:
```docker
docker run -ti --rm \
-v $(pwd)/Tasmota:/tasmota \
-u $UID:$GID docker-tasmota
```