From bf64c091ccd31c3e2c9e5442d0faad418123cc2b Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Mon, 20 Mar 2023 23:50:23 +0100 Subject: [PATCH] docker: Update dockerfiles to build the lldap_set_password tool --- .github/workflows/Dockerfile.ci.alpine | 7 +++++++ .github/workflows/Dockerfile.ci.debian | 7 +++++++ .github/workflows/docker-build-static.yml | 16 ++++++++++++++-- Dockerfile | 7 ++++--- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Dockerfile.ci.alpine b/.github/workflows/Dockerfile.ci.alpine index ef610a6..f57a2f7 100644 --- a/.github/workflows/Dockerfile.ci.alpine +++ b/.github/workflows/Dockerfile.ci.alpine @@ -12,8 +12,10 @@ RUN mkdir -p /lldap/app RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ mv bin/x86_64-unknown-linux-musl-lldap-bin/lldap target/lldap && \ mv bin/x86_64-unknown-linux-musl-migration-tool-bin/migration-tool target/migration-tool && \ + mv bin/x86_64-unknown-linux-musl-lldap_set_password-bin/lldap_set_password target/lldap_set_password && \ chmod +x target/lldap && \ chmod +x target/migration-tool && \ + chmod +x target/lldap_set_password && \ ls -la target/ . && \ pwd \ ; fi @@ -21,8 +23,10 @@ RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ mv bin/aarch64-unknown-linux-musl-lldap-bin/lldap target/lldap && \ mv bin/aarch64-unknown-linux-musl-migration-tool-bin/migration-tool target/migration-tool && \ + mv bin/aarch64-unknown-linux-musl-lldap_set_password-bin/lldap_set_password target/lldap_set_password && \ chmod +x target/lldap && \ chmod +x target/migration-tool && \ + chmod +x target/lldap_set_password && \ ls -la target/ . && \ pwd \ ; fi @@ -30,8 +34,10 @@ RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ RUN if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \ mv bin/armv7-unknown-linux-gnueabihf-lldap-bin/lldap target/lldap && \ mv bin/armv7-unknown-linux-gnueabihf-migration-tool-bin/migration-tool target/migration-tool && \ + mv bin/armv7-unknown-linux-gnueabihf-lldap_set_password-bin/lldap_set_password target/lldap_set_password && \ chmod +x target/lldap && \ chmod +x target/migration-tool && \ + chmod +x target/lldap_set_password && \ ls -la target/ . && \ pwd \ ; fi @@ -42,6 +48,7 @@ COPY lldap_config.docker_template.toml /lldap/ COPY web/index_local.html web/index.html RUN cp target/lldap /lldap/ && \ cp target/migration-tool /lldap/ && \ + cp target/lldap_set_password /lldap/ && \ cp -R web/index.html \ web/pkg \ web/static \ diff --git a/.github/workflows/Dockerfile.ci.debian b/.github/workflows/Dockerfile.ci.debian index 2b74df5..fa274b0 100644 --- a/.github/workflows/Dockerfile.ci.debian +++ b/.github/workflows/Dockerfile.ci.debian @@ -12,8 +12,10 @@ RUN mkdir -p /lldap/app RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ mv bin/x86_64-unknown-linux-musl-lldap-bin/lldap target/lldap && \ mv bin/x86_64-unknown-linux-musl-migration-tool-bin/migration-tool target/migration-tool && \ + mv bin/x86_64-unknown-linux-musl-lldap_set_password-bin/lldap_set_password target/lldap_set_password && \ chmod +x target/lldap && \ chmod +x target/migration-tool && \ + chmod +x target/lldap_set_password && \ ls -la target/ . && \ pwd \ ; fi @@ -21,8 +23,10 @@ RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ mv bin/aarch64-unknown-linux-musl-lldap-bin/lldap target/lldap && \ mv bin/aarch64-unknown-linux-musl-migration-tool-bin/migration-tool target/migration-tool && \ + mv bin/aarch64-unknown-linux-musl-lldap_set_password-bin/lldap_set_password target/lldap_set_password && \ chmod +x target/lldap && \ chmod +x target/migration-tool && \ + chmod +x target/lldap_set_password && \ ls -la target/ . && \ pwd \ ; fi @@ -30,8 +34,10 @@ RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ RUN if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \ mv bin/armv7-unknown-linux-gnueabihf-lldap-bin/lldap target/lldap && \ mv bin/armv7-unknown-linux-gnueabihf-migration-tool-bin/migration-tool target/migration-tool && \ + mv bin/armv7-unknown-linux-gnueabihf-lldap_set_password-bin/lldap_set_password target/lldap_set_password && \ chmod +x target/lldap && \ chmod +x target/migration-tool && \ + chmod +x target/lldap_set_password && \ ls -la target/ . && \ pwd \ ; fi @@ -42,6 +48,7 @@ COPY lldap_config.docker_template.toml /lldap/ COPY web/index_local.html web/index.html RUN cp target/lldap /lldap/ && \ cp target/migration-tool /lldap/ && \ + cp target/lldap_set_password /lldap/ && \ cp -R web/index.html \ web/pkg \ web/static \ diff --git a/.github/workflows/docker-build-static.yml b/.github/workflows/docker-build-static.yml index 735174f..9bd216e 100644 --- a/.github/workflows/docker-build-static.yml +++ b/.github/workflows/docker-build-static.yml @@ -125,8 +125,8 @@ jobs: key: lldap-bin-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} restore-keys: | lldap-bin-${{ matrix.target }}- - - name: Compile ${{ matrix.target }} lldap and migration tool - run: cargo build --target=${{ matrix.target }} --release -p lldap -p migration-tool + - name: Compile ${{ matrix.target }} lldap and tools + run: cargo build --target=${{ matrix.target }} --release -p lldap -p migration-tool -p lldap_set_password - name: Check path run: ls -al target/release - name: Upload ${{ matrix.target}} lldap artifacts @@ -139,6 +139,11 @@ jobs: with: name: ${{ matrix.target }}-migration-tool-bin path: target/${{ matrix.target }}/release/migration-tool + - name: Upload ${{ matrix.target }} password tool artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.target }}-lldap_set_password-bin + path: target/${{ matrix.target }}/release/lldap_set_password lldap-database-integration-test: needs: [build-ui,build-bin] @@ -347,8 +352,12 @@ jobs: mv bin/aarch64-unknown-linux-musl-migration-tool-bin/migration-tool bin/aarch64-migration-tool mv bin/x86_64-unknown-linux-musl-migration-tool-bin/migration-tool bin/amd64-migration-tool mv bin/armv7-unknown-linux-gnueabihf-migration-tool-bin/migration-tool bin/armhf-migration-tool + mv bin/aarch64-unknown-linux-musl-lldap_set_password-bin/lldap_set_password bin/aarch64-lldap_set_password + mv bin/x86_64-unknown-linux-musl-lldap_set_password-bin/lldap_set_password bin/amd64-lldap_set_password + mv bin/armv7-unknown-linux-gnueabihf-lldap_set_password-bin/lldap_set_password bin/armhf-lldap_set_password chmod +x bin/*-lldap chmod +x bin/*-migration-tool + chmod +x bin/*-lldap_set_password - name: Download llap ui artifacts uses: actions/download-artifact@v3 @@ -376,6 +385,9 @@ jobs: mv bin/aarch64-migration-tool aarch64-lldap/migration-tool mv bin/amd64-migration-tool amd64-lldap/migration-tool mv bin/armhf-migration-tool armhf-lldap/migration-tool + mv bin/aarch64-lldap_set_password aarch64-lldap/lldap_set_password + mv bin/amd64-lldap_set_password amd64-lldap/lldap_set_password + mv bin/armhf-lldap_set_password armhf-lldap/lldap_set_password cp -r app aarch64-lldap/ cp -r app amd64-lldap/ cp -r app armhf-lldap/ diff --git a/Dockerfile b/Dockerfile index 4407e30..0a78d3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,11 +31,12 @@ FROM chef AS builder COPY --from=planner /tmp/recipe.json recipe.json RUN cargo chef cook --release -p lldap_app --target wasm32-unknown-unknown \ && cargo chef cook --release -p lldap \ - && cargo chef cook --release -p migration-tool + && cargo chef cook --release -p migration-tool \ + && cargo chef cook --release -p lldap_set_password # Copy the source and build the app and server. COPY --chown=app:app . . -RUN cargo build --release -p lldap -p migration-tool \ +RUN cargo build --release -p lldap -p migration-tool -p lldap_set_password \ # Build the frontend. && ./app/build.sh @@ -77,7 +78,7 @@ WORKDIR /app COPY --from=builder /app/app/index_local.html app/index.html COPY --from=builder /app/app/static app/static COPY --from=builder /app/app/pkg app/pkg -COPY --from=builder /app/target/release/lldap /app/target/release/migration-tool ./ +COPY --from=builder /app/target/release/lldap /app/target/release/migration-tool /app/target/release/lldap_set_password ./ COPY docker-entrypoint.sh lldap_config.docker_template.toml ./ RUN set -x \