adding resources
rgb/pipeline/head This commit looks good Details

pull/3/head
Nathan 2 years ago
parent 63dbb2fb4d
commit 7872195d61

@ -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/

@ -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) {

Loading…
Cancel
Save