mirror of
https://github.com/actions/runner-images.git
synced 2025-12-17 15:20:11 +00:00
[macOS] Add apache and nginx (#2522)
* add apache and nginx * swap config and service status * add new line * remove notes
This commit is contained in:
committed by
GitHub
parent
ed5d4dc5c5
commit
5537d89215
6
images/macos/provision/core/apache.sh
Normal file
6
images/macos/provision/core/apache.sh
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash -e -o pipefail
|
||||||
|
|
||||||
|
brew install httpd
|
||||||
|
sudo sed -Ei '' 's/Listen .*/Listen 80/' $(brew --prefix)/etc/httpd/httpd.conf
|
||||||
|
|
||||||
|
invoke_tests "WebServers" "Apache"
|
||||||
6
images/macos/provision/core/nginx.sh
Normal file
6
images/macos/provision/core/nginx.sh
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash -e -o pipefail
|
||||||
|
|
||||||
|
brew install nginx
|
||||||
|
sudo sed -Ei '' 's/listen.*/listen 80;/' $(brew --prefix)/etc/nginx/nginx.conf
|
||||||
|
|
||||||
|
invoke_tests "WebServers" "Nginx"
|
||||||
@@ -14,6 +14,7 @@ Import-Module "$PSScriptRoot/SoftwareReport.Java.psm1" -DisableNameChecking
|
|||||||
Import-Module "$PSScriptRoot/SoftwareReport.Xamarin.psm1" -DisableNameChecking
|
Import-Module "$PSScriptRoot/SoftwareReport.Xamarin.psm1" -DisableNameChecking
|
||||||
Import-Module "$PSScriptRoot/SoftwareReport.Toolcache.psm1" -DisableNameChecking
|
Import-Module "$PSScriptRoot/SoftwareReport.Toolcache.psm1" -DisableNameChecking
|
||||||
Import-Module "$PSScriptRoot/SoftwareReport.Browsers.psm1" -DisableNameChecking
|
Import-Module "$PSScriptRoot/SoftwareReport.Browsers.psm1" -DisableNameChecking
|
||||||
|
Import-Module "$PSScriptRoot/SoftwareReport.WebServers.psm1" -DisableNameChecking
|
||||||
Import-Module "$PSScriptRoot/../helpers/SoftwareReport.Helpers.psm1"
|
Import-Module "$PSScriptRoot/../helpers/SoftwareReport.Helpers.psm1"
|
||||||
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
||||||
Import-Module "$PSScriptRoot/../helpers/Xcode.Helpers.psm1"
|
Import-Module "$PSScriptRoot/../helpers/Xcode.Helpers.psm1"
|
||||||
@@ -219,6 +220,11 @@ $markdown += New-MDHeader "PowerShell Modules" -Level 4
|
|||||||
$markdown += Get-PowerShellModules | New-MDTable
|
$markdown += Get-PowerShellModules | New-MDTable
|
||||||
$markdown += New-MDNewLine
|
$markdown += New-MDNewLine
|
||||||
|
|
||||||
|
# Web Servers
|
||||||
|
if ($os.IsHigherThanMojave) {
|
||||||
|
$markdown += Build-WebServersSection
|
||||||
|
}
|
||||||
|
|
||||||
# Xamarin section
|
# Xamarin section
|
||||||
$markdown += New-MDHeader "Xamarin" -Level 3
|
$markdown += New-MDHeader "Xamarin" -Level 3
|
||||||
$markdown += New-MDHeader "Visual Studio for Mac" -Level 4
|
$markdown += New-MDHeader "Visual Studio for Mac" -Level 4
|
||||||
|
|||||||
41
images/macos/software-report/SoftwareReport.WebServers.psm1
Normal file
41
images/macos/software-report/SoftwareReport.WebServers.psm1
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
function Get-ApacheVersion {
|
||||||
|
$name = "httpd"
|
||||||
|
$port = 80
|
||||||
|
$version = brew list $name --versions | Take-Part -Part 1
|
||||||
|
$serviceStatus = (brew services list) -match $name | Take-Part -Part 1
|
||||||
|
$configFile = "$(brew --prefix)/etc/httpd/httpd.conf"
|
||||||
|
return [PsCustomObject]@{
|
||||||
|
"Name" = $name
|
||||||
|
"Version" = $version
|
||||||
|
"ConfigFile" = $configFile
|
||||||
|
"ServiceStatus" = $serviceStatus
|
||||||
|
"ListenPort" = $port
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Get-NginxVersion {
|
||||||
|
$name = "nginx"
|
||||||
|
$port = 80
|
||||||
|
$version = brew list $name --versions | Take-Part -Part 1
|
||||||
|
$serviceStatus = (brew services list) -match $name | Take-Part -Part 1
|
||||||
|
$configFile = "$(brew --prefix)/etc/nginx/nginx.conf"
|
||||||
|
return [PsCustomObject]@{
|
||||||
|
"Name" = $name
|
||||||
|
"Version" = $version
|
||||||
|
"ConfigFile" = $configFile
|
||||||
|
"ServiceStatus" = $serviceStatus
|
||||||
|
"ListenPort" = $port
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Build-WebServersSection {
|
||||||
|
$output = ""
|
||||||
|
$output += New-MDHeader "Web Servers" -Level 3
|
||||||
|
$output += @(
|
||||||
|
(Get-ApacheVersion),
|
||||||
|
(Get-NginxVersion)
|
||||||
|
) | Sort-Object Name | New-MDTable
|
||||||
|
|
||||||
|
$output += New-MDNewLine
|
||||||
|
return $output
|
||||||
|
}
|
||||||
@@ -174,6 +174,8 @@
|
|||||||
"./provision/core/xamarin-android-ndk.sh",
|
"./provision/core/xamarin-android-ndk.sh",
|
||||||
"./provision/core/vsmac.sh",
|
"./provision/core/vsmac.sh",
|
||||||
"./provision/core/nvm.sh",
|
"./provision/core/nvm.sh",
|
||||||
|
"./provision/core/apache.sh",
|
||||||
|
"./provision/core/nginx.sh",
|
||||||
"./provision/core/postgresql.sh",
|
"./provision/core/postgresql.sh",
|
||||||
"./provision/core/mongodb.sh",
|
"./provision/core/mongodb.sh",
|
||||||
"./provision/core/audiodevice.sh",
|
"./provision/core/audiodevice.sh",
|
||||||
|
|||||||
@@ -173,6 +173,8 @@
|
|||||||
"./provision/core/xamarin.sh",
|
"./provision/core/xamarin.sh",
|
||||||
"./provision/core/vsmac.sh",
|
"./provision/core/vsmac.sh",
|
||||||
"./provision/core/nvm.sh",
|
"./provision/core/nvm.sh",
|
||||||
|
"./provision/core/apache.sh",
|
||||||
|
"./provision/core/nginx.sh",
|
||||||
"./provision/core/postgresql.sh",
|
"./provision/core/postgresql.sh",
|
||||||
"./provision/core/mongodb.sh",
|
"./provision/core/mongodb.sh",
|
||||||
"./provision/core/vcpkg.sh",
|
"./provision/core/vcpkg.sh",
|
||||||
|
|||||||
19
images/macos/tests/WebServers.Tests.ps1
Normal file
19
images/macos/tests/WebServers.Tests.ps1
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
Describe "Apache" {
|
||||||
|
It "Apache CLI" {
|
||||||
|
"httpd -v" | Should -ReturnZeroExitCode
|
||||||
|
}
|
||||||
|
|
||||||
|
It "Apache Service" {
|
||||||
|
brew services list | Out-String | Should -Match "httpd\s+stopped"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Describe "Nginx" {
|
||||||
|
It "Nginx CLI" {
|
||||||
|
"nginx -v" | Should -ReturnZeroExitCode
|
||||||
|
}
|
||||||
|
|
||||||
|
It "Nginx Service" {
|
||||||
|
brew services list | Out-String | Should -Match "nginx\s+stopped"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user