Skip to content

POC: deploy via Docker context with bind mount rewrite#112

Merged
crohr merged 24 commits intocodex/gofrom
codex/go-context
Feb 6, 2026
Merged

POC: deploy via Docker context with bind mount rewrite#112
crohr merged 24 commits intocodex/gofrom
codex/go-context

Conversation

@crohr
Copy link
Member

@crohr crohr commented Feb 6, 2026

Summary

  • switch deploy path to Docker context over SSH for compose operations
  • sync app tarball to and rewrite relative bind mounts to remote
  • reject bind mounts outside in this POC
  • add unit tests for bind source rewrite behavior

Validation

  • ok github.com/pullpreview/action/cmd/pullpreview (cached)
    ok github.com/pullpreview/action/internal/github (cached)
    ok github.com/pullpreview/action/internal/license (cached)
    ok github.com/pullpreview/action/internal/providers/lightsail (cached)
    ok github.com/pullpreview/action/internal/pullpreview (cached)
  • live deploy with
  • live bind mount seed test with

@crohr crohr added the pullpreview This label allows to start a PullPreview environment label Feb 6, 2026
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Deploying action with PullPreview

Field Value
Latest commit 3391599
Status 🗑️ Preview destroyed
Preview URL Destroyed

View logs

@crohr crohr changed the base branch from master to codex/go February 6, 2026 09:26
Copy link

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

This pull request represents a significant architectural change to the deployment mechanism, switching from remote script execution to Docker context over SSH for compose operations. The PR introduces automatic HTTPS support via Caddy + Let's Encrypt through a new proxy_tls input option and includes comprehensive test coverage for the new features.

Changes:

  • Replaces remote shell script deployment with Docker context-based deployment over SSH
  • Adds automatic HTTPS proxying via Caddy when proxy_tls is configured
  • Implements bind mount path rewriting for relative paths under app_path, rejecting paths outside app_path
  • Extracts registry credential parsing into a dedicated module with tests
  • Removes ARM64 support, limiting to Linux AMD64 only
  • Updates build process to use UPX compression and auto-commit dist binaries
  • Adds comprehensive smoke testing workflow with database persistence validation

Reviewed changes

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

Show a summary per file
File Description
internal/pullpreview/deploy_context.go New Docker context deployment implementation with SSH host alias injection and compose config manipulation
internal/pullpreview/proxy_tls.go Automatic HTTPS proxy injection with Caddy, validates service names and detects port 443 conflicts
internal/pullpreview/registries.go Extracted registry credential parsing from pre_script.go for better testability
internal/pullpreview/instance.go Updated to support proxy_tls, forcing port 443 and HTTPS URLs when enabled; removed update script setup
internal/pullpreview/up.go Updated to pass appPath to UpdateFromTarball
internal/pullpreview/*_test.go Comprehensive test coverage for new features including bind mount rewriting, proxy TLS, and GitHub sync
internal/pullpreview/update_script.go Removed (replaced by Docker context approach)
internal/pullpreview/templates/update_script.sh.tmpl Removed (replaced by Docker context approach)
action.yml Added proxy_tls input; restricted to Linux AMD64 only with explicit error messages
.github/workflows/pullpreview.yml Added two-stage smoke test validating deployment, HTTPS URLs, and database persistence
examples/workflow-smoke/* New smoke test application with Flask, MySQL, and bind mount usage
Makefile Updated to build only amd64, added UPX compression and auto-commit workflow
go.mod/go.sum Updated Go version to 1.23.8 and oauth2 dependency to v0.29.0
README.md, AGENTS.md, MIGRATION_PLAN.md Updated documentation for proxy_tls feature and architecture changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@crohr crohr removed the pullpreview This label allows to start a PullPreview environment label Feb 6, 2026
@crohr crohr added the pullpreview This label allows to start a PullPreview environment label Feb 6, 2026
@crohr crohr removed the pullpreview This label allows to start a PullPreview environment label Feb 6, 2026
@crohr crohr added the pullpreview-multi-env This label starts a multi-env PullPreview environment label Feb 6, 2026
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Deploying action with PullPreview

Field Value
Latest commit 8fcc60e
Status ✅ Deploy successful
Preview URL http://env1-pr-112-go-context-ip-44-205-252-1.my.preview.run:80

View logs

@github-actions github-actions bot temporarily deployed to gh-255978101-env1-pr-112 February 6, 2026 15:29 Inactive
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Deploying action with PullPreview

Field Value
Latest commit 8fcc60e
Status ✅ Deploy successful
Preview URL http://env2-pr-112-go-context-ip-3-83-216-122.my.preview.run:80

View logs

@github-actions github-actions bot temporarily deployed to gh-255978101-env2-pr-112 February 6, 2026 15:29 Inactive
@github-actions github-actions bot temporarily deployed to gh-255978101-env2-pr-112 February 6, 2026 15:36 Inactive
@github-actions github-actions bot temporarily deployed to gh-255978101-env1-pr-112 February 6, 2026 15:36 Inactive
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Deploying action with PullPreview

Field Value
Latest commit 6c7425b
Variant env2
Job deploy_env2
Status 🗑️ Preview destroyed
Preview URL Destroyed

View logs

@github-actions github-actions bot temporarily deployed to gh-255978101-env2-pr-112 February 6, 2026 15:36 Inactive
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Deploying action with PullPreview

Field Value
Latest commit 6c7425b
Variant env1
Job deploy_env1
Status 🗑️ Preview destroyed
Preview URL Destroyed

View logs

@github-actions github-actions bot temporarily deployed to gh-255978101-env1-pr-112 February 6, 2026 15:37 Inactive
@crohr crohr merged commit 2d3f75d into codex/go Feb 6, 2026
7 checks passed
@crohr crohr deleted the codex/go-context branch February 6, 2026 15:48
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Deploying action with PullPreview

Field Value
Latest commit 6c7425b
Job cleanup
Status 🗑️ Preview destroyed
Preview URL Destroyed

View logs

@github-actions github-actions bot removed the pullpreview-multi-env This label starts a multi-env PullPreview environment label Feb 6, 2026
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