diff --git a/.github/workflows/on-tag-only.yml b/.github/workflows/on-tag-only.yml index e80a1f0..a5005ec 100644 --- a/.github/workflows/on-tag-only.yml +++ b/.github/workflows/on-tag-only.yml @@ -5,24 +5,64 @@ on: jobs: build: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + - name: Run Apt-get update run: sudo apt-get update - - name: Install Dependencies + + - name: Install dependencies run: sudo apt-get -y install quilt qemu-user-static debootstrap bsdtar - - name: Run Build script + + - name: Nuke current Docker installation + run: | + sudo systemctl stop docker + sudo apt-get purge docker-ce docker-ce-cli containerd.io moby-engine moby-cli + sudo rm -rf /var/lib/docker + + - name: Re-install Docker + run: | + curl -fsSL https://get.docker.com -o get-docker.sh + sudo sh get-docker.sh + docker --version + + - name: Enable experimental features in Docker + run: | + sudo rm -rf /etc/docker/daemon.json + echo '{"experimental": true}' | sudo tee -a /etc/docker/daemon.json + sudo systemctl restart docker + + - name: Run build script run: sudo ./build.sh + - name: Copy ZIP to current working dir run: cp deploy/*.zip ./ + - name: Debug current working dir run: ls -la - - name: Release Image to placeholder or release - uses: meeDamian/github-release@v1.0.0 - if: startsWith(github.ref, 'refs/tags/') + + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Upload image + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - gzip: false - files: "*.zip" - token: ${{ secrets.GITHUB_TOKEN }} - allow_override: true + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./umbr3l-lite.zip + asset_name: umbr3l-lite.zip + asset_content_type: application/gzip diff --git a/build.sh b/build.sh index a906e10..47682ef 100755 --- a/build.sh +++ b/build.sh @@ -154,7 +154,7 @@ fi export USE_QEMU="${USE_QEMU:-0}" export IMG_DATE="${IMG_DATE:-"$(date +%Y-%m-%d)"}" export IMG_FILENAME="${IMG_FILENAME:-"${IMG_DATE}-${IMG_NAME}"}" -export ZIP_FILENAME="${ZIP_FILENAME:-"image_${IMG_DATE}-${IMG_NAME}"}" +export ZIP_FILENAME="${ZIP_FILENAME:-"${IMG_NAME}"}" export SCRIPT_DIR="${BASE_DIR}/scripts" export WORK_DIR="${WORK_DIR:-"${BASE_DIR}/work/${IMG_DATE}-${IMG_NAME}"}" diff --git a/depends b/depends index a86bc82..fd4cde7 100644 --- a/depends +++ b/depends @@ -16,4 +16,4 @@ xxd file git lsmod:kmod -bc +bc \ No newline at end of file diff --git a/stage0/00-configure-apt/00-run.sh b/stage0/00-configure-apt/00-run.sh index 9d21ffb..f978814 100755 --- a/stage0/00-configure-apt/00-run.sh +++ b/stage0/00-configure-apt/00-run.sh @@ -14,4 +14,4 @@ on_chroot apt-key add - < files/raspberrypi.gpg.key on_chroot << EOF apt-get update apt-get dist-upgrade -y -EOF +EOF \ No newline at end of file diff --git a/stage2/05-docker-compose/01-run.sh b/stage2/05-docker-compose/01-run.sh index 0e6b389..aebd65c 100755 --- a/stage2/05-docker-compose/01-run.sh +++ b/stage2/05-docker-compose/01-run.sh @@ -29,4 +29,15 @@ echo "Copying the compose service to rootfs (etc/init.d)" cp files/compose-service ${ROOTFS_DIR}/etc/init.d/umbrelbox -echo "Docker stuff installed!" +echo "Pulling Docker images required to run Umbrel services" + +wget -q "https://raw.githubusercontent.com/getumbrel/umbrel-compose/master/docker-compose.yml" +IMAGES=$(grep '^\s*image' docker-compose.yml | sed 's/image://' | sed 's/\"//g' | sed '/^$/d;s/[[:blank:]]//g' | sort | uniq) +echo "List of images to download: $IMAGES" + +while IFS= read -r image; do + docker pull --platform=linux/arm/v7 $image +done <<< "$IMAGES" + +mkdir -p ${ROOTFS_DIR}/var/lib/docker +rsync -avPHSX /var/lib/docker ${ROOTFS_DIR}/var/lib/ \ No newline at end of file