Skip to content

Commit cd22fee

Browse files
committed
Merge branch 'master' into Automatic_version_update_dependabot
2 parents 3e546f6 + 79e5733 commit cd22fee

File tree

664 files changed

+28749
-3450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

664 files changed

+28749
-3450
lines changed

.gitguardian.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
secret:
2+
ignored-matches:
3+
- match: 2cd876d916d5d06984da35b99466857b4e9b19ab643b0e2eb15d4faf29f3ba44
4+
name: Generic High Entropy Secret - DigitalLearningSolutions.Data.Migrations/202310131115_AddFreshdeskApikeyConfigValue.cs
5+
version: 2

.github/dependabot.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "nuget"
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "daily"
12+
open-pull-requests-limit: 10
13+
target-branch: "Automatic_version_update_dependabot"
14+
ignore:
15+
# Ignore updates to packages that start with 'Wildcards'
16+
- dependency-name: "Microsoft.FeatureManagement.AspNetCore*"
17+
# Ignore some updates to the package
18+
- dependency-name: "Microsoft.VisualStudio.Web.CodeGeneration.Design"
19+
versions: [">7.0.0"]
20+
- dependency-name: "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
21+
versions: [">7.0.0"]
22+
- dependency-name: "Microsoft.AspNetCore.Mvc.Testing"
23+
versions: [">7.0.0"]
24+
- dependency-name: "Selenium.WebDriver.ChromeDriver"
25+
versions: ">=113.0.5672.1278" # Recommended version
26+
# For all packages, ignore all patch updates
27+
#- dependency-name: "*"
28+
# update-types: ["version-update:semver-patch"]
29+
30+
# Configuration for npm
31+
- package-ecosystem: "npm"
32+
directory: "/DigitalLearningSolutions.Web/" # Location of package manifests
33+
schedule:
34+
interval: "daily"
35+
target-branch: "Automatic_version_update_dependabot"
36+
# - "dependencies"
37+
open-pull-requests-limit: 7
38+
ignore:
39+
- dependency-name: "*"
40+
update-types: ["version-update:semver-major"]
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
name: Deploy DLS DEV to IIS
2+
3+
env:
4+
# set apppool and site name from IIS
5+
AppPoolName : dlsweb-dev
6+
SiteName : 'dls-dev'
7+
# set to site files. In this case, the part of the path after E:/web/
8+
SitePath : dls-dev
9+
DOTNET_INSTALL_DIR: '~/AppData/Local/Microsoft/dotnet'
10+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
11+
on:
12+
push:
13+
branches:
14+
- 'DEV'
15+
workflow_dispatch:
16+
17+
jobs:
18+
deploy-to-dev:
19+
20+
runs-on: self-hosted
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Setup .NET Core SDK 6.0
26+
uses: actions/setup-dotnet@v4
27+
with:
28+
dotnet-version: 6.0.x
29+
- name: Setup node
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 20
33+
34+
- name: Add TechnologyEnhancedLearning as nuget package source
35+
run: |
36+
$nugetSources = dotnet nuget list source | Out-String;
37+
if(!($nugetSources -like "*TechnologyEnhancedLearning*"))
38+
{
39+
dotnet nuget add source https://pkgs.dev.azure.com/e-LfH/_packaging/LearningHubFeed/nuget/v3/index.json --name TechnologyEnhancedLearning --username 'kevin.whittaker' --password ${{ secrets.AZURE_DEVOPS_PAT }} --store-password-in-clear-text;
40+
}
41+
42+
- name: Dotnet publish
43+
run: |
44+
dotnet publish DigitalLearningSolutions.sln -c Release -o E:/web/${{env.SitePath}}-NEW
45+
46+
- name: Copy app_offline and web config to publish folder
47+
run: |
48+
Copy-Item E:/web/Offline/app_offline.htm E:/web/${{env.SitePath}}-NEW -Recurse -Force;
49+
Copy-Item E:/web/Offline/app_offline.htm E:/web/${{env.SitePath}} -Recurse -Force;
50+
if (Test-Path -Path E:/web/${{env.SitePath}})
51+
{
52+
Remove-Item -Path 'E:/web/${{env.SitePath}}-NEW/web.config' -Force;
53+
Copy-Item E:/web/${{env.SitePath}}/web.config E:/web/${{env.SitePath}}-NEW -Recurse -Force;
54+
}
55+
if (Test-Path -Path E:/web/${{env.SitePath}}-PREVIOUS){
56+
Remove-Item -LiteralPath 'E:/web/${{env.SitePath}}-PREVIOUS' -Force -Recurse
57+
}
58+
59+
- name: Sleep for 5 seconds
60+
run: Start-Sleep -s 5
61+
62+
- name: Switch deployment and published folders restarting apppool/webapp if necessary
63+
run: |
64+
65+
Import-Module WebAdministration;
66+
$currentRetry = 1;
67+
$backupRetry = 1;
68+
$success = $false;
69+
$backupSuccess = $false;
70+
do{
71+
echo "Attempting folder rename $currentRetry"
72+
try {
73+
Rename-Item -Path 'E:/web/${{env.SitePath}}' -NewName '${{env.SitePath}}-PREVIOUS'
74+
Rename-Item -Path 'E:/web/${{env.SitePath}}-NEW' -NewName '${{env.SitePath}}'
75+
$success = $true;
76+
}
77+
catch {
78+
echo "Rename failed due to following Catch error:`n"
79+
echo $PSItem.Exception.Message
80+
echo "`n"
81+
Start-Sleep -s 2
82+
$currentRetry = $currentRetry + 1;
83+
}
84+
finally {
85+
if ($currentRetry -ge 10) {
86+
echo "Rename keeps failing; restarting AppPool/Site as last resort`n"
87+
echo "Attempting to restart AppPool`n"
88+
do{
89+
$status = Get-WebAppPoolState -name '${{env.AppPoolName}}'
90+
if ($status.Value -eq "Stopped") {
91+
start-WebAppPool ${{env.AppPoolName}}
92+
echo "AppPool restarted`n---------`n"
93+
$backupSuccess = $true;
94+
}
95+
else {
96+
if ($backupRetry -ge 10) {
97+
throw "AppPool restart keeps failing."
98+
}
99+
echo "AppPool not stopped yet; Re-attempt #$backupRetry"
100+
Start-Sleep -s 10
101+
$backupRetry = $backupRetry + 1;
102+
}
103+
}
104+
while (!$backupSuccess -and $backupRetry -le 10)
105+
$backupRetry = 1;
106+
$backupSuccess = $false;
107+
echo "Attempting to restart Website`n"
108+
do{
109+
$status = Get-WebsiteState -name '${{env.SiteName}}'
110+
if ($status.Value -eq "Stopped") {
111+
start-iissite ${{env.SiteName}}
112+
echo "Website restarted`n---------`n"
113+
$backupSuccess = $true;
114+
}
115+
else {
116+
if ($backupRetry -ge 10) {
117+
throw "Website restart keeps failing. Please look into Server"
118+
}
119+
echo "Website not stopped yet; Re-attempt #$backupRetry"
120+
Start-Sleep -s 10
121+
$backupRetry = $backupRetry + 1;
122+
}
123+
}
124+
while (!$backupSuccess -and $backupRetry -le 10)
125+
}
126+
}
127+
}
128+
while (!$success -and $currentRetry -le 10)
129+
130+
- name: Remove Offline and remove previous deployment folder
131+
run: |
132+
if (Test-Path -Path 'E:/web/${{env.SitePath}}-PREVIOUS')
133+
{
134+
Remove-Item -LiteralPath 'E:/web/${{env.SitePath}}-PREVIOUS' -Force -Recurse
135+
}
136+
Remove-Item 'E:/web/${{env.SitePath}}/app_offline.htm' -Force
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Deploy DLS Production to IIS
2+
3+
env:
4+
# set apppool and site name from IIS
5+
AppPoolName : dlsweb-v2
6+
SiteName : 'v2'
7+
# set to site files. In this case, the part of the path after E:/web/
8+
SitePath : dlsweb-v2
9+
DOTNET_INSTALL_DIR: '~/AppData/Local/Microsoft/dotnet'
10+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
11+
on:
12+
workflow_dispatch:
13+
14+
jobs:
15+
deploy-to-production:
16+
17+
runs-on: self-hosted
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Setup .NET Core SDK 6.0
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: 6.0.x
26+
- name: Setup node
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
30+
31+
- name: Add TechnologyEnhancedLearning as nuget package source
32+
run: |
33+
$nugetSources = dotnet nuget list source | Out-String;
34+
if(!($nugetSources -like "*TechnologyEnhancedLearning*"))
35+
{
36+
dotnet nuget add source https://pkgs.dev.azure.com/e-LfH/_packaging/LearningHubFeed/nuget/v3/index.json --name TechnologyEnhancedLearning --username 'kevin.whittaker' --password ${{ secrets.AZURE_DEVOPS_PAT }} --store-password-in-clear-text;
37+
}
38+
39+
- name: Dotnet publish
40+
run: |
41+
dotnet publish DigitalLearningSolutions.sln -c Release -o E:/web/${{env.SitePath}}-NEW
42+
43+
- name: Copy app_offline and web config to publish folder
44+
run: |
45+
Copy-Item E:/web/Offline/app_offline.htm E:/web/${{env.SitePath}}-NEW -Recurse -Force;
46+
Copy-Item E:/web/Offline/app_offline.htm E:/web/${{env.SitePath}} -Recurse -Force;
47+
if (Test-Path -Path E:/web/${{env.SitePath}})
48+
{
49+
Remove-Item -Path 'E:/web/${{env.SitePath}}-NEW/web.config' -Force;
50+
Copy-Item E:/web/${{env.SitePath}}/web.config E:/web/${{env.SitePath}}-NEW -Recurse -Force;
51+
}
52+
if (Test-Path -Path E:/web/${{env.SitePath}}-PREVIOUS){
53+
Remove-Item -LiteralPath 'E:/web/${{env.SitePath}}-PREVIOUS' -Force -Recurse
54+
}
55+
56+
- name: Sleep for 5 seconds
57+
run: Start-Sleep -s 5
58+
59+
- name: Switch deployment and published folders restarting apppool/webapp if necessary
60+
run: |
61+
62+
Import-Module WebAdministration;
63+
$currentRetry = 1;
64+
$backupRetry = 1;
65+
$success = $false;
66+
$backupSuccess = $false;
67+
do{
68+
echo "Attempting folder rename $currentRetry"
69+
try {
70+
Rename-Item -Path 'E:/web/${{env.SitePath}}' -NewName '${{env.SitePath}}-PREVIOUS'
71+
Rename-Item -Path 'E:/web/${{env.SitePath}}-NEW' -NewName '${{env.SitePath}}'
72+
$success = $true;
73+
}
74+
catch {
75+
echo "Rename failed due to following Catch error:`n"
76+
echo $PSItem.Exception.Message
77+
echo "`n"
78+
Start-Sleep -s 2
79+
$currentRetry = $currentRetry + 1;
80+
}
81+
finally {
82+
if ($currentRetry -ge 10) {
83+
echo "Rename keeps failing; restarting AppPool/Site as last resort`n"
84+
echo "Attempting to restart AppPool`n"
85+
do{
86+
$status = Get-WebAppPoolState -name '${{env.AppPoolName}}'
87+
if ($status.Value -eq "Stopped") {
88+
start-WebAppPool ${{env.AppPoolName}}
89+
echo "AppPool restarted`n---------`n"
90+
$backupSuccess = $true;
91+
}
92+
else {
93+
if ($backupRetry -ge 10) {
94+
throw "AppPool restart keeps failing."
95+
}
96+
echo "AppPool not stopped yet; Re-attempt #$backupRetry"
97+
Start-Sleep -s 10
98+
$backupRetry = $backupRetry + 1;
99+
}
100+
}
101+
while (!$backupSuccess -and $backupRetry -le 10)
102+
$backupRetry = 1;
103+
$backupSuccess = $false;
104+
echo "Attempting to restart Website`n"
105+
do{
106+
$status = Get-WebsiteState -name '${{env.SiteName}}'
107+
if ($status.Value -eq "Stopped") {
108+
start-iissite ${{env.SiteName}}
109+
echo "Website restarted`n---------`n"
110+
$backupSuccess = $true;
111+
}
112+
else {
113+
if ($backupRetry -ge 10) {
114+
throw "Website restart keeps failing. Please look into Server"
115+
}
116+
echo "Website not stopped yet; Re-attempt #$backupRetry"
117+
Start-Sleep -s 10
118+
$backupRetry = $backupRetry + 1;
119+
}
120+
}
121+
while (!$backupSuccess -and $backupRetry -le 10)
122+
}
123+
}
124+
}
125+
while (!$success -and $currentRetry -le 10)
126+
127+
- name: Remove Offline and remove previous deployment folder
128+
run: |
129+
Remove-Item 'E:/web/${{env.SitePath}}/app_offline.htm' -Force

0 commit comments

Comments
 (0)