pantheon-systems / terminus-build-tools-plugin

Manage multidev environments for a Pantheon site using a GitHub PR workflow.
82 stars 68 forks source link

terminus build:env:push Does not work with private git server? #448

Open benjaminbradley opened 2 years ago

benjaminbradley commented 2 years ago

We are attempting to push code to a Pantheon multidev environment, after checking it out from a repository on a private github instance. It used to work on an older version of terminus 2.x, but after upgrading to terminus 3.x, we are getting an error regarding the source repository, which should not be a part of the deployment process at this point as the code is being pushed to Pantheon's public repo, not the private source repo.

Expected behavior

terminus build:env:push ${SITE_ID}.MULTIDEV_NAME
 [notice] Pushing code to MULTIDEV_NAME using branch BRANCH_NAME.
 [notice] Running git -C /path/redacted remote add pantheon ssh://codeserver.dev.SITE_ID@codeserver.dev.SITE_ID.drush.in:2222/~/repository.git

(expected terminus to push the site to the remote environment)

Actual behavior

 [error]  Could not figure out which git repository service to use with https://PRIVATE_GITHUB/PATH/REPO.git.

Steps to reproduce the behavior

Repository is hosted on a private enterprise github instance. Check out repository, run build, etc.

terminus auth:login '--machine-token=****'
terminus build:env:push ${SITE_ID}.MULTIDEV_NAME
benjaminbradley commented 2 years ago

These appear to be related: https://github.com/pantheon-systems/terminus-build-tools-plugin/issues/366 https://github.com/pantheon-systems/terminus-build-tools-plugin/pull/414

benjaminbradley commented 2 years ago

Resolution suggested via PR here: https://github.com/pantheon-systems/terminus-build-tools-plugin/pull/449

acastro2 commented 1 year ago

Is any chance of the above PR getting merged?

namespacebrian commented 1 year ago

Tracking private Bitbucket instance support internally as FEAT-1077. There is not an ETA at this time. Tracking private Github instance support internally as FEAT-1078. There is not an ETA at this time.

Changes were requested in #449 on May 2, 2022.

ryanshoover commented 1 year ago

Until this gets fixed, there's a simple workaround that works for some of the build-tools commands like env:push (those that don't need to interact with GitHub).

Changing the origin url "tricks" build tools into thinking it's a GitHub repo.

# Set origin to a fake github url
git remote set-url origin git@github.com:fake-org/fake-repo.git

# Push with terminus
terminus build:env:push

# Reset origin url
git remote set-url origin git@github.mydomain.com:org/repo.git