mirror of
https://github.com/Luzifer/tasmota-build.git
synced 2024-12-22 22:01:18 +00:00
Add ability to build using docker
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
638d74145a
commit
01bae0ef64
2 changed files with 26 additions and 2 deletions
10
Makefile
10
Makefile
|
@ -2,7 +2,10 @@ TASMOTA_VERSION=v5.11.1
|
|||
|
||||
default: build_sonoff build_sonoff-minimal
|
||||
|
||||
ci: clean default
|
||||
chown:
|
||||
chown -R $(UID) build
|
||||
|
||||
ci: full-clean default
|
||||
|
||||
build_%: download update_user-config venv
|
||||
cd tasmota && ../venv/bin/platformio run -e $*
|
||||
|
@ -10,12 +13,15 @@ build_%: download update_user-config venv
|
|||
cp tasmota/.pioenvs/$*/firmware.bin build/$*.bin
|
||||
|
||||
clean:
|
||||
rm -rf tasmota build venv
|
||||
rm -rf tasmota venv
|
||||
|
||||
download:
|
||||
git clone https://github.com/arendst/Sonoff-Tasmota.git tasmota
|
||||
cd tasmota && git reset --hard $(TASMOTA_VERSION)
|
||||
|
||||
full-clean: clean
|
||||
rm -rf build
|
||||
|
||||
update_user-config: venv
|
||||
./venv/bin/python update.py
|
||||
cd tasmota && git --no-pager diff -w sonoff/user_config.h
|
||||
|
|
18
README.md
Normal file
18
README.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Luzifer / tasmota-build
|
||||
|
||||
Inside this repostitory there is a small build environment to automatically configure and build a [Sonoff-Tasmota](https://github.com/arendst/Sonoff-Tasmota) image.
|
||||
|
||||
## Usage
|
||||
|
||||
- Adjust `config.yml` to your needs
|
||||
- `!undef` ensures the parameter is not defined
|
||||
- `!def` ensures the parameter is defined
|
||||
- `${VAR}` reads the contents of the parameter from the environment
|
||||
- Any other string will be inserted into the config
|
||||
- Define a `env` file for everything you are reading from the environment (Format: `VAR=VALUE`, one per line)
|
||||
- Build the firmware
|
||||
```bash
|
||||
# docker run --rm -ti --env-file=env -e UID=$(id -u) -v $(pwd):/src -w /src python:2.7 make default clean chown
|
||||
```
|
||||
|
||||
Pay attention: When defining strings you need to wrap them in double quotes for the compiler to understand them as strings: `PARAM: '"mystring"'`. If you are defining numbers you will define them like this: `PARAM: '1'`. Constants are used like this: `PARAM: CONSTANT`.
|
Loading…
Reference in a new issue