-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Public copy <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
f01afb5
commit 28026aa
Showing
8 changed files
with
292 additions
and
2,411 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
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,28 +1,49 @@ | ||
module "accts" { | ||
source = "../../../../tflib/accts" | ||
} | ||
|
||
terraform { | ||
required_providers { | ||
apko = { source = "chainguard-dev/apko" } | ||
} | ||
} | ||
|
||
data "apko_config" "package-info" { | ||
config_contents = jsonencode({ | ||
contents = { | ||
packages = var.extra_packages | ||
} | ||
}) | ||
} | ||
|
||
locals { | ||
package_conf = [for p in data.apko_config.package-info.config.contents.packages : p if startswith(p, "dotnet")][0] | ||
full_package_version = split("=", local.package_conf)[1] | ||
package_version_without_epoch = split("-", local.full_package_version)[0] // This extracts the version without the epoch | ||
} | ||
|
||
module "accts" { | ||
source = "../../../../tflib/accts" | ||
} | ||
|
||
variable "extra_packages" { | ||
default = ["dotnet-runtime"] | ||
description = "The additional packages to install (e.g. dotnet-runtime)." | ||
} | ||
|
||
output "config" { | ||
value = jsonencode({ | ||
"contents" : { | ||
"packages" : var.extra_packages | ||
contents = { | ||
packages = var.extra_packages | ||
}, | ||
"entrypoint" : { | ||
"command" : "/usr/bin/dotnet" | ||
entrypoint = { | ||
command = "/usr/bin/dotnet" | ||
}, | ||
"cmd" : "--help", | ||
"accounts" : module.accts.block | ||
cmd = "--help", | ||
accounts = module.accts.block | ||
# copied from crane config mcr.microsoft.com/dotnet/runtime:9.0 |jq .config | ||
environment = { | ||
APP_UID = module.accts.uid | ||
ASPNETCORE_HTTP_PORTS = 8080 | ||
DOTNET_RUNNING_IN_CONTAINER = true, | ||
DOTNET_VERSION = local.package_version_without_epoch, | ||
} | ||
}) | ||
} | ||
|
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,32 +1,53 @@ | ||
terraform { | ||
required_providers { | ||
apko = { source = "chainguard-dev/apko" } | ||
} | ||
} | ||
|
||
data "apko_config" "package-info" { | ||
config_contents = jsonencode({ | ||
contents = { | ||
packages = var.extra_packages | ||
} | ||
}) | ||
} | ||
|
||
locals { | ||
baseline_packages = ["busybox"] | ||
package_conf = [for p in data.apko_config.package-info.config.contents.packages : p if startswith(p, "dotnet")][0] | ||
full_package_version = split("=", local.package_conf)[1] | ||
package_version_without_epoch = split("-", local.full_package_version)[0] // This extracts the version without the epoch | ||
} | ||
|
||
module "accts" { | ||
source = "../../../../tflib/accts" | ||
} | ||
|
||
terraform { | ||
required_providers { | ||
apko = { source = "chainguard-dev/apko" } | ||
} | ||
} | ||
|
||
variable "extra_packages" { | ||
default = ["dotnet-sdk"] | ||
description = "The additional packages to install (e.g. dotnet-sdk)." | ||
} | ||
|
||
output "config" { | ||
value = jsonencode({ | ||
"contents" : { | ||
// TODO: remove the need for using hardcoded local.baseline_packages by plumbing | ||
// these packages through var.extra_packages in all callers of this config module | ||
"packages" : distinct(concat(local.baseline_packages, var.extra_packages)) | ||
contents = { | ||
packages = var.extra_packages | ||
}, | ||
"entrypoint" : {}, | ||
"cmd" : "/bin/sh -l", | ||
"accounts" : module.accts.block | ||
entrypoint = {}, | ||
cmd = "/bin/sh -l", | ||
accounts = module.accts.block | ||
environment = { | ||
# copied from crane config mcr.microsoft.com/dotnet/sdk:9.0 |jq .config | ||
APP_UID = module.accts.uid | ||
ASPNETCORE_HTTP_PORTS = 8080 | ||
DOTNET_RUNNING_IN_CONTAINER = true, | ||
DOTNET_VERSION = local.package_version_without_epoch, | ||
ASPNET_VERSION = local.package_version_without_epoch | ||
DOTNET_GENERATE_ASPNET_CERTIFICATE = false, | ||
DOTNET_NOLOGO = true, | ||
DOTNET_SDK_VERSION = local.package_version_without_epoch, | ||
DOTNET_USE_POLLING_FILE_WATCHER = true, | ||
NUGET_XMLDOC_MODE = "skip", | ||
} | ||
}) | ||
} | ||
|
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
Oops, something went wrong.