Skip to content

Commit

Permalink
fix: Resolved all comments made by Lenny for Makefile and Dockerfile …
Browse files Browse the repository at this point in the history
…and resolved null label issue

Signed-off-by: Marc-philippe Fuller <marc-philippe.fuller@intel.com>
  • Loading branch information
marcpfuller committed Jan 6, 2022
1 parent 07c5e43 commit 02e9154
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

.idea/
vendor/
cmd/device-rfid-llrp-go
cmd/device-rfid-llrp
glide.lock

# snap files
Expand Down
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ARG ALPINE_PKG_EXTRA=""
RUN sed -e 's/dl-cdn[.]alpinelinux.org/nl.alpinelinux.org/g' -i~ /etc/apk/repositories
RUN apk add --no-cache ${ALPINE_PKG_BASE} ${ALPINE_PKG_EXTRA}

WORKDIR $GOPATH/src/github.com/edgexfoundry/device-rfid-llrp-go
WORKDIR /app

COPY . .
RUN [ ! -d "vendor" ] && go mod download all || echo "skipping..."
Expand All @@ -40,11 +40,12 @@ LABEL license='SPDX-License-Identifier: Apache-2.0' \
RUN sed -e 's/dl-cdn[.]alpinelinux.org/nl.alpinelinux.org/g' -i~ /etc/apk/repositories
RUN apk add --update --no-cache zeromq dumb-init

COPY --from=builder /go/src/github.com/edgexfoundry/device-rfid-llrp-go/LICENSE /
COPY --from=builder /go/src/github.com/edgexfoundry/device-rfid-llrp-go/Attribution.txt /
COPY --from=builder /go/src/github.com/edgexfoundry/device-rfid-llrp-go/cmd /
COPY --from=builder /app/LICENSE /
COPY --from=builder /app/Attribution.txt /
COPY --from=builder /app/cmd/device-rfid-llrp /device-rfid-llrp
COPY --from=builder /app/cmd/res/ /

EXPOSE 59989

ENTRYPOINT ["/device-rfid-llrp-go"]
ENTRYPOINT ["/device-rfid-llrp"]
CMD ["-cp=consul.http://edgex-core-consul:8500", "--confdir=/res", "--registry"]
17 changes: 6 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@

GO=CGO_ENABLED=1 GO111MODULE=on go

MICROSERVICES=cmd/device-rfid-llrp-go
MICROSERVICES=cmd/device-rfid-llrp

.PHONY: $(MICROSERVICES)

DOCKERS=docker_device_rfid_llrp_go
.PHONY: $(DOCKERS)

VERSION=$(shell cat ./VERSION 2>/dev/null || echo 0.0.0)

GIT_SHA=$(shell git rev-parse HEAD)
GOFLAGS=-ldflags "-X github.com/edgexfoundry/device-rfid-llrp-go.Version=$(VERSION)"
GOFLAGS=-ldflags "-X github.com/edgexfoundry/device-rfid-llrp.Version=$(VERSION)"

build: $(MICROSERVICES)

tidy:
go mod tidy

cmd/device-rfid-llrp-go:
cmd/device-rfid-llrp:
$(GO) build $(GOFLAGS) -o $@ ./cmd

test:
Expand All @@ -32,15 +29,13 @@ test:
clean:
rm -f $(MICROSERVICES)

docker: $(DOCKERS)

docker_device_rfid_llrp_go:
docker:
docker build \
--build-arg http_proxy \
--build-arg https_proxy \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/docker-device-rfid-llrp-go:$(GIT_SHA) \
-t edgexfoundry/docker-device-rfid-llrp-go:$(VERSION)-dev \
-t edgexfoundry/device-rfid-llrp:$(GIT_SHA) \
-t edgexfoundry/device-rfid-llrp:$(VERSION)-dev \
.

vendor:
Expand Down
3 changes: 2 additions & 1 deletion internal/driver/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,9 @@ func newDiscoveredDevice(info *discoveryInfo) dsModels.DiscoveredDevice {
if VendorIDType(info.vendor) == Impinj {
ipjModelStr := ImpinjModelType(info.model).String()
if !strings.HasPrefix(modelStr, "ImpinjModelType(") {
labels = append(labels, modelStr)
modelStr = ipjModelStr
labels = append(labels, modelStr)

}
}

Expand Down
4 changes: 2 additions & 2 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ parts:
go mod tidy
make build
# copy device-rfid-llrp-go and rename to device-rfid-llrp
install -DT "./cmd/device-rfid-llrp-go" "$SNAPCRAFT_PART_INSTALL/bin/device-rfid-llrp"
# copy device-rfid-llrp
install -DT "./cmd/device-rfid-llrp" "$SNAPCRAFT_PART_INSTALL/bin/device-rfid-llrp"
install -d "$SNAPCRAFT_PART_INSTALL/config/device-rfid-llrp/res/"
install -DT "./cmd/res/configuration.toml" \
Expand Down

0 comments on commit 02e9154

Please sign in to comment.