0

In the package.json of my Node.js project I have a couple of dependencies, here's an example:

...
"dependencies": {
  "lodash": "^4.17.4",
  "request": "^2.81.0",
  "request-promise-native": "^1.0.4",
  "my-module": "git+ssh://git@stash.my-company:7999/sub/my-module.git#v5.0.0"
},
...

my-module is an in-house module located in my company's Bitbucket and cannot be made available to the public. Our Bitbucket can only be accessed from the intranet and is not accessible via internet.

Now I want to deploy the project from a local Git repository to Azure. I follow the instructions of https://learn.microsoft.com/en-us/bot-framework/deploy-bot-local-git and would certainly be successful if I didn't have the dependency on my-module. Where I have no problem running npm install from our internal company network, it fails when deploying to Azure because there is no access to our Bitbucket repository.

I can't make our Bitbucket accessible from the outside and I can't publish my-module (e. g. in Github).

Any idea how I can solve this smartly?

Edit:
Just copy and paste is not an option, because my-module has frequent changes and I want to be able to include a new version at any time.

So I've tried this with the help of a Git submodule: I added my-module as a submodule to my project and got its content into local folder lib/my-module, which I now use in package.json. In Azure, I had to disable the update of Git submodules (because my-module's URL is our company's internal repo which cannot be accessed by Azure) with SCM_DISABLE_SUBMODULES=1. Then I was able to deploy my project successfully to Azure.

But: In Azure there is now the folder lib/my-module, but it has no content (on my local computer, the content is there). What would I have to do?

Markus
  • 1,222
  • 1
  • 13
  • 26

1 Answers1

0

You could use a file:/foo/bar path in package.json and point to a local folder where you have put the package. Then deploy both your app and that local folder.

See https://stackoverflow.com/a/38417065/46194

Klas Mellbourn
  • 42,571
  • 24
  • 140
  • 158
  • Thanks. I have concretised my question with some more experiences of Gits submodules -- please have a look at my edit above. – Markus Oct 14 '17 at 07:28
  • @Markus I don't think submodules will help you, they get their files from the git server in the same way that `git fetch` does. – Klas Mellbourn Oct 14 '17 at 07:35
  • I probably don't have any other option than to include `my-module` either by copy and paste or to publish `my-module` in any repository that is open to the public? – Markus Oct 14 '17 at 07:43
  • @Markus maybe you could set up a private npm server on your azure servers that could serve the module from your own npm server? https://blog.maartenballiauw.be/post/2015/10/13/working-with-a-private-npm-registry-in-azure-web-apps.html – Klas Mellbourn Oct 14 '17 at 08:01