File tree Expand file tree Collapse file tree 6 files changed +43
-7
lines changed Expand file tree Collapse file tree 6 files changed +43
-7
lines changed Original file line number Diff line number Diff line change 11FROM golang:1.24.2 AS go
22
3- ARG BINARY_NAME="arduino-app-cli"
3+ ARG BINARY_NAME
4+ RUN test -n "${BINARY_NAME}" || (echo "Error: BINARY_NAME is not set" && exit 1)
45
56COPY . /app
67WORKDIR /app
7- RUN GOOS=linux go build -o ${BINARY_NAME} ./cmd/arduino-app-cli/
8+ RUN GOOS=linux go build -o ${BINARY_NAME} ./cmd/${BINARY_NAME}
89
910FROM debian:bookworm AS debian
1011
1112ARG VERSION="1.0.0"
1213ARG REVISION="1"
14+ ARG DEB_NAME
15+ RUN test -n "${DEB_NAME}" || (echo "Error: DEB_NAME is not set" && exit 1)
16+ ARG BINARY_NAME
17+ RUN test -n "${BINARY_NAME}" || (echo "Error: BINARY_NAME is not set" && exit 1)
1318
1419RUN apt-get update && apt-get install -y sed
1520
16- COPY ./debian/orchestrator /orchestrator /
17- COPY --from=go /app/${BINARY_NAME} /orchestrator /usr/bin/${BINARY_NAME}
21+ COPY ./debian/${DEB_NAME} /${DEB_NAME} /
22+ COPY --from=go /app/${BINARY_NAME} /${DEB_NAME} /usr/bin/${BINARY_NAME}
1823
19- RUN sed -i "s/ARCH/$(dpkg --print-architecture)/" /orchestrator /DEBIAN/control && \
20- dpkg-deb --build --root-owner-group /orchestrator &&\
21- mv /orchestrator .deb "/orchestrator_ ${VERSION}-${REVISION}_$(dpkg --print-architecture).deb"
24+ RUN sed -i "s/ARCH/$(dpkg --print-architecture)/" /${DEB_NAME} /DEBIAN/control && \
25+ dpkg-deb --build --root-owner-group /${DEB_NAME} &&\
26+ mv /${DEB_NAME} .deb "/${DEB_NAME}_ ${VERSION}-${REVISION}_$(dpkg --print-architecture).deb"
2227
2328FROM scratch
2429
Original file line number Diff line number Diff line change 1+ Package: arduino-router
2+ Version: 1.0
3+ Architecture: ARCH
4+ Maintainer: arduino <support@arduino.cc>
5+ Description: Arduino application router
6+ Depends:
7+
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ systemctl daemon-reload
4+ systemctl enable arduino-router
5+ systemctl start arduino-router
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ systemctl daemon-reload
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ systemctl disable arduino-router
4+ systemctl stop arduino-router
Original file line number Diff line number Diff line change 1+ [Unit]
2+ Description =Arduino Router Service
3+
4+ [Service]
5+ ExecStart =/usr/bin/router --listen-port :8900 --serial-port /dev/ttyACM0
6+ StandardOutput =journal
7+ StandardError =journal
8+ Restart =always
9+ RestartSec =3
10+
11+ [Install]
12+ WantedBy =multi-user.target
You can’t perform that action at this time.
0 commit comments