Skip to content

Commit

Permalink
Merge branch 'feat/mqttRelayPrototype#SRV-534' of github.com:tago-io/…
Browse files Browse the repository at this point in the history
…microservice-mqtt-bridge into feat/mqttRelayPrototype#SRV-534
  • Loading branch information
vitorfdl committed Jun 6, 2024
2 parents e1b748e + 4a441ef commit a58c036
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Code Quality

on: push

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust toolchain
run: |
rustup update --no-self-update stable
rustup component add --toolchain stable rustfmt
rustup default stable
- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose

- name: Run clippy
run: cargo clippy -- -D warnings

- name: Run fmt check
run: cargo fmt -- --check

25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM rust:slim-bookworm as build
ARG TAGOIO_SOURCE_FOLDER="/tago-io"

RUN apt update
RUN apt install -y protobuf-compiler libssl-dev gcc pkg-config build-essential

RUN mkdir -p ${TAGOIO_SOURCE_FOLDER}
WORKDIR ${TAGOIO_SOURCE_FOLDER}
ADD . ${TAGOIO_SOURCE_FOLDER}

RUN cargo build --release

FROM debian:bookworm-slim
ARG TAGOIO_SOURCE_FOLDER="/tago-io"

RUN apt update
RUN apt install -y build-essential netcat-traditional ca-certificates
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

RUN mkdir -p ${TAGOIO_SOURCE_FOLDER}
WORKDIR ${TAGOIO_SOURCE_FOLDER}
COPY --from=build ${TAGOIO_SOURCE_FOLDER}/target/release/tagoio-mqtt-relay .
COPY --from=build ${TAGOIO_SOURCE_FOLDER}/config.toml config.toml

ENTRYPOINT ["/tago-io/tagoio-mqtt-relay"]

0 comments on commit a58c036

Please sign in to comment.