From e1c576e5b66c21f5046ec23ba32293b0e077324d Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 14 Oct 2024 22:22:56 +0200 Subject: [PATCH 1/5] Start to build drone file --- .drone.yml | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..20feea3 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,63 @@ +--- +kind: pipeline +type: docker +name: default + +steps: + - name: web_build + image: node:21 + volumes: + - name: web_app + path: /tmp/web_build + commands: + - cd central_frontend + - npm install + - npm run build + - mv dist /tmp/web_build + + - name: backend_check + image: rust + volumes: + - name: rust_registry + path: /usr/local/cargo/registry + commands: + - rustup component add clippy + - cd central_backend + - cargo clippy -- -D warnings + - cargo test + + - name: custom_consumption_check + image: rust + volumes: + - name: rust_registry + path: /usr/local/cargo/registry + commands: + - rustup component add clippy + - cd custom_consumption + - cargo clippy -- -D warnings + - cargo test + depends_on: + - backend_check + + - name: backend_compile + image: rust + volumes: + - name: rust_registry + path: /usr/local/cargo/registry + - name: web_app + path: /tmp/web_build + depends_on: + - backend_check + - web_build + commands: + - cd central_backend + - mv /tmp/web_build/dist static + - cargo build --release + - ls -lah target/release/central_backend + + +volumes: + - name: rust_registry + temp: {} + - name: web_app + temp: {} \ No newline at end of file -- 2.45.2 From 2a7f560fbbef76ddcb71e4c6f410ade5b9e6decd Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 14 Oct 2024 22:28:13 +0200 Subject: [PATCH 2/5] Attempt to add ESP32 build to CI --- .drone.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.drone.yml b/.drone.yml index 20feea3..44a8347 100644 --- a/.drone.yml +++ b/.drone.yml @@ -55,6 +55,12 @@ steps: - cargo build --release - ls -lah target/release/central_backend + - name: esp32_compile + image: espressif/idf:v5.2.2 # FIXME : upgrade to 5.3.1 + commands: + - cd esp32_device + - idf.py build + volumes: - name: rust_registry -- 2.45.2 From d423024386b657404b5c10381f4dc74307e92035 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 14 Oct 2024 22:34:13 +0200 Subject: [PATCH 3/5] Attempt to add ESP32 build to CI --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 44a8347..b741ddf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -59,7 +59,7 @@ steps: image: espressif/idf:v5.2.2 # FIXME : upgrade to 5.3.1 commands: - cd esp32_device - - idf.py build + - /opt/esp/entrypoint.sh idf.py build volumes: -- 2.45.2 From d8f851e7aa1803a0c89bfe7be8d52ee3cd4c6f97 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 14 Oct 2024 22:35:17 +0200 Subject: [PATCH 4/5] Update --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index b741ddf..b1f0cee 100644 --- a/.drone.yml +++ b/.drone.yml @@ -60,6 +60,7 @@ steps: commands: - cd esp32_device - /opt/esp/entrypoint.sh idf.py build + - file build/main.bin volumes: -- 2.45.2 From 3e41404ee64dd6a17fa618a8fc8d24b08e70cffe Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 14 Oct 2024 22:38:19 +0200 Subject: [PATCH 5/5] Fix command --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index b1f0cee..149b1f4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -60,7 +60,7 @@ steps: commands: - cd esp32_device - /opt/esp/entrypoint.sh idf.py build - - file build/main.bin + - ls -lah build/main.bin volumes: -- 2.45.2