Page MenuHomePhorge

Tips on setting up a Phorge instance to track its own live code?
Closed, ResolvedPublic

Asked by sirocyl on Sep 17 2024, 22:58.

Details

Essentially what I'm asking about, is how we.phorge.it does it (or if that's not a good idea, or if there's a better way).

I'd like to have the repos (arcanist and Phorge itself, and any add-ons), for my running Phorge instance, inside the running Phorge instance, and checked out from itself (e.g., via Git) to the live server, basically.

Should I set up a second instance to bounce/mirror/sync clones from? Do I put the repository pointer at the server root of the Phorge install? (That... sounds like a security disaster waiting to happen.) Should I just manage my install's fork on Github or something else?

Answers

avivey
Updated 93 Days Ago

Probably not a good idea - you'll get into trouble if the site is down because of code issues. But not really that bad either.

You can't actually have the real copy of the repository used as the work-space for Phorge Repository: Phorge might make changes to the local file system, and you don't want that.
Phorge will also generally prefer bare repos, rather then regular clones.

You can have Phorge "host" the repository, and then have the real install be a clone of that repository served by Phorge. You'll need to bootstrap by cloning from somewhere else, and then update the remote uris in the installed repo.
As long as you remember to fetch everything before starting the upgrade flow, this works well enough.


At we.phorge.it, the current flow we use is something like this:
The hosted repositories are mirrored to Github (We don't have any secret code, so that's easy).
The clones in the installed version have several remotes, including both GH and Phorge. We rarely use these remotes.

Instead, when I want to update, I do this:

  • Login to server as avivey
  • I have a "staging" repository in ~/avivey/staging/<repo>
  • I use a combination of push and pull from my home machine to this staging repo (Often for RC commits, that aren't actually pushed anywhere else. You probably don't need a "staging" space otherwise).
  • In the production install, I have a remote called avivey-staging, that's looking at ~/avivey/staging/<repo>.
  • I do sudo git fetch avivey-staging (in each repo)
  • When I'm ready to do the actual change, I keep a backup (sudo git branch -f last-known-good) and update the local space (git reset --hard avivey-staging:new-target)
  • continue with the rest of the upgrade process.

New Answer

Answer

This question has been marked as closed, but you can still leave a new answer.