Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

DSR-1416: Fix to create VERSION file and handle docker build from command line #48

Merged
merged 4 commits into from
Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Changes for release v1.2.2
- Update to use cbor fixed version(0.7.0)
- Generate VERSION file based on the git tag used

Changes for release v1.2.1
- Device service updated to use C SDK (v1.2.2)

Expand All @@ -6,10 +10,8 @@ Changes for Geneva release (v1.2.0)
- Updated the device service to use V2 API

Changes for Fuji release:

- Device service updated to use C SDK (v1.1.0)

Changes for Edinburgh release:

- Device service updated to use C SDK (v1.0.0)
- Added support to read temperature, humidity and pressure from grove Bosch Sensortec BME680
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ MICROSERVICES=build/release/device-grove-c/device-grove-c
DOCKERS=docker_device_grove_c
.PHONY: $(DOCKERS)

VERSION=$(shell cat ./VERSION || echo 0.0.0)
VERSION=$(shell cat ./VERSION)
GIT_SHA=$(shell git rev-parse HEAD)

build: ${MICROSERVICES}
build: ./VERSION ${MICROSERVICES}

build/release/device-grove-c/device-grove-c:
scripts/build.sh
Expand All @@ -21,15 +21,18 @@ test:
clean:
rm -f $(MICROSERVICES)

version:
echo -n ${VERSION}
./VERSION:
@git describe --abbrev=0 > ./VERSION

version: ./VERSION
echo ${VERSION}

docker: $(DOCKERS)

docker_device_grove_c:
docker build \
-f scripts/Dockerfile.alpine-3.9 \
-f scripts/Dockerfile.alpine-3.11 \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/docker-device-grove-c:${GIT_SHA} \
-t edgexfoundry/docker-device-grove-c:${VERSION}-dev \
.
.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ The repository can be found on git at [libmraa](https://github.com/intel-iot-dev
2. Build a docker image by using the following command
```
sh> cd device-grove-c
sh> docker build . -t < device-grove-c > -f ./scripts/Dockerfile.alpine-3.9
sh> make version
sh> docker build . -t device-grove-c -f ./scripts/Dockerfile.alpine-3.11

```
This command shall build the dependencies - libmraa and device-c-sdk library to build device-grove-c release image.
This command shall build the dependencies - libmraa and device-c-sdk library and create the release version of the docker image by the name 'device-grove-c'. This name can be replaced with your preferred name, if necessary.
By default, the configuration and profile file used by the service are available in __'res'__ folder.

## Configuration for docker image
Expand Down
3 changes: 1 addition & 2 deletions scripts/Dockerfile.alpine-3.11
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ RUN apk add --update --no-cache build-base git gcc cmake make linux-headers yaml

COPY scripts /device-grove/scripts
COPY src /device-grove/src/
COPY Makefile /device-grove/Makefile
RUN cd /device-grove && make -s version | tee /device-grove/VERSION && rm -f /device-grove/Makefile
COPY VERSION /device-grove/VERSION
RUN mkdir -p /device-grove/build

WORKDIR /device-grove
Expand Down