Skip to content

Commit

Permalink
Move Rust version to .rust-version
Browse files Browse the repository at this point in the history
  • Loading branch information
chipp committed Jun 23, 2024
1 parent 7e1fc7f commit 3a8ebde
Show file tree
Hide file tree
Showing 16 changed files with 61 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ jobs:
- name: Build image
run: |
IMAGE_ID=ghcr.io/chipp/${{ matrix.binary }}
RUST_VERSION=$(cat .rust-version)
docker buildx build . --file bin/${{ matrix.binary }}/Dockerfile \
--load \
--progress plain \
--tag $IMAGE_ID:latest \
--build-arg RUST_VERSION="${RUST_VERSION}" \
--build-arg VERSION="0.1.${{ github.run_number }}" \
--label "org.opencontainers.image.source=https://github.com/${{ github.repository }}" \
--cache-from=type=registry,ref=$IMAGE_ID:cache \
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ jobs:
- name: Test
run: |
IMAGE_ID=ghcr.io/chipp/${{ matrix.binary }}
RUST_VERSION=$(cat .rust-version)
docker buildx build . --file bin/${{ matrix.binary }}/test.Dockerfile \
--load \
--tag $IMAGE_ID:latest \
--build-arg RUST_VERSION="${RUST_VERSION}" \
--label "org.opencontainers.image.source=https://github.com/${{ github.repository }}" \
--cache-from=type=registry,ref=$IMAGE_ID:test-cache \
--cache-to=type=registry,ref=$IMAGE_ID:test-cache,mode=max
Expand Down Expand Up @@ -71,10 +73,12 @@ jobs:
- name: Test
run: |
IMAGE_ID=ghcr.io/chipp/isabel
RUST_VERSION=$(cat .rust-version)
TEST_TAG=test-cache-libs-${{ matrix.build_arch }}-${{ matrix.host_arch }}
docker buildx build . --file bin/isabel/test_libs/${{ matrix.host_arch }}.Dockerfile \
--load \
--platform linux/${{ matrix.build_arch }} \
--build-arg RUST_VERSION="${RUST_VERSION}" \
--cache-from=type=registry,ref=$IMAGE_ID:TEST_TAG \
--cache-to=type=registry,ref=$IMAGE_ID:$TEST_TAG,mode=max
1 change: 1 addition & 0 deletions .rust-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.79.0_1
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
RUST_VERSION = $(shell cat .rust-version)

run_alisa: RUST_LOG = alisa=debug,info
run_alisa: JWT_SECRET = 123456
run_alisa: LISA_USER = chipp
Expand All @@ -19,12 +21,15 @@ build_alisa:
docker build . \
--file bin/alisa/Dockerfile \
--tag ${IMAGE_ID}:test \
--build-arg RUST_VERSION="${RUST_VERSION}" \
--load \
--label "org.opencontainers.image.source=https://github.com/chipp/lisa" \
--cache-from=type=registry,ref=${IMAGE_ID}:cache

docker run --rm -v "${PWD}/build:/build" \
${IMAGE_ID}:test \
cp /root/alisa /build/alisa

docker build . \
--file conf/arm64.Dockerfile \
--load \
Expand Down Expand Up @@ -52,12 +57,15 @@ build_elizabeth:
docker build . \
--file bin/elizabeth/Dockerfile \
--tag ${IMAGE_ID}:test \
--build-arg RUST_VERSION="${RUST_VERSION}" \
--load \
--label "org.opencontainers.image.source=https://github.com/chipp/lisa" \
--cache-from=type=registry,ref=${IMAGE_ID}:cache

docker run --rm -v "${PWD}/build:/build" \
${IMAGE_ID}:test \
cp /root/elizabeth /build/elizabeth

docker build . \
--file conf/arm64.Dockerfile \
--load \
Expand All @@ -83,8 +91,10 @@ build_elisa:
docker build . \
--file bin/elisa/Dockerfile \
--tag ${IMAGE_ID}:test \
--build-arg RUST_VERSION="${RUST_VERSION}" \
--load \
--cache-from=type=registry,ref=${IMAGE_ID}:cache

docker run --rm -v "${PWD}/build:/build" \
${IMAGE_ID}:test \
cp /root/elisa /build/elisa
Expand All @@ -103,8 +113,10 @@ build_isabel:
docker build . \
--file bin/isabel/Dockerfile \
--tag ${IMAGE_ID}:test \
--build-arg RUST_VERSION="${RUST_VERSION}" \
--load \
--cache-from=type=registry,ref=${IMAGE_ID}:cache

docker run --rm -v "${PWD}/build:/build" \
${IMAGE_ID}:test \
cp /root/isabel /build/isabel
Expand All @@ -114,13 +126,15 @@ test_isabel_libs_amd64:
docker build . \
--file bin/isabel/test_libs/amd64.Dockerfile \
--tag ${IMAGE_ID}:test_libs_amd64 \
--build-arg RUST_VERSION="${RUST_VERSION}" \
--load

test_isabel_libs_arm64: IMAGE_ID = ghcr.io/chipp/isabel
test_isabel_libs_arm64:
docker build . \
--file bin/isabel/test_libs/arm64.Dockerfile \
--tag ${IMAGE_ID}:test_libs_arm64 \
--build-arg RUST_VERSION="${RUST_VERSION}" \
--load

run_elisheba: RUST_LOG = elisheba=debug,sonoff=debug,info
Expand All @@ -138,8 +152,10 @@ build_elisheba:
docker build . \
--file bin/elisheba/Dockerfile \
--tag ${IMAGE_ID}:test \
--build-arg RUST_VERSION="${RUST_VERSION}" \
--load \
--cache-from=type=registry,ref=${IMAGE_ID}:cache

docker run --rm -v "${PWD}/build:/build" \
${IMAGE_ID}:test \
cp /root/elisheba /build/elisheba
4 changes: 3 additions & 1 deletion bin/alisa/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ghcr.io/chipp/build.rust.arm64_musl:1.79.0_1 AS builder
ARG RUST_VERSION

FROM ghcr.io/chipp/build.rust.arm64_musl:${RUST_VERSION} AS builder

WORKDIR /home/rust/src
RUN USER=rust \
Expand Down
4 changes: 3 additions & 1 deletion bin/alisa/test.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ghcr.io/chipp/build.rust.x86_64_musl:1.79.0_1 AS builder
ARG RUST_VERSION

FROM ghcr.io/chipp/build.rust.x86_64_musl:${RUST_VERSION} AS builder

WORKDIR /home/rust/src
RUN USER=rust \
Expand Down
4 changes: 3 additions & 1 deletion bin/elisa/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ghcr.io/chipp/build.rust.arm64_musl:1.79.0_1 AS builder
ARG RUST_VERSION

FROM ghcr.io/chipp/build.rust.arm64_musl:${RUST_VERSION} AS builder

WORKDIR /home/rust/src
RUN USER=rust \
Expand Down
4 changes: 3 additions & 1 deletion bin/elisa/test.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ghcr.io/chipp/build.rust.x86_64_musl:1.79.0_1 AS builder
ARG RUST_VERSION

FROM ghcr.io/chipp/build.rust.x86_64_musl:${RUST_VERSION} AS builder

WORKDIR /home/rust/src
RUN USER=rust \
Expand Down
4 changes: 3 additions & 1 deletion bin/elisheba/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ghcr.io/chipp/build.rust.arm64_musl:1.79.0_1 AS builder
ARG RUST_VERSION

FROM ghcr.io/chipp/build.rust.arm64_musl:${RUST_VERSION} AS builder

WORKDIR /home/rust/src
RUN USER=rust \
Expand Down
4 changes: 3 additions & 1 deletion bin/elisheba/test.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ghcr.io/chipp/build.rust.x86_64_musl:1.79.0_1 AS builder
ARG RUST_VERSION

FROM ghcr.io/chipp/build.rust.x86_64_musl:${RUST_VERSION} AS builder

WORKDIR /home/rust/src
RUN USER=rust \
Expand Down
4 changes: 3 additions & 1 deletion bin/elizabeth/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ghcr.io/chipp/build.rust.arm64_musl:1.79.0_1 AS builder
ARG RUST_VERSION

FROM ghcr.io/chipp/build.rust.arm64_musl:${RUST_VERSION} AS builder

WORKDIR /home/rust/src
RUN USER=rust \
Expand Down
4 changes: 3 additions & 1 deletion bin/elizabeth/test.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ghcr.io/chipp/build.rust.x86_64_musl:1.79.0_1 AS builder
ARG RUST_VERSION

FROM ghcr.io/chipp/build.rust.x86_64_musl:${RUST_VERSION} AS builder

WORKDIR /home/rust/src
RUN USER=rust \
Expand Down
6 changes: 4 additions & 2 deletions bin/isabel/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM ghcr.io/chipp/build.rust.arm64_musl:1.79.0_1 as libs_builder
ARG RUST_VERSION

FROM ghcr.io/chipp/build.rust.arm64_musl:${RUST_VERSION} AS libs_builder

COPY ./bin/isabel/install_static_libs.sh ./install_static_libs.sh
RUN chmod +x ./install_static_libs.sh && \
./install_static_libs.sh && \
rm ./install_static_libs.sh

FROM ghcr.io/chipp/build.rust.arm64_musl:1.79.0_1 AS builder
FROM ghcr.io/chipp/build.rust.arm64_musl:${RUST_VERSION} AS builder

COPY --from=0 $PREFIX $PREFIX

Expand Down
6 changes: 4 additions & 2 deletions bin/isabel/test.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM ghcr.io/chipp/build.rust.x86_64_musl:1.79.0_1 as libs_builder
ARG RUST_VERSION

FROM ghcr.io/chipp/build.rust.x86_64_musl:${RUST_VERSION} AS libs_builder

COPY ./bin/isabel/install_static_libs.sh ./install_static_libs.sh
RUN chmod +x ./install_static_libs.sh && \
./install_static_libs.sh && \
rm ./install_static_libs.sh

FROM ghcr.io/chipp/build.rust.x86_64_musl:1.79.0_1 AS builder
FROM ghcr.io/chipp/build.rust.x86_64_musl:${RUST_VERSION} AS builder

COPY --from=0 $PREFIX $PREFIX

Expand Down
4 changes: 3 additions & 1 deletion bin/isabel/test_libs/amd64.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ghcr.io/chipp/build.rust.x86_64_musl:1.79.0_1 as libs_builder
ARG RUST_VERSION

FROM ghcr.io/chipp/build.rust.x86_64_musl:${RUST_VERSION}

COPY ./bin/isabel/install_static_libs.sh ./install_static_libs.sh
RUN chmod +x ./install_static_libs.sh && \
Expand Down
4 changes: 3 additions & 1 deletion bin/isabel/test_libs/arm64.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ghcr.io/chipp/build.rust.arm64_musl:1.79.0_1 as libs_builder
ARG RUST_VERSION

FROM ghcr.io/chipp/build.rust.arm64_musl:${RUST_VERSION}

COPY ./bin/isabel/install_static_libs.sh ./install_static_libs.sh
RUN chmod +x ./install_static_libs.sh && \
Expand Down

0 comments on commit 3a8ebde

Please sign in to comment.