Skip to content

Add dev branch deployment pipeline and Proxmox upgrade script#138

Draft
anishapant21 wants to merge 2 commits intodevfrom
feature/dev-deployment-pipeline
Draft

Add dev branch deployment pipeline and Proxmox upgrade script#138
anishapant21 wants to merge 2 commits intodevfrom
feature/dev-deployment-pipeline

Conversation

@anishapant21
Copy link
Collaborator

Summary

Adds automated .deb package publishing for the dev branch and a one-command upgrade script for Proxmox LXC containers.

Changes
CI/CD — [build-and-release.yml]

  • Added dev branch to push and PR triggers
  • Added dev-release job: creates/updates a rolling dev-latest pre-release on GitHub Releases on every push to dev
  • Dev packages are prefixed with dev- to distinguish from stable releases
  • Stable release jobs (create-release, publish-npm, update-homebrew) remain gated on v* tags only

Systemd service — [ldap-gateway.service]

  • Fixed ExecStart path: (nfpm [type: tree] copies server contents directly to /opt/ldap-gateway/)
  • Fixed ReadWritePaths for cert directory to match
  • Added ReadOnlyPaths=/mnt/pve /mnt/priv for Proxmox backend config file access through ProtectSystem=strict sandbox

Upgrade script — [proxmox-upgrade.sh]

  • One-command upgrade for Proxmox containers
  • ldap-gateway-upgrade --dev — pulls latest dev build
  • ldap-gateway-upgrade — pulls latest stable release
  • ldap-gateway-upgrade v1.2.0 — pulls specific version
  • SHA256 checksum verification, temp dir cleanup, service status reporting

How to use
Testing

  • Push to dev triggers build-and-release workflow
  • dev-release job creates dev-latest pre-release with .deb assets
  • ldap-gateway-upgrade --dev downloads and installs successfully
  • Service starts and binds on port 636
  • /etc/default/ldap-gateway config preserved across upgrades
  • Stable release jobs (create-release, publish-npm) do NOT trigger on dev pushes

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a dev-branch delivery path (rolling dev-latest GitHub pre-release with packages) and a Proxmox LXC upgrade helper, plus systemd hardening/path fixes to match nfpm’s install layout.

Changes:

  • Extend CI triggers to include dev and add a dev-release job that publishes a rolling dev-latest pre-release with dev--prefixed package assets and checksums.
  • Update the packaged systemd unit to start the correct entrypoint and adjust sandbox path allowances (cert dir and Proxmox mountpoints).
  • Add a Proxmox/Debian upgrade script that downloads a release asset, verifies SHA256 (when available), installs it, and reports service status.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
scripts/proxmox-upgrade.sh New one-command upgrade script for installing stable/dev .deb releases with optional checksum verification.
nfpm/systemd/ldap-gateway.service Fix ExecStart/cert path to align with nfpm’s /opt/ldap-gateway/ tree install; allow read-only access to Proxmox mount paths.
.github/workflows/build-and-release.yml Add dev triggers and a rolling dev-latest pre-release publisher job.

fi

REPO="mieweb/LDAPServer"
ARCH="amd64"
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARCH is hard-coded to amd64, which will download the wrong package on arm64 containers. Consider deriving it from dpkg --print-architecture (and mapping to the release asset naming) so the script works on both amd64 and arm64 Proxmox LXC guests.

Suggested change
ARCH="amd64"
# Detect architecture dynamically so we download the correct .deb on amd64 and arm64
DETECTED_ARCH="$(dpkg --print-architecture 2>/dev/null || echo amd64)"
case "$DETECTED_ARCH" in
amd64|arm64)
ARCH="$DETECTED_ARCH"
;;
*)
echo "WARNING: Unsupported architecture '$DETECTED_ARCH'; defaulting to amd64 package." >&2
ARCH="amd64"
;;
esac

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +8
branches: [ main, dev ]
tags: [ 'v*' ]
pull_request:
branches: [ main ]
branches: [ main, dev ]
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding dev to the workflow triggers means every job that runs on push (including build-docker, which is configured to push: ${{ github.event_name != 'pull_request' }}) will now publish images for the dev branch as well. If the intent is to publish only .deb dev packages (per PR description), consider gating Docker pushes to main/tags, or adjusting the build-docker job condition to avoid pushing on dev.

Copilot uses AI. Check for mistakes.
Comment on lines +127 to +131
dpkg -i "${TMP_DIR}/${DEB_FILE}"

# Fix any missing dependencies
apt-get install -f -y --no-install-recommends 2>/dev/null || true

Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With set -e, dpkg -i will exit non-zero when dependencies are missing, so the script aborts before the apt-get install -f recovery runs. Consider installing via apt-get install ./package.deb (lets apt resolve deps) or handling the dpkg -i failure explicitly so dependency installation can proceed and failures are surfaced appropriately.

Suggested change
dpkg -i "${TMP_DIR}/${DEB_FILE}"
# Fix any missing dependencies
apt-get install -f -y --no-install-recommends 2>/dev/null || true
if ! apt-get install -y --no-install-recommends "${TMP_DIR}/${DEB_FILE}"; then
echo "ERROR: Failed to install ${DEB_FILE}. See apt-get output above for details." >&2
exit 1
fi

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant