diff --git a/.gitignore b/.gitignore index 940794e..fdec681 100644 --- a/.gitignore +++ b/.gitignore @@ -1,288 +1,19 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +################################################################################ +# ignore mac os x and windows files +################################################################################ -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates +Thumbs.db +.DS_Store +~\$* -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs +################################################################################ +# ignore other files here +################################################################################ -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -# Visual Studio 2015 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* +################################################################################ +# not ignore .gitignore +################################################################################ -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ -**/Properties/launchSettings.json - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Typescript v1 declaration files -typings/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# JetBrains Rider -.idea/ -*.sln.iml - -# CodeRush -.cr/ - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs +!.gitignore \ No newline at end of file diff --git a/ApplicationModernization/.gitignore b/ApplicationModernization/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/DataModernization/.gitignore b/DataModernization/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/InfrastructureModernization/.gitignore b/InfrastructureModernization/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/PublishingGuidelines/LICENSE b/PublishingGuidelines/LICENSE new file mode 100644 index 0000000..2107107 --- /dev/null +++ b/PublishingGuidelines/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/PublishingGuidelines/README.md b/PublishingGuidelines/README.md new file mode 100644 index 0000000..d1d2663 --- /dev/null +++ b/PublishingGuidelines/README.md @@ -0,0 +1,153 @@ +# Microsoft Open Source Labs Publishing Guidelines + +## Table of Contents + + * [Microsoft Open Source Labs Publishing Guidelines](#microsoft-open-source-labs-publishing-guidelines) + * [Minimum Requirements](#minimum-requirements) + * [Content](#content) + * [TOC script](#toc-script) + * [How to create a lab repository?](#how-to-create-a-lab-repository) + * [Git repository best practices](#git-repository-best-practices) + * [Development Branch](#development-branch) + * [Staging Branch](#staging-branch) + * [Master Branch](#master-branch) + * [Tags / Deployments](#tags--deployments) + * [Deploy script](#deploy-script) + * [Contributing](#contributing) + + +## Minimum Requirements + +Each laboratory needs to include the following files as a minimum to be deployed: + +1. A *LICENSE* file with an MIT License template. +2. A *README.md* Markdown file with the description (step-by-step) of the laboratory. You can find a description of the Markdown syntax [here](https://guides.github.com/features/mastering-markdown/). +3. Any other supporting documents, file, source code, etc. + +## Storing of the labs + +### Naming conventions + +The laboratory name in the directory should be stored without any spaces or symbols in a Upercase first mode. For example the lab *Containers with ACS in Azure* name should be stored as `ContainersWithACSInAzure`. + +### Storage conventions + +Each lab should be stored in a separate folder structure in the repository inside one of the following directories: + +* ApplicationModernization +* InfrastructureModernization +* DataModernization + +For example a laboratory on *Containers with ACS in Azure* should be stored in `ApplicationModernization/ContainersWithACSInAzure`. + +## Content + +In order to maintain a standardized repository of laboratories, there is some content that needs to be included in every laboratory. This sections are required: + +
Hello world github/linguist#1 cool, and #1!
'" +gh_toc_md2html() { + local gh_file_md=$1 + curl -s --user-agent "$gh_user_agent" \ + --data-binary @"$gh_file_md" -H "Content-Type:text/plain" \ + https://api.github.com/markdown/raw +} + +# +# Is passed string url +# +gh_is_url() { + if [[ $1 == https* || $1 == http* ]]; then + echo "yes" + else + echo "no" + fi +} + +# +# TOC generator +# +gh_toc(){ + local gh_src=$1 + local gh_src_copy=$1 + local gh_ttl_docs=$2 + + if [ "$gh_src" = "" ]; then + echo "Please, enter URL or local path for a README.md" + exit 1 + fi + + + # Show "TOC" string only if working with one document + if [ "$gh_ttl_docs" = "1" ]; then + + echo "Table of Contents" + echo "=================" + echo "" + gh_src_copy="" + + fi + + if [ "$(gh_is_url "$gh_src")" == "yes" ]; then + gh_toc_load "$gh_src" | gh_toc_grab "$gh_src_copy" + else + gh_toc_md2html "$gh_src" | gh_toc_grab "$gh_src_copy" + fi +} + +# +# Grabber of the TOC from rendered html +# +# $1 — a source url of document. +# It's need if TOC is generated for multiple documents. +# +gh_toc_grab() { + # if closedfoo1
+ #
+ # became: The command foo1
+ sed -e ':a' -e 'N' -e '$!ba' -e 's/\n<\/h/<\/h/g' |
+ # find strings that corresponds to template
+ grep -E -o '//' | sed 's/<\/code>//' |
+ # now all rows are like:
+ # ... .*<\/h/)+2, RLENGTH-5)"](" gh_url substr($0, match($0, "href=\"[^\"]+?\" ")+6, RLENGTH-8) ")"}' | sed 'y/+/ /; s/%/\\x/g')"
+}
+
+#
+# Returns filename only from full path or url
+#
+gh_toc_get_filename() {
+ echo "${1##*/}"
+}
+
+#
+# Options hendlers
+#
+gh_toc_app() {
+ local app_name="gh-md-toc"
+
+ if [ "$1" = '--help' ] || [ $# -eq 0 ] ; then
+ echo "GitHub TOC generator ($app_name): $gh_toc_version"
+ echo ""
+ echo "Usage:"
+ echo " $app_name src [src] Create TOC for a README file (url or local path)"
+ echo " $app_name - Create TOC for markdown from STDIN"
+ echo " $app_name --help Show help"
+ echo " $app_name --version Show version"
+ return
+ fi
+
+ if [ "$1" = '--version' ]; then
+ echo "$gh_toc_version"
+ return
+ fi
+
+ if [ "$1" = "-" ]; then
+ if [ -z "$TMPDIR" ]; then
+ TMPDIR="/tmp"
+ elif [ -n "$TMPDIR" -a ! -d "$TMPDIR" ]; then
+ mkdir -p "$TMPDIR"
+ fi
+ local gh_tmp_md
+ gh_tmp_md=$(mktemp $TMPDIR/tmp.XXXXXX)
+ while read input; do
+ echo "$input" >> "$gh_tmp_md"
+ done
+ gh_toc_md2html "$gh_tmp_md" | gh_toc_grab ""
+ return
+ fi
+
+ for md in "$@"
+ do
+ echo ""
+ gh_toc "$md" "$#"
+ done
+
+ echo ""
+ echo "Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)"
+}
+
+#
+# Entry point
+#
+gh_toc_app "$@"
diff --git a/PublishingGuidelines/skeleton/template.md b/PublishingGuidelines/skeleton/template.md
new file mode 100644
index 0000000..40ad989
--- /dev/null
+++ b/PublishingGuidelines/skeleton/template.md
@@ -0,0 +1,58 @@
+# Laboratory Title
+
+
+## Table of Contents
+
+The Table of Contents for the Laboratory document.
+
+
+## Overview and Pre-Requisites
+
+An Overview of the scope of the lab, any pre-requisites and topics covered on the lab should be clearly explained here.
+
+
+### Overview
+
+Overview of the lab.
+
+
+### Pre-requisites
+
+Pre-requisites of the lab.
+
+
+### Topics Covered
+
+Topics covered.
+
+
+## Laboratory Section
+
+Here is where the content of the lab is added. Several sections and/or subsections can be added.
+
+
+## Conclusion
+
+A conclusion detailing what was done and any follow-up steps.
+
+
+## End your Lab
+
+Here it should be explained how to clear, delete and release any used resources so the user doesn't get billed after the lab.
+
+
+## Additional Resources and References
+
+Any additional resource, links, references should be added here.
+
+
+### Useful Links
+
+Any useful link for the user.
+
+
+## License
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Licensed under the [MIT](LICENSE) License.
\ No newline at end of file
diff --git a/README.md b/README.md
index 72f1506..dd30fff 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,6 @@
+# Microsoft Open Source Labs Publishing Guidelines
-# Contributing
+## Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
@@ -12,3 +13,5 @@ provided by the bot. You will only need to do this once across all repos using o
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
+
+Please report any bug or issue on the labs trough the [GitHub Issues Page](https://github.com/Microsoft/OpenSourceLabs/issues) page.
\ No newline at end of file