projectkudu / slingshot

This project implements the Deploy To Azure button
http://azure.microsoft.com/blog/2014/11/13/deploy-to-azure-button-for-azure-websites-2/
51 stars 20 forks source link

bug: subdir support not working as expected #76

Open jdalton opened 7 years ago

jdalton commented 7 years ago

I'm wanting to add a deploy to Azure button to projects in a monorepo (multiple packages in a single repo) and wondering what the best advice is. A monorepo looks like this or this.

Update: Click here to jump to the bug.

davidebbo commented 7 years ago

Are you trying to deploy a Web App or something else? Slingshot is primarily for Web Apps. For other scenarios, there is similar support in the portal. See https://github.com/Azure/azure-quickstart-templates for a sample repo that uses that. And that one has buttons in multiple folders, which sounds like what you want.

jdalton commented 7 years ago

Are you trying to deploy a Web App or something else?

The repo is a collection of web apps (sdk examples). Each folder as a separate small web app. We're wanting to give the visitor an easy way to deploy each sample (so as if it was an individual repo). Since it's a collection having a separate repo for each would be harder to manage.

davidebbo commented 7 years ago

Please try the same pattern as in that repo, with buttons (and matching arm templates) in multiple folders.

jdalton commented 7 years ago

Cool 😎, will do!

Update: In the github deploy example how would I specify starting from a directory within the repo?

davidebbo commented 7 years ago

I thought there was some magic that automatically did this based on the folder that the button is on, but I might be wrong. @Tuesdaysgreen might remember.

ehamai commented 7 years ago

Here's an example of how it works with a sub folder: https://github.com/Tuesdaysgreen/HelloWorldDemo/tree/master/subdir

However, based on the example you're looking at, it doesn't look like you're using slingshot. It looks like you're using the official Azure deploy button, which is a different project.

davidebbo commented 7 years ago

That other link is something I pointed him to because I didn't have a slingshot sample and I figure it basically worked the same way.

jdalton commented 7 years ago

Thanks @Tuesdaysgreen, I think this will do it!

jdalton commented 7 years ago

Ah, after checking that still deploys to the root of the repo. So it will create and load https://helloworlddemo84b2.azurewebsites.net/ but not point to https://helloworlddemo84b2.azurewebsites.net/subdir/.

davidebbo commented 7 years ago

I think you are misunderstanding the feature. The bits are always deployed at the root of the site, but the point is that it is only deploying what's in the relevant folder. At least that's what it should be doing.

@Tuesdaysgreen, your test repo is not ideal because https://github.com/Tuesdaysgreen/HelloWorldDemo/blob/master/index.html and https://github.com/Tuesdaysgreen/HelloWorldDemo/blob/master/subdir/index.html are identical, so it's not obvious which one got deployed :)

jdalton commented 7 years ago

The bits are always deployed at the root of the site, but the point is that it is only deploying what's in the relevant folder. At least that's what it should be doing.

That would be rad (that's my desired behavior). I don't think that's happening at the moment. I believe it's just deploying the root in this case (since the path to subdir still resolves). I tried this on another project and it looks like it's deploying the root on it too despite originating from a nested folder.

davidebbo commented 7 years ago

Indeed, it doesn't seem to work.