feat: add update pipeline with MapleDeploy CDN and versioning
Some checks failed
Build MapleDeploy Coolify Image / build (push) Failing after 1m7s
Some checks failed
Build MapleDeploy Coolify Image / build (push) Failing after 1m7s
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
c58fe11782
commit
31315d415c
6 changed files with 72 additions and 13 deletions
|
|
@ -15,4 +15,5 @@ ROOT_USERNAME=
|
||||||
ROOT_USER_EMAIL=
|
ROOT_USER_EMAIL=
|
||||||
ROOT_USER_PASSWORD=
|
ROOT_USER_PASSWORD=
|
||||||
|
|
||||||
REGISTRY_URL=ghcr.io
|
REGISTRY_URL=forgejo.mapledeploy.ca
|
||||||
|
CDN_URL=https://updates.mapledeploy.ca
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,9 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: forgejo.mapledeploy.ca
|
REGISTRY: forgejo.mapledeploy.ca
|
||||||
|
CDN_STORAGE_ZONE: coolify-updates
|
||||||
|
CDN_PULL_ZONE_ID: "5338784"
|
||||||
|
CDN_BASE_URL: https://updates.mapledeploy.ca
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
@ -21,8 +24,12 @@ jobs:
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(sed -n "s/.*'version' => '\([^']*\)'.*/\1/p" config/constants.php)
|
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 "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
|
- name: Login to Forgejo registry
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -39,3 +46,52 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
docker push ${{ env.REGISTRY }}/${{ github.repository }}:${{ steps.version.outputs.VERSION }}
|
docker push ${{ env.REGISTRY }}/${{ github.repository }}:${{ steps.version.outputs.VERSION }}
|
||||||
docker push ${{ env.REGISTRY }}/${{ github.repository }}:latest
|
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();
|
$latestHelperImageVersion = getHelperVersion();
|
||||||
$upgradeScriptUrl = config('constants.coolify.upgrade_script_url');
|
$upgradeScriptUrl = config('constants.coolify.upgrade_script_url');
|
||||||
|
|
||||||
|
$registryUrl = config('constants.coolify.registry_url');
|
||||||
|
|
||||||
remote_process([
|
remote_process([
|
||||||
"curl -fsSL {$upgradeScriptUrl} -o /data/coolify/source/upgrade.sh",
|
"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);
|
], $this->server);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
return [
|
return [
|
||||||
// MapleDeploy branding: registry pointed to Forgejo, auto-update disabled by default
|
// MapleDeploy branding: registry pointed to Forgejo, auto-update disabled by default
|
||||||
'coolify' => [
|
'coolify' => [
|
||||||
'version' => '4.0.0-beta.463',
|
'version' => '4.0.0-beta.463.1',
|
||||||
'helper_version' => '1.0.12',
|
'helper_version' => '1.0.12',
|
||||||
'realtime_version' => '1.0.10',
|
'realtime_version' => '1.0.10',
|
||||||
'self_hosted' => env('SELF_HOSTED', true),
|
'self_hosted' => env('SELF_HOSTED', true),
|
||||||
|
|
@ -13,9 +13,9 @@
|
||||||
'helper_image' => env('HELPER_IMAGE', 'ghcr.io/coollabsio/coolify-helper'),
|
'helper_image' => env('HELPER_IMAGE', 'ghcr.io/coollabsio/coolify-helper'),
|
||||||
'realtime_image' => env('REALTIME_IMAGE', 'ghcr.io/coollabsio/coolify-realtime'),
|
'realtime_image' => env('REALTIME_IMAGE', 'ghcr.io/coollabsio/coolify-realtime'),
|
||||||
'is_windows_docker_desktop' => env('IS_WINDOWS_DOCKER_DESKTOP', false),
|
'is_windows_docker_desktop' => env('IS_WINDOWS_DOCKER_DESKTOP', false),
|
||||||
'cdn_url' => env('CDN_URL', 'https://cdn.coollabs.io'),
|
'cdn_url' => env('CDN_URL', 'https://updates.mapledeploy.ca'),
|
||||||
'versions_url' => env('VERSIONS_URL', env('CDN_URL', 'https://cdn.coollabs.io').'/coolify/versions.json'),
|
'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://cdn.coollabs.io').'/coolify/upgrade.sh'),
|
'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',
|
'releases_url' => 'https://cdn.coolify.io/releases.json',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
services:
|
services:
|
||||||
coolify:
|
coolify:
|
||||||
image: "${REGISTRY_URL:-ghcr.io}/coollabsio/coolify:${LATEST_IMAGE:-latest}"
|
image: "${REGISTRY_URL:-forgejo.mapledeploy.ca}/rosslh/coolify:${LATEST_IMAGE:-latest}"
|
||||||
volumes:
|
volumes:
|
||||||
- type: bind
|
- type: bind
|
||||||
source: /data/coolify/source/.env
|
source: /data/coolify/source/.env
|
||||||
|
|
@ -60,7 +60,7 @@ services:
|
||||||
retries: 10
|
retries: 10
|
||||||
timeout: 2s
|
timeout: 2s
|
||||||
soketi:
|
soketi:
|
||||||
image: '${REGISTRY_URL:-ghcr.io}/coollabsio/coolify-realtime:1.0.10'
|
image: 'ghcr.io/coollabsio/coolify-realtime:1.0.10'
|
||||||
ports:
|
ports:
|
||||||
- "${SOKETI_PORT:-6001}:6001"
|
- "${SOKETI_PORT:-6001}:6001"
|
||||||
- "6002:6002"
|
- "6002:6002"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
## Do not modify this file. You will lose the ability to autoupdate!
|
## 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_IMAGE=${1:-latest}
|
||||||
LATEST_HELPER_VERSION=${2:-latest}
|
LATEST_HELPER_VERSION=${2:-latest}
|
||||||
REGISTRY_URL=${3:-ghcr.io}
|
REGISTRY_URL=${3:-ghcr.io}
|
||||||
|
|
@ -155,7 +155,7 @@ echo "3/6 Pulling Docker images..."
|
||||||
echo " This may take a few minutes depending on your connection."
|
echo " This may take a few minutes depending on your connection."
|
||||||
|
|
||||||
# Also pull the helper image (not in compose files but needed for upgrade)
|
# 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..."
|
echo " - Pulling $HELPER_IMAGE..."
|
||||||
log "Pulling image: $HELPER_IMAGE"
|
log "Pulling image: $HELPER_IMAGE"
|
||||||
if docker pull "$HELPER_IMAGE" >>"$LOGFILE" 2>&1; then
|
if docker pull "$HELPER_IMAGE" >>"$LOGFILE" 2>&1; then
|
||||||
|
|
@ -239,11 +239,11 @@ nohup bash -c "
|
||||||
if [ -f /data/coolify/source/docker-compose.custom.yml ]; then
|
if [ -f /data/coolify/source/docker-compose.custom.yml ]; then
|
||||||
log 'Using custom docker-compose.yml'
|
log 'Using custom docker-compose.yml'
|
||||||
log 'Running docker compose up with custom configuration...'
|
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
|
else
|
||||||
log 'Using standard docker-compose configuration'
|
log 'Using standard docker-compose configuration'
|
||||||
log 'Running docker compose up...'
|
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
|
fi
|
||||||
log 'Docker compose up completed'
|
log 'Docker compose up completed'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue