Skip to content

Commit

Permalink
[Ubuntu] don't install web servers
Browse files Browse the repository at this point in the history
Inside container environment we're not running a second service process,
but use service container for act instead.

See: nektos/act#1949
Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
  • Loading branch information
vicamo committed Mar 3, 2024
1 parent 86cf21d commit 5c64cd7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions images/ubuntu/scripts/build/install-apache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
## Desc: Install Apache HTTP Server
################################################################################

if [[ -f /run/systemd/container ]]; then
exit 0
fi

# Install Apache
apt-get install apache2 -y

Expand Down
4 changes: 4 additions & 0 deletions images/ubuntu/scripts/build/install-nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
## Desc: Install Nginx
################################################################################

if [[ -f /run/systemd/container ]]; then
exit 0
fi

# Install Nginx
apt-get install nginx -y

Expand Down
4 changes: 3 additions & 1 deletion images/ubuntu/scripts/docs-gen/Generate-SoftwareReport.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ $powerShellTools = $installedSoftware.AddHeader("PowerShell Tools")
$powerShellTools.AddToolVersion("PowerShell", $(Get-PowershellVersion))
$powerShellTools.AddHeader("PowerShell Modules").AddNodes($(Get-PowerShellModules))

$installedSoftware.AddHeader("Web Servers").AddTable($(Build-WebServersTable))
if (-not (Test-IsContainer)) {
$installedSoftware.AddHeader("Web Servers").AddTable($(Build-WebServersTable))
}

$androidTools = $installedSoftware.AddHeader("Android")
$androidTools.AddTable($(Build-AndroidTable))
Expand Down
6 changes: 4 additions & 2 deletions images/ubuntu/scripts/tests/WebServers.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Describe "Apache" {
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"

Describe "Apache" -Skip:(Test-IsContainer) {
It "Apache CLI" {
"apache2 -v" | Should -ReturnZeroExitCode
}
Expand All @@ -10,7 +12,7 @@ Describe "Apache" {
}
}

Describe "Nginx" {
Describe "Nginx" -Skip:(Test-IsContainer) {
It "Nginx CLI" {
"nginx -v" | Should -ReturnZeroExitCode
}
Expand Down

0 comments on commit 5c64cd7

Please sign in to comment.