This commit is contained in:
@@ -7,12 +7,12 @@ RUN CGO_ENABLED=1 go build --ldflags '-linkmode external -extldflags=-static'
|
|||||||
#RUN go build .
|
#RUN go build .
|
||||||
RUN mkdir -p /usr/src/app/work/
|
RUN mkdir -p /usr/src/app/work/
|
||||||
RUN cp /usr/src/app/rgb/rgb /usr/src/app/work/rgb
|
RUN cp /usr/src/app/rgb/rgb /usr/src/app/work/rgb
|
||||||
RUN cp /usr/src/app/rgb/mario* /usr/src/app/work/
|
#RUN cp /usr/src/app/rgb/mario* /usr/src/app/work/
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|
||||||
COPY --from=builder /usr/src/app/rgb/rgb /usr/src/app/work/
|
COPY --from=builder /usr/src/app/rgb/rgb /usr/src/app/work/
|
||||||
|
COPY --from=builder /usr/src/app/rgb/mari* /usr/src/app/work/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
1
main.go
1
main.go
@@ -80,6 +80,7 @@ func listener(mqMessages chan mqtt.Message) {
|
|||||||
client := MQTT.NewClient(opts)
|
client := MQTT.NewClient(opts)
|
||||||
topic := "home/rgbboard"
|
topic := "home/rgbboard"
|
||||||
if token := client.Connect(); token.Wait() && token.Error() != nil {
|
if token := client.Connect(); token.Wait() && token.Error() != nil {
|
||||||
|
log.Println(fmt.Sprintf("failed to connect to mq: %s", token.Error().Error()))
|
||||||
panic(token.Error())
|
panic(token.Error())
|
||||||
}
|
}
|
||||||
client.Subscribe(topic, 0, func(client mqtt.Client, msg mqtt.Message) {
|
client.Subscribe(topic, 0, func(client mqtt.Client, msg mqtt.Message) {
|
||||||
|
|||||||
Reference in New Issue
Block a user