feat: add update pipeline with MapleDeploy CDN and versioning
Route all Coolify update artifacts (versions.json, upgrade.sh, compose files) through updates.mapledeploy.ca instead of upstream cdn.coollabs.io. Extend CI to publish artifacts to Bunny CDN storage zone and purge cache on each build. - Point CDN_URL, versions_url, upgrade_script_url to updates.mapledeploy.ca - Hardcode helper/realtime images to ghcr.io (not mirrored to Forgejo) - Pass registry_url as 3rd arg to upgrade.sh for main image pulls - Adopt versioning scheme 4.0.0-beta.X.N (bump to 4.0.0-beta.463.1) - Add CI steps: generate versions.json, upload to Bunny, purge cache
This commit is contained in:
parent
a8ea8c9548
commit
88fab3e119
6 changed files with 71 additions and 12 deletions
|
|
@ -15,4 +15,5 @@ ROOT_USERNAME=
|
|||
ROOT_USER_EMAIL=
|
||||
ROOT_USER_PASSWORD=
|
||||
|
||||
REGISTRY_URL=ghcr.io
|
||||
REGISTRY_URL=forgejo.mapledeploy.ca
|
||||
CDN_URL=https://updates.mapledeploy.ca
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@ on:
|
|||
|
||||
env:
|
||||
REGISTRY: forgejo.mapledeploy.ca
|
||||
CDN_STORAGE_ZONE: coolify-updates
|
||||
CDN_PULL_ZONE_ID: "5338784"
|
||||
CDN_BASE_URL: https://updates.mapledeploy.ca
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
@ -21,8 +24,12 @@ jobs:
|
|||
id: version
|
||||
run: |
|
||||
VERSION=$(sed -n "s/.*'version' => '\([^']*\)'.*/\1/p" config/constants.php)
|
||||
HELPER_VERSION=$(sed -n "s/.*'helper_version' => '\([^']*\)'.*/\1/p" config/constants.php)
|
||||
REALTIME_VERSION=$(sed -n "s/.*'realtime_version' => '\([^']*\)'.*/\1/p" config/constants.php)
|
||||
echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||
echo "Building version: ${VERSION}"
|
||||
echo "HELPER_VERSION=${HELPER_VERSION}" >> "$GITHUB_OUTPUT"
|
||||
echo "REALTIME_VERSION=${REALTIME_VERSION}" >> "$GITHUB_OUTPUT"
|
||||
echo "Building version: ${VERSION} (helper: ${HELPER_VERSION}, realtime: ${REALTIME_VERSION})"
|
||||
|
||||
- name: Login to Forgejo registry
|
||||
run: |
|
||||
|
|
@ -39,3 +46,52 @@ jobs:
|
|||
run: |
|
||||
docker push ${{ env.REGISTRY }}/${{ github.repository }}:${{ steps.version.outputs.VERSION }}
|
||||
docker push ${{ env.REGISTRY }}/${{ github.repository }}:latest
|
||||
|
||||
- name: Generate versions.json
|
||||
run: |
|
||||
cat > versions.json <<EOF
|
||||
{
|
||||
"coolify": {
|
||||
"v4": {
|
||||
"version": "${{ steps.version.outputs.VERSION }}"
|
||||
},
|
||||
"helper": {
|
||||
"version": "${{ steps.version.outputs.HELPER_VERSION }}"
|
||||
},
|
||||
"realtime": {
|
||||
"version": "${{ steps.version.outputs.REALTIME_VERSION }}"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
echo "Generated versions.json:"
|
||||
cat versions.json
|
||||
|
||||
- name: Upload artifacts to Bunny CDN
|
||||
run: |
|
||||
STORAGE_URL="https://storage.bunnycdn.com/${{ env.CDN_STORAGE_ZONE }}/coolify"
|
||||
|
||||
upload() {
|
||||
local file="$1"
|
||||
local dest="$2"
|
||||
echo "Uploading ${file} -> ${dest}"
|
||||
curl -fsSL -X PUT "${STORAGE_URL}/${dest}" \
|
||||
-H "AccessKey: ${{ secrets.BUNNY_CDN_STORAGE_KEY }}" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary @"${file}"
|
||||
}
|
||||
|
||||
upload versions.json versions.json
|
||||
upload scripts/upgrade.sh upgrade.sh
|
||||
upload docker-compose.yml docker-compose.yml
|
||||
upload docker-compose.prod.yml docker-compose.prod.yml
|
||||
upload .env.production .env.production
|
||||
|
||||
echo "All artifacts uploaded."
|
||||
|
||||
- name: Purge CDN cache
|
||||
run: |
|
||||
curl -fsSL -X POST "https://api.bunny.net/pullzone/${{ env.CDN_PULL_ZONE_ID }}/purgeCache" \
|
||||
-H "AccessKey: ${{ secrets.BUNNY_API_KEY }}" \
|
||||
-H "Content-Type: application/json"
|
||||
echo "CDN cache purged."
|
||||
|
|
|
|||
|
|
@ -119,9 +119,11 @@ private function update()
|
|||
$latestHelperImageVersion = getHelperVersion();
|
||||
$upgradeScriptUrl = config('constants.coolify.upgrade_script_url');
|
||||
|
||||
$registryUrl = config('constants.coolify.registry_url');
|
||||
|
||||
remote_process([
|
||||
"curl -fsSL {$upgradeScriptUrl} -o /data/coolify/source/upgrade.sh",
|
||||
"bash /data/coolify/source/upgrade.sh $this->latestVersion $latestHelperImageVersion",
|
||||
"bash /data/coolify/source/upgrade.sh $this->latestVersion $latestHelperImageVersion $registryUrl",
|
||||
], $this->server);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@
|
|||
'helper_image' => env('HELPER_IMAGE', 'ghcr.io/coollabsio/coolify-helper'),
|
||||
'realtime_image' => env('REALTIME_IMAGE', 'ghcr.io/coollabsio/coolify-realtime'),
|
||||
'is_windows_docker_desktop' => env('IS_WINDOWS_DOCKER_DESKTOP', false),
|
||||
'cdn_url' => env('CDN_URL', 'https://cdn.coollabs.io'),
|
||||
'versions_url' => env('VERSIONS_URL', env('CDN_URL', 'https://cdn.coollabs.io').'/coolify/versions.json'),
|
||||
'upgrade_script_url' => env('UPGRADE_SCRIPT_URL', env('CDN_URL', 'https://cdn.coollabs.io').'/coolify/upgrade.sh'),
|
||||
'cdn_url' => env('CDN_URL', 'https://updates.mapledeploy.ca'),
|
||||
'versions_url' => env('VERSIONS_URL', env('CDN_URL', 'https://updates.mapledeploy.ca').'/coolify/versions.json'),
|
||||
'upgrade_script_url' => env('UPGRADE_SCRIPT_URL', env('CDN_URL', 'https://updates.mapledeploy.ca').'/coolify/upgrade.sh'),
|
||||
'releases_url' => 'https://cdn.coolify.io/releases.json',
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
services:
|
||||
coolify:
|
||||
image: "${REGISTRY_URL:-ghcr.io}/coollabsio/coolify:${LATEST_IMAGE:-latest}"
|
||||
image: "${REGISTRY_URL:-forgejo.mapledeploy.ca}/rosslh/coolify:${LATEST_IMAGE:-latest}"
|
||||
volumes:
|
||||
- type: bind
|
||||
source: /data/coolify/source/.env
|
||||
|
|
@ -60,7 +60,7 @@ services:
|
|||
retries: 10
|
||||
timeout: 2s
|
||||
soketi:
|
||||
image: '${REGISTRY_URL:-ghcr.io}/coollabsio/coolify-realtime:1.0.11'
|
||||
image: 'ghcr.io/coollabsio/coolify-realtime:1.0.11'
|
||||
ports:
|
||||
- "${SOKETI_PORT:-6001}:6001"
|
||||
- "6002:6002"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
## Do not modify this file. You will lose the ability to autoupdate!
|
||||
|
||||
CDN="https://cdn.coollabs.io/coolify"
|
||||
CDN="https://updates.mapledeploy.ca/coolify"
|
||||
LATEST_IMAGE=${1:-latest}
|
||||
LATEST_HELPER_VERSION=${2:-latest}
|
||||
REGISTRY_URL=${3:-ghcr.io}
|
||||
|
|
@ -164,7 +164,7 @@ echo "3/6 Pulling Docker images..."
|
|||
echo " This may take a few minutes depending on your connection."
|
||||
|
||||
# Also pull the helper image (not in compose files but needed for upgrade)
|
||||
HELPER_IMAGE="${REGISTRY_URL:-ghcr.io}/coollabsio/coolify-helper:${LATEST_HELPER_VERSION}"
|
||||
HELPER_IMAGE="ghcr.io/coollabsio/coolify-helper:${LATEST_HELPER_VERSION}"
|
||||
echo " - Pulling $HELPER_IMAGE..."
|
||||
log "Pulling image: $HELPER_IMAGE"
|
||||
if docker pull "$HELPER_IMAGE" >>"$LOGFILE" 2>&1; then
|
||||
|
|
@ -248,11 +248,11 @@ nohup bash -c "
|
|||
if [ -f /data/coolify/source/docker-compose.custom.yml ]; then
|
||||
log 'Using custom docker-compose.yml'
|
||||
log 'Running docker compose up with custom configuration...'
|
||||
docker run -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock \${DOCKER_CONFIG_MOUNT} --rm \${REGISTRY_URL:-ghcr.io}/coollabsio/coolify-helper:\${LATEST_HELPER_VERSION} bash -c \"LATEST_IMAGE=\${LATEST_IMAGE} docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml -f /data/coolify/source/docker-compose.custom.yml up -d --remove-orphans --wait --wait-timeout 60\" >>\"\$LOGFILE\" 2>&1
|
||||
docker run -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock \${DOCKER_CONFIG_MOUNT} --rm ghcr.io/coollabsio/coolify-helper:\${LATEST_HELPER_VERSION} bash -c \"LATEST_IMAGE=\${LATEST_IMAGE} docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml -f /data/coolify/source/docker-compose.custom.yml up -d --remove-orphans --wait --wait-timeout 60\" >>\"\$LOGFILE\" 2>&1
|
||||
else
|
||||
log 'Using standard docker-compose configuration'
|
||||
log 'Running docker compose up...'
|
||||
docker run -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock \${DOCKER_CONFIG_MOUNT} --rm \${REGISTRY_URL:-ghcr.io}/coollabsio/coolify-helper:\${LATEST_HELPER_VERSION} bash -c \"LATEST_IMAGE=\${LATEST_IMAGE} docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml up -d --remove-orphans --wait --wait-timeout 60\" >>\"\$LOGFILE\" 2>&1
|
||||
docker run -v /data/coolify/source:/data/coolify/source -v /var/run/docker.sock:/var/run/docker.sock \${DOCKER_CONFIG_MOUNT} --rm ghcr.io/coollabsio/coolify-helper:\${LATEST_HELPER_VERSION} bash -c \"LATEST_IMAGE=\${LATEST_IMAGE} docker compose --env-file /data/coolify/source/.env -f /data/coolify/source/docker-compose.yml -f /data/coolify/source/docker-compose.prod.yml up -d --remove-orphans --wait --wait-timeout 60\" >>\"\$LOGFILE\" 2>&1
|
||||
fi
|
||||
log 'Docker compose up completed'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue