From aacc4e957490d8d28508c7c66b5f9cb6fdc65d40 Mon Sep 17 00:00:00 2001 From: fithwum Date: Tue, 8 Jul 2025 21:14:32 -0700 Subject: [PATCH] dfghdfghfdgh --- .gitea/workflows/base-build.yml | 79 +++++++-------------------------- 1 file changed, 16 insertions(+), 63 deletions(-) diff --git a/.gitea/workflows/base-build.yml b/.gitea/workflows/base-build.yml index 33d5b62..6c7c18a 100644 --- a/.gitea/workflows/base-build.yml +++ b/.gitea/workflows/base-build.yml @@ -30,77 +30,37 @@ jobs: - name: Checkout source uses: actions/checkout@v3 - - name: Debug current directory - run: | - echo "Working dir: $(pwd)" - ls -lah . + - name: Create output directory + run: mkdir -p ./output - - name: Create Docker volume - run: docker volume create build_output - -############################################################################## - - - name: Write file using Docker volume - run: | - docker run --rm \ - -v build_output:/output \ - debian \ - bash -c "echo hello-world > /output/hello.txt" - - - name: Copy file from volume to workspace - run: | - container_id=$(docker create -v build_output:/output debian) - docker cp "$container_id:/output/hello.txt" ./output.txt - docker rm "$container_id" - - - name: Read output.txt - run: | - ls -lh - cat output.txt - -############################################################################## - - - name: Debug mount inside container - run: | - docker run --rm --privileged \ - -v "$(pwd)/output:/output" \ - fithwum/debian-buster-base \ - bash -c "ls -lah /output; touch /output/test_debug && ls -lah /output" - - - name: Clean workspace tarballs before build - run: | - echo "[INFO] Cleaning old tarballs..." - rm -frv ."${{ env.OUTPUT_DIR }}/*/debian-*.tar.bz2" - rm -frv ."${{ env.OUTPUT_DIR }}/*/rootfs-*.tar.bz2" - rm -frv ."${{ env.OUTPUT_DIR }}/sha256sums.txt" - - - name: Build all Debian rootfs versions sequentially + - name: Build all Debian rootfs versions into volumes and extract run: | versions=($VERSIONS) - mkdir -p "${{ env.OUTPUT_DIR }}" - for version in "${versions[@]}"; do echo "[INFO] Building $version..." + volume_name="build_output_$version" + docker volume create "$volume_name" + docker build --build-arg VERSION=$version -t fithwum/debian-$version-base . docker run --rm --privileged \ - -v "$(pwd)/output:/output" \ + -v "$volume_name:/output" \ -e VERSION="$version" \ fithwum/debian-$version-base \ - bash -c "ls -lh /output; ls -lh /; ls -lh /builder; /scripts/bootstrap-rootfs.sh \"$version\"" - done + bash -c "/scripts/bootstrap-rootfs.sh \"$version\"" - - name: Debug check host output files - run: | - echo "[DEBUG] Listing: ${{ env.OUTPUT_DIR }}" - ls -lah "${{ env.OUTPUT_DIR }}" - find "${{ env.OUTPUT_DIR }}" -type f + # Extract the output file from the volume + container_id=$(docker create -v "$volume_name:/output" debian) + mkdir -p ./output/$version + docker cp "$container_id:/output/debian-$version.tar.bz2" ./output/$version/ + docker rm "$container_id" + done - name: Validate that archives exist for each version run: | IFS=' ' read -r -a versions <<< "$VERSIONS" for version in "${versions[@]}"; do - path="${{ env.OUTPUT_DIR }}/$version/debian-$version.tar.bz2" + path="./output/$version/debian-$version.tar.bz2" if [[ ! -f "$path" ]]; then echo "[ERROR] Missing archive: $path" exit 1 @@ -119,13 +79,7 @@ jobs: - name: Copy new archives to upload-repo run: | - found=$(find "${{ env.OUTPUT_DIR }}" -type f -name 'debian-*.tar.bz2') - if [ -z "$found" ]; then - echo "[WARNING] No .tar.bz2 archive found in output/!" - exit 1 - fi - - for filepath in $found; do + for filepath in ./output/*/debian-*.tar.bz2; do version_dir=$(basename "$(dirname "$filepath")") mkdir -p "upload-repo/$version_dir" cp "$filepath" "upload-repo/$version_dir/" @@ -140,7 +94,6 @@ jobs: checksum=$(sha256sum "$tarball" | awk '{print $1}') echo "$checksum $tarball" >> sha256sums.txt done - echo "[INFO] SHA256 contents:" cat sha256sums.txt