From 594787f306d6b0cd4570062e3376d08e294dad76 Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Sun, 7 Jul 2024 13:30:12 +0200 Subject: [PATCH] feat(ci): use custom builder image --- .woodpecker/build.yml | 25 +++++++------------------ .woodpecker/lint.yml | 2 +- build.Dockerfile | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 19 deletions(-) create mode 100644 build.Dockerfile diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml index 8ddf4c9..e302f64 100644 --- a/.woodpecker/build.yml +++ b/.woodpecker/build.yml @@ -7,26 +7,15 @@ when: steps: build: - image: 'rust:1.79-alpine3.19' - environment: - - 'LIBARCHIVE_STATIC=1' + image: 'git.rustybever.be/chewing_bever/rieter-builder:1.79-alpine3.19' commands: - # Dependencies required to statically compile libarchive and libsqlite3 - - > - apk add --no-cache build-base - libarchive-static libarchive-dev - zlib-static - openssl-libs-static - bzip2-static - xz-static - expat-static - zstd-static - lz4-static - acl-static - cargo build --verbose # Binaries, even debug ones, should be statically compiled - '[ "$(readelf -d target/debug/rieterd | grep NEEDED | wc -l)" = 0 ]' - # Clippy also performs a full build, so putting it here saves the CI a - # lot of work - - rustup component add clippy + + # Clippy also performs a full build, so putting it here saves the CI a + # lot of work + clippy: + image: 'git.rustybever.be/chewing_bever/rieter-builder:1.79-alpine3.19' + commands: - cargo clippy -- --no-deps -Dwarnings diff --git a/.woodpecker/lint.yml b/.woodpecker/lint.yml index ba3b7ab..4c7debb 100644 --- a/.woodpecker/lint.yml +++ b/.woodpecker/lint.yml @@ -7,7 +7,7 @@ when: steps: lint: - image: 'rust:1.79-alpine3.19' + image: 'git.rustybever.be/chewing_bever/rieter-builder:1.79-alpine3.19' commands: - rustup component add rustfmt - cargo fmt -- --check diff --git a/build.Dockerfile b/build.Dockerfile new file mode 100644 index 0000000..2b607c7 --- /dev/null +++ b/build.Dockerfile @@ -0,0 +1,17 @@ +FROM rust:1.79-alpine3.19 + +# Dependencies required to statically compile libarchive and libsqlite3 +RUN apk add --no-cache \ + libarchive-static libarchive-dev \ + zlib-static \ + openssl-libs-static \ + bzip2-static \ + xz-static \ + expat-static \ + zstd-static \ + lz4-static \ + acl-static && \ + rustup component add clippy rustfmt + +# Tell the libarchive3-sys package to statically link libarchive +ENV LIBARCHIVE_STATIC=1