Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build and deploy scripts initial commit #54

Closed
wants to merge 1 commit into from
Closed
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
19 changes: 19 additions & 0 deletions Dockerfile.ibeji.consumer
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM rust:1.70.0 as builder

WORKDIR /ibeji
COPY . .

RUN apt-get update && apt-get install -y protobuf-compiler

RUN cargo build
#RUN cargo build --release

FROM debian:bullseye

WORKDIR /ibeji/target/debug
COPY --from=builder /ibeji/target/debug/agritechnica-consumer* ./
COPY --from=builder /ibeji/config/agritechnica_consumer_settings.yaml .

EXPOSE 6011

CMD ["./agritechnica-consumer"]
19 changes: 19 additions & 0 deletions Dockerfile.ibeji.dt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM rust:1.70.0 as builder

WORKDIR /ibeji
COPY . .

RUN apt-get update && apt-get install -y protobuf-compiler

RUN cargo build
#RUN cargo build --release

FROM debian:bullseye

WORKDIR /ibeji/target/debug
COPY --from=builder /ibeji/target/debug/agritechnica-digital-twin* ./
COPY --from=builder /ibeji/config/agritechnica_digital_twin_settings.yaml .

EXPOSE 5011

CMD ["./agritechnica-digital-twin"]
19 changes: 19 additions & 0 deletions Dockerfile.ibeji.provider
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM rust:1.70.0 as builder

WORKDIR /ibeji
COPY . .

RUN apt-get update && apt-get install -y protobuf-compiler

RUN cargo build
#RUN cargo build --release

FROM debian:bullseye

WORKDIR /ibeji/target/debug
COPY --from=builder /ibeji/target/debug/agritechnica-provider* ./
COPY --from=builder /ibeji/config/agritechnica_provider_settings.yaml .

EXPOSE 4011

CMD ["./agritechnica-provider"]
14 changes: 14 additions & 0 deletions scripts/build-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

IMAGE_VERSION=0.1.1

cd ..

# Build Ibeji Agritechnica Digital Twin image
docker build -t ibeji-agritechnica-dt:${IMAGE_VERSION} -f Dockerfile.ibeji.dt .

# Build Ibeji Agritechnica Digital Twin Property Provider image
docker build -t ibeji-agritechnica-provider:${IMAGE_VERSION} -f Dockerfile.ibeji.provider .

# Build Ibeji Agritechnica Digital Twin Property Consumer image
docker build -t ibeji-agritechnica-consumer:${IMAGE_VERSION} -f Dockerfile.ibeji.consumer .
17 changes: 17 additions & 0 deletions scripts/push-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

CONTAINER_REGISTRY=agritechacr001
IMAGE_VERSION=0.1.1

# Login to Container Registry
az acr login --name ${CONTAINER_REGISTRY}

# Tag images
docker tag ibeji-agritechnica-dt:${IMAGE_VERSION} ${CONTAINER_REGISTRY}.azurecr.io/ibeji-agritechnica-dt:${IMAGE_VERSION}
docker tag ibeji-agritechnica-provider:${IMAGE_VERSION} ${CONTAINER_REGISTRY}.azurecr.io/ibeji-agritechnica-provider:${IMAGE_VERSION}
docker tag ibeji-agritechnica-consumer:${IMAGE_VERSION} ${CONTAINER_REGISTRY}.azurecr.io/ibeji-agritechnica-consumer:${IMAGE_VERSION}

# Push images
docker push ${CONTAINER_REGISTRY}.azurecr.io/ibeji-agritechnica-dt:${IMAGE_VERSION}
docker push ${CONTAINER_REGISTRY}.azurecr.io/ibeji-agritechnica-provider:${IMAGE_VERSION}
docker push ${CONTAINER_REGISTRY}.azurecr.io/ibeji-agritechnica-consumer:${IMAGE_VERSION}