From 95d03ab7b16dca8ad80025d4b8ca05d17dc095b7 Mon Sep 17 00:00:00 2001 From: Jeremy Friesen Date: Wed, 10 Jan 2024 14:57:12 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Configure=20Knapsack=20to=20Use?= =?UTF-8?q?=20Hyku=20Prime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit documents the need for Knapsack to reference a branch; as well as provides documentation for doing so. --- README.md | 29 +++++++++++++++++++++++++++-- hyrax-webapp | 2 +- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 379300e..ad7ea31 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ In your Repository host of choice, create a new (and for now empty) repository. - `$NEW_REPO_URL` is the location of your application's knapsack git project (e.g. https://github.com/my-org/my_org_knapsack) ```bash -git clone https://github.com/scientist-softserv/adventist_knapsack $PROJECT_NAME_knapsack +git clone https://github.com/samvera-labs/hyku_knapsack $PROJECT_NAME_knapsack cd $PROJECT_NAME_knapsack git remote rename origin prime git remote add origin $NEW_REPO_URL @@ -63,6 +63,8 @@ git branch -M main git push -u origin main ``` +Naming the `samvera-labs/hyku_knapsack` as `prime` helps clarify what we mean. In conversations about Hyku instances, invariably we use the language of Prime to reflect what's in Samvera's repositories. By using that language for remotes, we help reinforce the concept that `https://github.com/samvera/hyku` is Hyku prime and `https://github.com/samvera-labs/hyku_knapsack` is Knapsack prime. + #### Fork on Github If you choose to fork Knapsack, be aware that this will impact how you manage pull requests via Github. Namely as you submit PRs on your Fork, the UI might default to applying that to the fork's origin (e.g. Knapsack upstream). @@ -76,7 +78,30 @@ git remote add prime https://github.com/samvera-labs/hyku_knapsack ### Hyku and HykuKnapsack -You run your Hyku application by way of the HykuKnapsack. As mentioned, the HykuKnapsack contains your application's relevant information for running an instance of Hyku. A newly cloned knapsack will have an empty `./hyrax-webapp` directory. That is where the Hyku application will exist. The version of Hyku is managed via a [Git submodule](https://git-scm.com/docs/git-submodule). +You run your Hyku application by way of the HykuKnapsack. As mentioned, the HykuKnapsack contains your application's relevant information for running an instance of Hyku. + +There are two things you need to do: + +- Ensure you have the [reserved branch](#reserved-branch) +- Initialize the [Hyku submodule](#hyku-submodule) + +#### Reserved Branch + +Knapsack turns the assumptions of a Rails engine upside-down; the application overlays traditional engines, but Knapsack overlays the application. As such the Gemfile declared in Hyku does some bundler trickery. + +In the `$PROJECT_NAME_knapsack` directory, you need to run the following: + +```bash +git fetch prime +git checkout prime/required_for_knapsack_instances +git switch -c required_for_knapsack_instances +``` + +For Hyku to build with Knapsack, we need a local branch named `required_for_knapsack_instances`. _Note:_ As we work more with Knapsack maintenance there may be improvements to this shim. + +#### Hyku Submodule + +A newly cloned knapsack will have an empty `./hyrax-webapp` directory. That is where the Hyku application will exist. The version of Hyku is managed via a [Git submodule](https://git-scm.com/docs/git-submodule). To bring that application into your knapsack, you will need to initialize the Hyku submodule: diff --git a/hyrax-webapp b/hyrax-webapp index 703917b..391a7a3 160000 --- a/hyrax-webapp +++ b/hyrax-webapp @@ -1 +1 @@ -Subproject commit 703917bcc49737925a683b4cfa93417533749736 +Subproject commit 391a7a32faec0cd1f56af70c171833f27b617dc3