Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VS2017 demo: building containers from Sitecore images #1

Merged
merged 9 commits into from
Mar 29, 2018

Conversation

Ben-m-s
Copy link
Contributor

@Ben-m-s Ben-m-s commented Mar 26, 2018

Included Changes:

  • VS2017 Demo with the following features:
    • Website folder as volume with files stored in the development machine, at debugging time (no need for synchronization)
    • Website folder embedded in the image at runtime.
    • Website folder files automatically copied from image to Development environment (if missing) (same as databases).
    • Attach to IIS process from VS2017 for debugging

Caveats:

  • Not documented yet
  • Requires changes that have just been submitted as pull request with the following features:
    • Data folder out of Website folder
    • Data folder defined as a volume for persistence and to support license.xml file out of the image
    • Data folder is emptied to support becoming a volume
    • license.xml file is deleted from the image (along with other content in Data folder)
    • Support to make Website folder also a volume (only at debugging time)

@Ben-m-s
Copy link
Contributor Author

Ben-m-s commented Mar 26, 2018

Pull request with dependencies: Sitecore/docker-images#13

@jeanfrancoislarente
Copy link
Member

Awesome work @Ben-m-s - thanks for the contribution. I've posted something on #docker just to get some input from the Community on how we could structure this repo. Please weigh in there! If any changes are recommended from that discussion you can make a quick refactor and pushÉ

Copy link
Member

@jeanfrancoislarente jeanfrancoislarente left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mentioned on Slack that docker-demo/demo would be redundant. I'm not sure if you noticed - you have VS2017/Website/Website.
Any chance we can rename the first Website to be ExampleWebsite or some solution name that might be more relevant?
Not critical, just a thought.

Copy link
Member

@jeanfrancoislarente jeanfrancoislarente left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be ok for .gitattributes and .gitignore to be at the root of the repo

@@ -0,0 +1,271 @@
## Ignore Visual Studio temporary files, build results, and

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can put at the root of the repo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider governance? This repository will end up having different projects with different technologies. File types and folders to be ignored may be different among them. Also, you may want to grant permissions to collaborators based on the demos/technologies to review/approve. Keeping the ".gitignore" and the ".gitattributes" local to projects provides easier governance and less dependencies interactions among projects. For instance, this demo is ignoring a whole folder named "storage", this may not be wanted in other project made by somebody else. Happy to change it if you still prefer it. :-)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm confused. Shall I do the changes? or, will the change request be removed?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, leave as-is. I agree with you to leave it.

@Ben-m-s
Copy link
Contributor Author

Ben-m-s commented Mar 27, 2018

I do agree about the redundancy and am happy to change it into something that provides more value. The demo is to showcase how to create a Sitecore project with VS2017. Using Demo, Example, Sample, VS2017, Site or Website is redundant as well.

As it is a project without actual .NET code, what if We call it "Seed" or "Scaffolding"? Other ideas?

@Ben-m-s
Copy link
Contributor Author

Ben-m-s commented Mar 27, 2018

Some documentation has been added.


## Development Environment Setup

1. Clone [this repository](https://github.com/Ben-m-s/docker-demo) into a folder such as �c:\Docker\Sitecore\docker-demo� (next steps will asume this folder has been used):
Copy link
Contributor

@sshushliapin sshushliapin Mar 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be https://github.com/Sitecore/docker-demo instead of https://github.com/Ben-m-s/docker-demo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. It should. The same way that all paths will need to change in order to accommodate naming changes being currently discussed in Slack. I used that temporary URL in order to facilitate the testing before the pull takes place.

Thanks for flagging it up. It will work as a reminder.

Please let me know whether is better to change it already.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed - If it's a PR to Sitecore/docker-demo but the README points to Ben-m-s/docker-demo I'd say it should be changed before getting merged

Copy link
Contributor Author

@Ben-m-s Ben-m-s Mar 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The URL has been updated in the README file. :-)

</ItemGroup>
<ItemGroup>
<Content Include="Global.asax" />
<Content Include="Web.config" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having Web.config as content will overwrite Sitecore's web.config. Should mark this as "None" and generate transform files if necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether I understand the requirement. This sample is showcasing a Sitecore concrete project. All projects (Sitecore sites), as far as I know, need to modify their Web.config file. A typical example is using while developing and something else in a production release.

It is also typical to use standard VS transform files such as "Web.Debug.config" for those transformations, as it is done in this project (setting the "Web.config" file as content). With this settings, the Web.config in the container is overwritten with the transformed version generated by the project.

Can you please elaborate a bit more about what change should be done?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just thinking of the "Habitat way" where you don't deploy the Web.config file but apply transforms using gulp. Helps during upgrades and prevents overwriting of Sitecore-specific web.config items. I'm not sure what it would mean when deploying to containers.

If you look at Habitat Website Project the web project has the web.config set to None.

<None Include="web.config" /> <None Include="web.Debug.config"> <DependentUpon>web.config</DependentUpon> </None> <None Include="web.Release.config"> <DependentUpon>web.config</DependentUpon> </None>

Then in the Habitat project, the gulpfile takes care of applying all of the transforms required by the various projects:

gulp.task("04-Apply-Xml-Transform")

Since this sample project is specific to one version of Sitecore it's probably okay to leave it like that, keep in mind that your web.config will overwrite the installed web.config and any Sitecore-specific items will be lost if not also included in your project's web.config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see your point now. It is actually a good idea.

This sample is meant to be simple. I wanted to use the bare minimum infrastructure to integrate Docker in VS2017 which is the main development environment for Sitecore at the moment (at least the one we use in ClearPeople, where I work). The intention is showcasing the bare minimum required to run Sitecore in a container.

I am thinking of a new demo including a TDS sample project and gulp with some automation such as automatically updating the "host" file in de development environment in order to access the Sitecore site through its URL (instead of the IP). Once we have gulp, the web.config transform can be easily included.

Other samples may include installation of modules such as SXA or EXM, or other proposals from the community that we find interesting.

May I suggest that these ideas are added to the list of "Issues/enhancements"?

Anyway, the progress will depend on time availability, which is not guaranteed, so let's progress bit by bit.

@Ben-m-s
Copy link
Contributor Author

Ben-m-s commented Mar 28, 2018

The folder structure and the solution name, along with its associated references in the README file have been updated following discussions in Slack.

@jeanfrancoislarente jeanfrancoislarente merged commit d945294 into Sitecore:master Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants