From 06ad71439c248edfe2ae7f8eee2356f13e0d73da Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Tue, 27 Oct 2026 20:26:51 +0100 Subject: [PATCH] build: move the helper image to coollabsio/coolify-helper - Docker Compose builds the development helper from the main branch of that repository, scripts/dev-helper from there or from a local checkout - Remove buildHelperImage from the settings, nothing calls it since its button was removed --- .github/workflows/coolify-helper-next.yml | 117 ------------- .github/workflows/coolify-helper.yml | 161 ------------------ CONTRIBUTING.md | 2 +- app/Livewire/Settings/Index.php | 49 ------ bootstrap/getHelperVersion.php | 10 -- docker-compose.dev-multi.yml | 9 + docker-compose.dev.yml | 9 + docker/coolify-helper/Dockerfile | 91 ---------- scripts/dev-helper | 2 +- scripts/helper-checksums | 85 --------- .../DevHelperVersionValidationTest.php | 20 --- tests/Feature/VolumeBackupTest.php | 6 - tests/Unit/DockerCliPackagingTest.php | 12 -- tests/Unit/ProductionImageWorkflowTest.php | 27 +-- 14 files changed, 23 insertions(+), 577 deletions(-) delete mode 100644 .github/workflows/coolify-helper-next.yml delete mode 100644 .github/workflows/coolify-helper.yml delete mode 100644 bootstrap/getHelperVersion.php delete mode 100644 docker/coolify-helper/Dockerfile delete mode 100755 scripts/helper-checksums delete mode 100644 tests/Unit/DockerCliPackagingTest.php diff --git a/.github/workflows/coolify-helper-next.yml b/.github/workflows/coolify-helper-next.yml deleted file mode 100644 index 2e50abbe73..0000000000 --- a/.github/workflows/coolify-helper-next.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: Coolify Helper Image Development - -on: - push: - branches: [ "next" ] - paths: - - .github/workflows/coolify-helper-next.yml - - docker/coolify-helper/Dockerfile - -permissions: - contents: read - packages: write - -env: - GITHUB_REGISTRY: ghcr.io - DOCKER_REGISTRY: docker.io - IMAGE_NAME: "coollabsio/coolify-helper" - -jobs: - build-push: - strategy: - matrix: - include: - - arch: amd64 - platform: linux/amd64 - runner: ubuntu-24.04 - - arch: aarch64 - platform: linux/aarch64 - runner: ubuntu-24.04-arm - runs-on: ${{ matrix.runner }} - steps: - - uses: actions/checkout@v5 - with: - persist-credentials: false - - - name: Login to ${{ env.GITHUB_REGISTRY }} - uses: docker/login-action@v3 - with: - registry: ${{ env.GITHUB_REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to ${{ env.DOCKER_REGISTRY }} - uses: docker/login-action@v3 - with: - registry: ${{ env.DOCKER_REGISTRY }} - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Get Version - id: version - run: | - echo "VERSION=$(docker run --rm -v "$(pwd):/app" -w /app php:8.2-alpine3.16 php bootstrap/getHelperVersion.php)"|xargs >> $GITHUB_OUTPUT - - - name: Build and Push Image (${{ matrix.arch }}) - uses: docker/build-push-action@v6 - with: - context: . - file: docker/coolify-helper/Dockerfile - platforms: ${{ matrix.platform }} - push: true - tags: | - ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-next-${{ matrix.arch }} - ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-next-${{ matrix.arch }} - labels: | - coolify.managed=true - - merge-manifest: - runs-on: ubuntu-24.04 - needs: build-push - steps: - - uses: actions/checkout@v5 - with: - persist-credentials: false - - - uses: docker/setup-buildx-action@v3 - - - name: Login to ${{ env.GITHUB_REGISTRY }} - uses: docker/login-action@v3 - with: - registry: ${{ env.GITHUB_REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to ${{ env.DOCKER_REGISTRY }} - uses: docker/login-action@v3 - with: - registry: ${{ env.DOCKER_REGISTRY }} - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Get Version - id: version - run: | - echo "VERSION=$(docker run --rm -v "$(pwd):/app" -w /app php:8.2-alpine3.16 php bootstrap/getHelperVersion.php)"|xargs >> $GITHUB_OUTPUT - - - name: Create & publish manifest on ${{ env.GITHUB_REGISTRY }} - run: | - docker buildx imagetools create \ - ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-next-amd64 \ - ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-next-aarch64 \ - --tag ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-next \ - --tag ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:next - - - name: Create & publish manifest on ${{ env.DOCKER_REGISTRY }} - run: | - docker buildx imagetools create \ - ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-next-amd64 \ - ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-next-aarch64 \ - --tag ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-next \ - --tag ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:next - - - uses: sarisia/actions-status-discord@v1 - if: always() - with: - webhook: ${{ secrets.DISCORD_WEBHOOK_DEV_RELEASE_CHANNEL }} - diff --git a/.github/workflows/coolify-helper.yml b/.github/workflows/coolify-helper.yml deleted file mode 100644 index de0cf3b8d7..0000000000 --- a/.github/workflows/coolify-helper.yml +++ /dev/null @@ -1,161 +0,0 @@ -name: Coolify Helper Image - -on: - workflow_dispatch: - push: - branches: [ "main" ] - paths: - - .github/workflows/coolify-helper.yml - - docker/coolify-helper/Dockerfile - -permissions: - contents: read - packages: write - -env: - GITHUB_REGISTRY: ghcr.io - DOCKER_REGISTRY: docker.io - IMAGE_NAME: "coollabsio/coolify-helper" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: false - -jobs: - check-version: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v5 - with: - persist-credentials: false - - - uses: docker/setup-buildx-action@v3 - - - name: Login to ${{ env.GITHUB_REGISTRY }} - uses: docker/login-action@v3 - with: - registry: ${{ env.GITHUB_REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to ${{ env.DOCKER_REGISTRY }} - uses: docker/login-action@v3 - with: - registry: ${{ env.DOCKER_REGISTRY }} - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Ensure version is not published - run: | - BASE_VERSION=$(docker run --rm -v "$(pwd):/app" -w /app php:8.2-alpine3.16 php bootstrap/getHelperVersion.php) - VERSION="${BASE_VERSION}" - for registry in "${DOCKER_REGISTRY}" "${GITHUB_REGISTRY}"; do - IMAGE="${registry}/${IMAGE_NAME}:${VERSION}" - if output=$(docker buildx imagetools inspect "$IMAGE" 2>&1); then - echo "::error::Version $VERSION already exists in $registry" - exit 1 - fi - if ! grep -Eqi 'manifest unknown|not found|no such manifest' <<< "$output"; then - echo "::error::Could not verify $IMAGE: $output" - exit 1 - fi - done - echo "Version $VERSION is available in both registries" - - build-push: - needs: check-version - strategy: - matrix: - include: - - arch: amd64 - platform: linux/amd64 - runner: ubuntu-24.04 - - arch: aarch64 - platform: linux/aarch64 - runner: ubuntu-24.04-arm - runs-on: ${{ matrix.runner }} - steps: - - uses: actions/checkout@v5 - with: - persist-credentials: false - - - name: Login to ${{ env.GITHUB_REGISTRY }} - uses: docker/login-action@v3 - with: - registry: ${{ env.GITHUB_REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to ${{ env.DOCKER_REGISTRY }} - uses: docker/login-action@v3 - with: - registry: ${{ env.DOCKER_REGISTRY }} - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Get Version - id: version - run: | - echo "VERSION=$(docker run --rm -v "$(pwd):/app" -w /app php:8.2-alpine3.16 php bootstrap/getHelperVersion.php)"|xargs >> $GITHUB_OUTPUT - - - name: Build and Push Image (${{ matrix.arch }}) - uses: docker/build-push-action@v6 - with: - context: . - file: docker/coolify-helper/Dockerfile - platforms: ${{ matrix.platform }} - push: true - tags: | - ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-${{ matrix.arch }} - ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-${{ matrix.arch }} - labels: | - coolify.managed=true - merge-manifest: - runs-on: ubuntu-24.04 - needs: build-push - steps: - - uses: actions/checkout@v5 - with: - persist-credentials: false - - - uses: docker/setup-buildx-action@v3 - - - name: Login to ${{ env.GITHUB_REGISTRY }} - uses: docker/login-action@v3 - with: - registry: ${{ env.GITHUB_REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to ${{ env.DOCKER_REGISTRY }} - uses: docker/login-action@v3 - with: - registry: ${{ env.DOCKER_REGISTRY }} - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Get Version - id: version - run: | - echo "VERSION=$(docker run --rm -v "$(pwd):/app" -w /app php:8.2-alpine3.16 php bootstrap/getHelperVersion.php)"|xargs >> $GITHUB_OUTPUT - - - name: Create & publish manifest on ${{ env.GITHUB_REGISTRY }} - run: | - docker buildx imagetools create \ - ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-amd64 \ - ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-aarch64 \ - --tag ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }} \ - --tag ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:latest - - - name: Create & publish manifest on ${{ env.DOCKER_REGISTRY }} - run: | - docker buildx imagetools create \ - ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-amd64 \ - ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}-aarch64 \ - --tag ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }} \ - --tag ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest - - - uses: sarisia/actions-status-discord@v1 - if: always() - with: - webhook: ${{ secrets.DISCORD_WEBHOOK_PROD_RELEASE_CHANNEL }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5fca2d5408..bfa97207f6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -230,7 +230,7 @@ To build and run Coolify locally, see: [Development](./DEVELOPMENT.md) ### Testing the Coolify Helper Locally -When you change a tool version in `docker/coolify-helper/Dockerfile`, run `./scripts/helper-checksums` to update the SHA256 checksums of the downloads. +The helper image lives in [coollabsio/coolify-helper](https://github.com/coollabsio/coolify-helper). The development setup builds its `main` branch as `coollabsio/coolify-helper:dev`, set the helper version override to `dev` to use it. `scripts/dev-helper` builds it from there too, or from a local checkout with `HELPER_CONTEXT=../coolify-helper/src`. Use `scripts/dev-helper` to build a local helper image and test it with the running development instance. The script requires the standard local Coolify container and the seeded Dockerfile, Docker Compose, and Nixpacks applications. diff --git a/app/Livewire/Settings/Index.php b/app/Livewire/Settings/Index.php index cd047b1f43..e21f0a5dc1 100644 --- a/app/Livewire/Settings/Index.php +++ b/app/Livewire/Settings/Index.php @@ -225,53 +225,4 @@ class Index extends Component return handleError($e, $this); } } - - public function buildHelperImage() - { - try { - $this->authorize('update', $this->settings); - if (! isDev()) { - $this->dispatch('error', 'Building helper image is only available in development mode.'); - - return; - } - - if (! $this->server) { - $this->dispatch('error', 'Server not available.'); - - return; - } - - $this->validateOnly('dev_helper_version'); - - $version = $this->dev_helper_version ?: config('constants.coolify.helper_version'); - if (empty($version)) { - $this->dispatch('error', 'Please specify a version to build.'); - - return; - } - - if (! preg_match('/^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$/', (string) $version)) { - $this->dispatch('error', 'Invalid helper version format.'); - - return; - } - - $imageRef = escapeshellarg(coolifyHelperImage().":{$version}"); - $buildCommand = "docker build -t {$imageRef} -f docker/coolify-helper/Dockerfile ."; - - $activity = remote_process( - command: [$buildCommand], - server: $this->server, - type: 'build-helper-image' - ); - - $this->buildActivityId = $activity->id; - $this->dispatch('activityMonitor', $activity->id); - - $this->dispatch('success', "Building coolify-helper:{$version}..."); - } catch (\Exception $e) { - return handleError($e, $this); - } - } } diff --git a/bootstrap/getHelperVersion.php b/bootstrap/getHelperVersion.php deleted file mode 100644 index 766af8db29..0000000000 --- a/bootstrap/getHelperVersion.php +++ /dev/null @@ -1,10 +0,0 @@ -&2; exit 1 ;; \ - esac && \ - mkdir -p /tmp/downloads && cd /tmp/downloads && \ - download() { curl -fsSL --proto '=https' --tlsv1.2 --retry 3 -o "$1" "$2"; } && \ - download "docker-${TARGETARCH}.tgz" "https://download.docker.com/linux/static/stable/${DOCKER_ARCH}/docker-${DOCKER_VERSION}.tgz" && \ - download "docker-compose-${TARGETARCH}" "https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-linux-${DOCKER_ARCH}" && \ - download "docker-buildx-${TARGETARCH}" "https://github.com/docker/buildx/releases/download/v${DOCKER_BUILDX_VERSION}/buildx-v${DOCKER_BUILDX_VERSION}.linux-${TARGETARCH}" && \ - download "pack-${TARGETARCH}.tgz" "https://github.com/buildpacks/pack/releases/download/v${PACK_VERSION}/pack-v${PACK_VERSION}-linux${PACK_SUFFIX}.tgz" && \ - download "nixpacks-${TARGETARCH}.tgz" "https://github.com/railwayapp/nixpacks/releases/download/v${NIXPACKS_VERSION}/nixpacks-v${NIXPACKS_VERSION}-${NIXPACKS_ARCH}-unknown-linux-musl.tar.gz" && \ - download "railpack-${TARGETARCH}.tgz" "https://github.com/railwayapp/railpack/releases/download/v${RAILPACK_VERSION}/railpack-v${RAILPACK_VERSION}-${RAILPACK_ARCH}-unknown-linux-musl.tar.gz" && \ - download "mise-${TARGETARCH}" "https://github.com/jdx/mise/releases/download/v${MISE_VERSION}/mise-v${MISE_VERSION}-linux-${MISE_ARCH}-musl" && \ - grep -- "-${TARGETARCH}" /tmp/SHA256SUMS | sha256sum -c - && \ - mkdir -p /root/.docker/cli-plugins /tmp/railpack/mise && \ - tar -xzf "docker-${TARGETARCH}.tgz" -C /usr/bin --no-same-owner --strip-components=1 docker/docker && \ - install -m 0755 "docker-compose-${TARGETARCH}" /root/.docker/cli-plugins/docker-compose && \ - install -m 0755 "docker-buildx-${TARGETARCH}" /root/.docker/cli-plugins/docker-buildx && \ - tar -xzf "pack-${TARGETARCH}.tgz" -C /usr/local/bin --no-same-owner pack && \ - tar -xzf "nixpacks-${TARGETARCH}.tgz" -C /usr/local/bin --no-same-owner nixpacks && \ - tar -xzf "railpack-${TARGETARCH}.tgz" -C /usr/local/bin --no-same-owner railpack && \ - # Railpack skips its own mise download when this file exists. - install -m 0755 "mise-${TARGETARCH}" "/tmp/railpack/mise/mise-${MISE_VERSION}" && \ - cd / && rm -rf /tmp/downloads /tmp/SHA256SUMS && \ - docker --version && docker compose version && docker buildx version && pack --version && \ - nixpacks --version && railpack --version - -COPY --from=minio-client /usr/bin/mc /usr/bin/mc -RUN chmod +x /usr/bin/mc && mc --version - -ENTRYPOINT ["/sbin/tini", "--"] -CMD ["tail", "-f", "/dev/null"] diff --git a/scripts/dev-helper b/scripts/dev-helper index 1d0de9fbfb..c52bbd731f 100755 --- a/scripts/dev-helper +++ b/scripts/dev-helper @@ -57,7 +57,7 @@ build_helper() { image=$(image_for "$tag") echo "Building $image" - docker build --progress=plain -f "$ROOT_DIR/docker/coolify-helper/Dockerfile" -t "$image" "$ROOT_DIR" + docker build --progress=plain --build-arg IMAGE_VERSION="$tag" -t "$image" "${HELPER_CONTEXT:-https://github.com/coollabsio/coolify-helper.git#main:src}" } use_helper() { diff --git a/scripts/helper-checksums b/scripts/helper-checksums deleted file mode 100755 index afdeff5979..0000000000 --- a/scripts/helper-checksums +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env bash -# Update the SHA256SUMS block in docker/coolify-helper/Dockerfile. -# Change the ARG versions in the Dockerfile first, then run this script. -# It downloads every file, compares it with the upstream checksum file where one exists, and writes the new block. - -set -euo pipefail - -ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) -DOCKERFILE="$ROOT_DIR/docker/coolify-helper/Dockerfile" -GH=https://github.com - -arg() { - sed -n "s/^ARG $1=//p" "$DOCKERFILE" -} - -DOCKER_VERSION=$(arg DOCKER_VERSION) -DOCKER_COMPOSE_VERSION=$(arg DOCKER_COMPOSE_VERSION) -DOCKER_BUILDX_VERSION=$(arg DOCKER_BUILDX_VERSION) -PACK_VERSION=$(arg PACK_VERSION) -NIXPACKS_VERSION=$(arg NIXPACKS_VERSION) -RAILPACK_VERSION=$(arg RAILPACK_VERSION) -MISE_VERSION=$(arg MISE_VERSION) - -railpack_mise=$(curl -fsSL "https://raw.githubusercontent.com/railwayapp/railpack/v${RAILPACK_VERSION}/core/mise/version.txt") -if [[ $railpack_mise != "$MISE_VERSION" ]]; then - echo "MISE_VERSION is $MISE_VERSION, but Railpack $RAILPACK_VERSION pins mise $railpack_mise." >&2 - exit 1 -fi - -WORK_DIR=$(mktemp -d) -trap 'rm -rf "$WORK_DIR"' EXIT - -lines=() - -# add [upstream checksum file URL] -add() { - local name=$1 url=$2 sums_url=${3:-} sum upstream - curl -fsSL --proto '=https' --tlsv1.2 --retry 3 -o "$WORK_DIR/$name" "$url" - sum=$(sha256sum "$WORK_DIR/$name" | cut -d' ' -f1) - - if [[ -n $sums_url ]]; then - upstream=$(curl -fsSL "$sums_url" | grep -F "${url##*/}" | awk '{print $1}' | head -1) - if [[ $upstream != "$sum" ]]; then - echo "Checksum mismatch for $url (upstream: ${upstream:-not found}, downloaded: $sum)." >&2 - exit 1 - fi - echo "verified $name" - else - echo "no upstream checksum $name" - fi - - lines+=("$sum $name") -} - -for arch in amd64 arm64; do - case $arch in - amd64) DOCKER_ARCH=x86_64; PACK_SUFFIX=""; NIXPACKS_ARCH=x86_64; RAILPACK_ARCH=x86_64; MISE_ARCH=x64 ;; - arm64) DOCKER_ARCH=aarch64; PACK_SUFFIX="-arm64"; NIXPACKS_ARCH=aarch64; RAILPACK_ARCH=arm64; MISE_ARCH=arm64 ;; - esac - - add "docker-$arch.tgz" \ - "https://download.docker.com/linux/static/stable/$DOCKER_ARCH/docker-$DOCKER_VERSION.tgz" - add "docker-compose-$arch" \ - "$GH/docker/compose/releases/download/v$DOCKER_COMPOSE_VERSION/docker-compose-linux-$DOCKER_ARCH" \ - "$GH/docker/compose/releases/download/v$DOCKER_COMPOSE_VERSION/checksums.txt" - add "docker-buildx-$arch" \ - "$GH/docker/buildx/releases/download/v$DOCKER_BUILDX_VERSION/buildx-v$DOCKER_BUILDX_VERSION.linux-$arch" \ - "$GH/docker/buildx/releases/download/v$DOCKER_BUILDX_VERSION/checksums.txt" - add "pack-$arch.tgz" \ - "$GH/buildpacks/pack/releases/download/v$PACK_VERSION/pack-v$PACK_VERSION-linux$PACK_SUFFIX.tgz" \ - "$GH/buildpacks/pack/releases/download/v$PACK_VERSION/pack-v$PACK_VERSION-linux$PACK_SUFFIX.tgz.sha256" - add "nixpacks-$arch.tgz" \ - "$GH/railwayapp/nixpacks/releases/download/v$NIXPACKS_VERSION/nixpacks-v$NIXPACKS_VERSION-$NIXPACKS_ARCH-unknown-linux-musl.tar.gz" - add "railpack-$arch.tgz" \ - "$GH/railwayapp/railpack/releases/download/v$RAILPACK_VERSION/railpack-v$RAILPACK_VERSION-$RAILPACK_ARCH-unknown-linux-musl.tar.gz" \ - "$GH/railwayapp/railpack/releases/download/v$RAILPACK_VERSION/checksums.txt" - add "mise-$arch" \ - "$GH/jdx/mise/releases/download/v$MISE_VERSION/mise-v$MISE_VERSION-linux-$MISE_ARCH-musl" \ - "$GH/jdx/mise/releases/download/v$MISE_VERSION/SHASUMS256.txt" -done - -block=$(printf '%s\n' "${lines[@]}" | sort -k2) -BLOCK="$block" perl -0pi -e 's/(COPY <<.EOF. \/tmp\/SHA256SUMS\n).*?(\nEOF\n)/$1$ENV{BLOCK}$2/s' "$DOCKERFILE" - -echo "Updated SHA256SUMS in $DOCKERFILE" diff --git a/tests/Feature/DevHelperVersionValidationTest.php b/tests/Feature/DevHelperVersionValidationTest.php index 65a1b5a275..a585f6ee60 100644 --- a/tests/Feature/DevHelperVersionValidationTest.php +++ b/tests/Feature/DevHelperVersionValidationTest.php @@ -69,26 +69,6 @@ test('dev_helper_version accepts valid docker tag formats', function () { } }); -test('buildHelperImage refuses when non-dev environment', function () { - config(['app.env' => 'production']); - - Livewire::test(Index::class) - ->set('dev_helper_version', 'latest') - ->call('buildHelperImage') - ->assertDispatched('error'); -}); - -test('buildHelperImage refuses previously stored invalid version', function () { - config(['app.env' => 'local']); - - $settings = InstanceSettings::find(0); - $settings->forceFill(['dev_helper_version' => 'bad value'])->saveQuietly(); - - Livewire::test(Index::class) - ->call('buildHelperImage') - ->assertDispatched('error'); -}); - test('development helper version is read fresh for queue workers', function () { config(['app.env' => 'local']); diff --git a/tests/Feature/VolumeBackupTest.php b/tests/Feature/VolumeBackupTest.php index cb4086ae5e..184aba1f39 100644 --- a/tests/Feature/VolumeBackupTest.php +++ b/tests/Feature/VolumeBackupTest.php @@ -99,12 +99,6 @@ it('changes the default volume backup timeout without changing existing timeouts ->and($customBackup->fresh()->timeout)->toBe(7200); }); -it('includes parallel gzip support in the Coolify helper image', function () { - $dockerfile = file_get_contents(base_path('docker/coolify-helper/Dockerfile')); - - expect($dockerfile)->toContain('pigz'); -}); - it('targets named volumes and application directory mounts through one backup relation', function () { $team = Team::factory()->create(); [$application, $volume] = createVolumeBackupApplication($team); diff --git a/tests/Unit/DockerCliPackagingTest.php b/tests/Unit/DockerCliPackagingTest.php deleted file mode 100644 index 71fa7078e1..0000000000 --- a/tests/Unit/DockerCliPackagingTest.php +++ /dev/null @@ -1,12 +0,0 @@ -toContain('ARG DOCKER_VERSION=29.7.2') - ->toContain('ARG DOCKER_COMPOSE_VERSION=5.5.0') - ->toContain('ARG DOCKER_BUILDX_VERSION=0.36.1') - ->toContain('https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz') - ->toContain('https://download.docker.com/linux/static/stable/aarch64/docker-${DOCKER_VERSION}.tgz') - ->toMatch('/chmod \+x [^\n]*\/usr\/bin\/docker/'); -}); diff --git a/tests/Unit/ProductionImageWorkflowTest.php b/tests/Unit/ProductionImageWorkflowTest.php index 97b8700457..9885faa5ec 100644 --- a/tests/Unit/ProductionImageWorkflowTest.php +++ b/tests/Unit/ProductionImageWorkflowTest.php @@ -9,30 +9,9 @@ it('reads the Coolify and helper versions by key from the versions.json of the C expect(trim($output))->toBe("4.6.0-beta.1 {$helper}"); }); -it('runs support image workflows from main', function (string $workflowFile) { - $workflow = file_get_contents(dirname(__DIR__, 2)."/.github/workflows/{$workflowFile}"); - - expect($workflow) - ->toContain('branches: [ "main" ]') - ->not->toContain('v4.x'); -})->with([ - 'helper' => 'coolify-helper.yml', -]); - -it('prevents the stable helper workflow from publishing an existing version', function () { - $workflow = file_get_contents(dirname(__DIR__, 2).'/.github/workflows/coolify-helper.yml'); - - expect($workflow) - ->toContain('workflow_dispatch:') - ->toContain('check-version:') - ->toContain('needs: check-version') - ->toContain('VERSION="${BASE_VERSION}"') - ->toContain('docker buildx imagetools inspect "$IMAGE"') - ->toContain('Version $VERSION already exists in $registry') - ->toContain('Version $VERSION is available in both registries') - ->toContain('Could not verify $IMAGE') - ->toContain('cancel-in-progress: false'); -}); +it('builds the development helper image from the coolify-helper repository', function (string $file) { + expect(file_get_contents(dirname(__DIR__, 2)."/{$file}"))->toContain('https://github.com/coollabsio/coolify-helper.git#main:src'); +})->with(['scripts/dev-helper', 'docker-compose.dev.yml', 'docker-compose.dev-multi.yml']); it('publishes the testing host only to Docker Hub', function () { $workflow = file_get_contents(dirname(__DIR__, 2).'/.github/workflows/coolify-testing-host.yml');