To work with Openshift's Node.js platform and to be able to pull or push code to it, Openshift provide you with a Git URL. Openshift require the repository to be structured such that the package.json file is located in the project root.
For local development I've been using Visual Studio 2013 with the Node.js Tools successfully. I also have Windows Git tools installed. I am aware of how a Visual Studio project may be added to Git source control.
I would like to use Visual Studio to work with the Git repository that is pulled from Openshift. The way I would intend to set things up initially is to pull the remote Openshift repository into a locally created Visual Studio solution's repository for my new Node.js project, fix any conflicts, then commit and push.
The problem I have is that the way Visual Studio wants to arrange its files relative to the Git project root conflicts with how Openshift wants the files to be arranged in the repository. Specifically, as mentioned, Openshift expects the package.json to be located in the project root. Visual Studio, however, given its Solution/Project hierarchy, wants the Solution folder to be the Git repository root, but with the package.json in the project subdirectory. I have tried running git init within the project subdirectory (such that the repository root is the project folder rather than the parent solution), but then Visual Studio doesn't recognise that the project is under source control any more.
What are the options I have to be able to synchronise between a VS project and Openshift using Git? The only solution that I can think of so far is to just place a package.json file into the root of the solution which VS would ignore, but Openshift would use. This package.json would prefix .js files it references with the project subdirectory, e.g. main: app.js would become main: someproject\app.js.
Aucun commentaire:
Enregistrer un commentaire