-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,978 changed files
with
201,252 additions
and
55,287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,34 @@ | ||
; .deployment is actually an INI file and parsed by the following file | ||
; https://raw.githubusercontent.com/projectkudu/kudu/master/Kudu.Core/Infrastructure/IniFile.cs | ||
|
||
; Document of deployment with custom script | ||
; https://github.com/projectkudu/kudu/wiki/Customizing-deployments#deploying-with-custom-script | ||
|
||
; Document of configurable settings https://github.com/projectkudu/kudu/wiki/Configurable-settings | ||
; Runtime settings cannot be overridden in .deployment e.g. WEBSITE_NODE_DEFAULT_VERSION | ||
; More info https://github.com/projectkudu/kudu/wiki/Configurable-settings#runtime-settings | ||
|
||
# Define default node version in WEBSITE_NODE_DEFAULT_VERSION APP Setting | ||
# Find all Node.js versions from your AppService Kudu api/diagnostics/runtime | ||
# More info https://codesanook-reactjs-server-side-rendering.scm.azurewebsites.net/api/diagnostics/runtime | ||
|
||
; You can define a custom environment variable as | ||
; CUSTOM_VARIABLE = my custom variable value | ||
; and read in a deploy.ps1 script as | ||
; $Env:CUSTOM_VARIABLE | ||
|
||
; https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_powershell_exe?view=powershell-5.1#examples | ||
[config] | ||
command = deploy.cmd | ||
COMMAND = PowerShell -NoProfile -NoLogo -ExecutionPolicy Unrestricted -Command "& "$(Join-Path -Path $(Get-Location) -ChildPath deploy.ps1)" 2>&1 | Write-Output" | ||
|
||
; Set additional environment variables | ||
; Timeout in seconds | ||
; Set to one hour | ||
SCM_COMMAND_IDLE_TIMEOUT = 3600 | ||
|
||
; Variables for MSBuild | ||
MSBUILD_PATH = D:\Program Files (x86)\MSBuild-16.4\MSBuild\Current\Bin\MSBuild.exe | ||
SOLUTION_PATH = src/Orchard.sln | ||
|
||
; For Azure deployment, we use custom MS Build at root of the project. | ||
PROJECT_PATH = Orchard.proj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Build Crowdin Translation Packages | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 6 * * *" | ||
|
||
jobs: | ||
build-crowdin-translation-packages: | ||
defaults: | ||
run: | ||
shell: pwsh | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Orchard CMS | ||
uses: andrii-bodnar/crowdin-request-action@aac9a865d62b37060b0ce530db5ac5cfca02dd2c # 0.0.2 | ||
with: | ||
route: POST /projects/{projectId}/translations/builds | ||
projectId: 46524 | ||
env: | ||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }} | ||
|
||
- name: Orchard CMS Gallery | ||
uses: andrii-bodnar/crowdin-request-action@aac9a865d62b37060b0ce530db5ac5cfca02dd2c # 0.0.2 | ||
with: | ||
route: POST /projects/{projectId}/translations/builds | ||
projectId: 63766 | ||
env: | ||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Compile | ||
# Compiles the solution and runs unit tests. | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- dev | ||
- 1.10.x | ||
|
||
jobs: | ||
compile-dotnet: | ||
name: Compile .NET solution | ||
defaults: | ||
run: | ||
shell: pwsh | ||
runs-on: windows-latest | ||
steps: | ||
- name: Clone repository | ||
uses: actions/[email protected] | ||
|
||
- name: Restore NuGet packages | ||
run: nuget restore src/Orchard.sln | ||
|
||
- name: Add msbuild to PATH | ||
uses: microsoft/setup-msbuild@v2 | ||
|
||
- name: Compile | ||
run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:MvcBuildViews=true /p:TreatWarningsAsErrors=true -WarnAsError | ||
|
||
- name: Test | ||
run: msbuild Orchard.proj /m /v:minimal /t:Test | ||
|
||
compile-node: | ||
name: Compile client-side assets | ||
defaults: | ||
run: | ||
shell: pwsh | ||
runs-on: windows-latest | ||
steps: | ||
- name: Clone repository | ||
uses: actions/[email protected] | ||
|
||
- name: Setup NodeJS | ||
uses: actions/[email protected] | ||
with: | ||
node-version: '7' | ||
|
||
- name: Setup NPM packages | ||
working-directory: ./src | ||
run: | | ||
npm install --loglevel warn | ||
# Install gulp globally to be able to run the rebuild task, using the same version as in the project. | ||
$gulpVersion = (Get-Content Package.json -Raw | ConvertFrom-Json).devDependencies.gulp | ||
Start-Process npm -NoNewWindow -Wait -ArgumentList "install gulp@$gulpVersion -g --loglevel warn" | ||
- name: Rebuild client-side assets | ||
working-directory: ./src | ||
run: | | ||
gulp rebuild | ||
git add . # To make line ending changes "disappear". | ||
$gitStatus = (git status --porcelain) | ||
if ($gitStatus) | ||
{ | ||
throw ("Client-side assets are not up-to-date. Please run 'gulp rebuild' and commit the changes.`n" + | ||
[System.String]::Join([System.Environment]::NewLine, $gitStatus)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: SpecFlow tests | ||
# Compiles the solution and runs unit tests, as well the SpecFlow tests on the main development branches. | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' # Every day at midnight. | ||
|
||
jobs: | ||
compile: | ||
name: SpecFlow tests | ||
defaults: | ||
run: | ||
shell: pwsh | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
branch: [dev, 1.10.x] | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
ref: ${{ matrix.branch }} | ||
|
||
- name: Restore NuGet packages | ||
run: nuget restore src/Orchard.sln | ||
|
||
- name: Add msbuild to PATH | ||
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 | ||
|
||
- name: Compile | ||
run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:MvcBuildViews=true /p:TreatWarningsAsErrors=true -WarnAsError | ||
|
||
- name: Test | ||
run: msbuild Orchard.proj /m /v:minimal /t:Test | ||
|
||
- name: Spec | ||
run: msbuild Orchard.proj /m /v:minimal /t:Spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[Reflection.Assembly]::LoadWithPartialName("System.Xml") | Out-Null | ||
[Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq") | Out-Null | ||
[System.Xml.Linq.XNamespace]$ns1 = "urn:schemas-microsoft-com:asm.v1" | ||
|
||
$currentPath = (Get-Item -Path ".\").FullName | ||
$orchardWebConfigFullPath = $currentPath+"\src\Orchard.Web\Web.Config" | ||
[XML] $orchardWebConfig = Get-Content ($orchardWebConfigFullPath) | ||
$configFiles = Get-ChildItem -Path ($currentPath +"\src\") -Filter web.config -Recurse -ErrorAction SilentlyContinue -Force | ||
foreach ($configFile in $configFiles) { | ||
$configFullPath = $configFile.FullName | ||
Write-Host "Processing $configFullPath ..." | ||
|
||
if ($configFullPath.ToLower().EndsWith("\orchard.web\web.config")) { #skip orchard.web config files | ||
continue | ||
} | ||
[XML] $projectWebConfig = Get-Content ($configFullPath) | ||
$elements = $projectWebConfig.configuration.runtime.assemblyBinding.dependentAssembly | ||
foreach ($element in $elements){ | ||
Write-Host "Checking" $element.assemblyIdentity.name | ||
$hasBinding = $orchardWebConfig.configuration.runtime.assemblyBinding.dependentAssembly.assemblyIdentity.Where({ $_.name -eq $element.assemblyIdentity.name -and $_.publicKeyToken -eq $element.assemblyIdentity.publicKeyToken -and $_.culture -eq $element.assemblyIdentity.culture }, 'First').Count -gt 0 | ||
if (-not $hasBinding){ | ||
# add the node in $webConfig | ||
Write-Host "Adding" $element.assemblyIdentity.name | ||
$newNode = $orchardWebConfig.ImportNode($element, $true); | ||
$orchardWebConfig.configuration.runtime.assemblyBinding.AppendChild($newNode) | ||
Write-Host "Added " $element.assemblyIdentity.name | ||
} else { | ||
Write-Host "Skipped" $element.assemblyIdentity.name | ||
} | ||
} | ||
Write-Host "Processed $configFullPath ..." | ||
} | ||
|
||
$orchardWebConfig.Save($orchardWebConfigFullPath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
Set-StrictMode -Version Latest | ||
|
||
# Continue a build process even though there is a warning wrote to std err. | ||
# We will check exit code in Invoke-ExternalCommand to design whether it fail or not | ||
$ErrorActionPreference = "Continue" | ||
|
||
function Add-NpmToPathVariable { | ||
$path = "$env:Appdata\npm" | ||
$escapedPath = [Regex]::Escape($path) | ||
|
||
# Remove existing npm path safe to add npm path again | ||
$paths = $env:Path -split ';' | Where-Object { | ||
$_ -notmatch "^$escapedPath\\?$" | ||
} | ||
|
||
# Update a path variable to this session | ||
$env:Path = ($paths + $path) -join ";" # array + element item | ||
} | ||
|
||
function Invoke-ExternalCommand { | ||
param ( | ||
[Parameter(Mandatory = $true)] [scriptblock] $ScriptBlock | ||
) | ||
|
||
# Displays an error message and continue executing if there is a standard error. | ||
# This is because there are some external command tools write warning message to standard error. | ||
# Use Write-Output also fix "Window title cannot be longer than 1023 characters" issue | ||
# https://github.com/projectkudu/kudu/issues/2635 | ||
& $ScriptBlock 2>&1 | Write-Output | ||
|
||
# If last exit code is not 0, throw an exception to stop a script | ||
if ($LastExitCode) { | ||
throw "Failed with exit code = $LastExitCode and command = $($ScriptBlock.ToString())" | ||
} | ||
} | ||
|
||
function Write-EnviromentValue { | ||
param ( | ||
[Parameter(Mandatory = $true)] [String[]] $EnvironmentName | ||
) | ||
|
||
"----------------- Begin of environment variables ---------------------------------" | ||
Get-Item -Path Env:* | Where-Object { | ||
$EnvironmentName -contains $_.Name | ||
} | Format-Table Name, Value -Wrap | ||
|
||
"----------------- End of environment variables ---------------------------------" | ||
} | ||
|
||
function Install-Yarn { | ||
"Verify if yarn installed" | ||
if (Get-Command -Name yarn -ErrorAction Ignore) { | ||
"Updating yarn as a global tool to the latest version" | ||
# https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd#parameters | ||
# issue https://github.com/projectkudu/kudu/issues/2635 | ||
Invoke-ExternalCommand -ScriptBlock { npm update yarn -g } | ||
} | ||
else { | ||
"Installing yarn as a global tool" | ||
Invoke-ExternalCommand -ScriptBlock { npm install yarn -g } | ||
Add-NpmToPathVariable | ||
} | ||
} | ||
|
||
function Install-KuduSync { | ||
"Verify if kudusync installed" | ||
if (Get-Command -Name kudusync -ErrorAction Ignore) { | ||
"Updating kudusync as a global tool to the latest version" | ||
# https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd#parameters | ||
# issue https://github.com/projectkudu/kudu/issues/2635 | ||
Invoke-ExternalCommand -ScriptBlock { npm update kudusync -g } | ||
} | ||
else { | ||
"Installing kudusync as a global tool" | ||
Invoke-ExternalCommand -ScriptBlock { npm install kudusync -g } | ||
Add-NpmToPathVariable | ||
} | ||
} | ||
|
||
Export-ModuleMember -Function Invoke-ExternalCommand | ||
Export-ModuleMember -Function Write-EnviromentValue | ||
Export-ModuleMember -Function Install-Yarn | ||
Export-ModuleMember -Function Install-KuduSync |
Oops, something went wrong.