Merge pull request 'Add gems remote, local and virtual' (#68) from benvin/gems into main
ci/woodpecker/push/apply Pipeline was successful
ci/woodpecker/push/apply Pipeline was successful
Reviewed-on: #68
This commit was merged in pull request #68.
This commit is contained in:
@@ -27,6 +27,11 @@ locals {
|
||||
trimsuffix(basename(file_path), ".yaml") => content
|
||||
if startswith(file_path, "remote_generic/")
|
||||
}
|
||||
remote_gems = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(basename(file_path), ".yaml") => content
|
||||
if startswith(file_path, "remote_gems/")
|
||||
}
|
||||
remote_github_deb = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(basename(file_path), ".yaml") => content
|
||||
@@ -87,6 +92,11 @@ locals {
|
||||
trimsuffix(basename(file_path), ".yaml") => content
|
||||
if startswith(file_path, "local_npm/")
|
||||
}
|
||||
local_gems = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(basename(file_path), ".yaml") => content
|
||||
if startswith(file_path, "local_gems/")
|
||||
}
|
||||
local_docker = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(basename(file_path), ".yaml") => content
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
description: "Internal gems"
|
||||
@@ -0,0 +1,5 @@
|
||||
base_url: https://rubygems.org
|
||||
description: "rubygems.org — public RubyGems source"
|
||||
immutable_ttl: 0
|
||||
mutable_ttl: 300
|
||||
stale_on_error: true
|
||||
@@ -0,0 +1,5 @@
|
||||
package_type: gems
|
||||
description: "Virtual RubyGems source over internal and public gems — member order is priority order for duplicate versions"
|
||||
members:
|
||||
- gems-internal
|
||||
- rubygems
|
||||
@@ -21,6 +21,7 @@ inputs = {
|
||||
remote_cargo = local.config.remote_cargo
|
||||
remote_docker = local.config.remote_docker
|
||||
remote_generic = local.config.remote_generic
|
||||
remote_gems = local.config.remote_gems
|
||||
remote_github_deb = local.config.remote_github_deb
|
||||
remote_github_rpm = local.config.remote_github_rpm
|
||||
remote_goproxy = local.config.remote_goproxy
|
||||
@@ -33,6 +34,7 @@ inputs = {
|
||||
local_rpm = local.config.local_rpm
|
||||
local_helm = local.config.local_helm
|
||||
local_npm = local.config.local_npm
|
||||
local_gems = local.config.local_gems
|
||||
local_docker = local.config.local_docker
|
||||
local_generic = local.config.local_generic
|
||||
virtual = local.config.virtual
|
||||
|
||||
@@ -135,6 +135,19 @@ resource "artifactapi_remote_npm" "this" {
|
||||
stale_on_error = each.value.stale_on_error
|
||||
}
|
||||
|
||||
resource "artifactapi_remote_gems" "this" {
|
||||
for_each = var.remote_gems
|
||||
|
||||
name = each.key
|
||||
base_url = each.value.base_url
|
||||
description = each.value.description
|
||||
immutable_ttl = each.value.immutable_ttl
|
||||
mutable_ttl = each.value.mutable_ttl
|
||||
patterns = each.value.patterns
|
||||
mutable_patterns = each.value.mutable_patterns
|
||||
stale_on_error = each.value.stale_on_error
|
||||
}
|
||||
|
||||
resource "artifactapi_remote_pypi" "this" {
|
||||
for_each = var.remote_pypi
|
||||
|
||||
@@ -183,6 +196,13 @@ resource "artifactapi_local_npm" "this" {
|
||||
description = each.value.description
|
||||
}
|
||||
|
||||
resource "artifactapi_local_gems" "this" {
|
||||
for_each = var.local_gems
|
||||
|
||||
name = each.key
|
||||
description = each.value.description
|
||||
}
|
||||
|
||||
resource "artifactapi_local_docker" "this" {
|
||||
for_each = var.local_docker
|
||||
|
||||
|
||||
@@ -141,6 +141,20 @@ variable "remote_npm" {
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "remote_gems" {
|
||||
description = "Map of RubyGems remote repositories"
|
||||
type = map(object({
|
||||
base_url = string
|
||||
description = optional(string, "")
|
||||
immutable_ttl = optional(number, 0)
|
||||
mutable_ttl = optional(number, 3600)
|
||||
patterns = optional(list(string), [])
|
||||
mutable_patterns = optional(list(string), [])
|
||||
stale_on_error = optional(bool, true)
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "remote_pypi" {
|
||||
description = "Map of PyPI remote repositories"
|
||||
type = map(object({
|
||||
@@ -187,6 +201,14 @@ variable "local_npm" {
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "local_gems" {
|
||||
description = "Map of local gems repositories"
|
||||
type = map(object({
|
||||
description = optional(string, "")
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "local_generic" {
|
||||
description = "Map of local generic (raw-file) repositories"
|
||||
type = map(object({
|
||||
|
||||
Reference in New Issue
Block a user