Skip to content

Commit

Permalink
Add support for remote OS repositories to Artifact Registry (#9047)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliocc authored Sep 25, 2023
1 parent aef0da0 commit 954bc68
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
93 changes: 93 additions & 0 deletions mmv1/products/artifactregistry/Repository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ examples:
vars:
repository_id: 'my-repository'
description: 'example remote docker repository'
- !ruby/object:Provider::Terraform::Examples
name: 'artifact_registry_repository_remote_apt'
primary_resource_id: 'my-repo'
vars:
repository_id: 'debian-buster'
description: 'example remote apt repository'
- !ruby/object:Provider::Terraform::Examples
name: 'artifact_registry_repository_remote_yum'
primary_resource_id: 'my-repo'
vars:
repository_id: 'centos-8'
description: 'example remote yum repository'
- !ruby/object:Provider::Terraform::Examples
name: 'artifact_registry_repository_cleanup'
min_version: beta
Expand Down Expand Up @@ -328,13 +340,49 @@ properties:
description: |-
The description of the remote source.
immutable: true
- !ruby/object:Api::Type::NestedObject
name: 'aptRepository'
exactly_one_of:
- remoteRepositoryConfig.0.apt_repository
- remoteRepositoryConfig.0.docker_repository
- remoteRepositoryConfig.0.maven_repository
- remoteRepositoryConfig.0.npm_repository
- remoteRepositoryConfig.0.python_repository
- remoteRepositoryConfig.0.yum_repository
description: |-
Specific settings for an Apt remote repository.
immutable: true
properties:
- !ruby/object:Api::Type::NestedObject
name: 'publicRepository'
description: |-
One of the publicly available Apt repositories supported by Artifact Registry.
immutable: true
properties:
- !ruby/object:Api::Type::Enum
name: 'repositoryBase'
required: true
description: |-
A common public repository base for Apt, e.g. `"debian/dists/buster"`
immutable: true
values:
- :DEBIAN
- :UBUNTU
- !ruby/object:Api::Type::String
name: 'repositoryPath'
required: true
description: |-
Specific repository from the base.
immutable: true
- !ruby/object:Api::Type::NestedObject
name: 'dockerRepository'
exactly_one_of:
- remoteRepositoryConfig.0.apt_repository
- remoteRepositoryConfig.0.docker_repository
- remoteRepositoryConfig.0.maven_repository
- remoteRepositoryConfig.0.npm_repository
- remoteRepositoryConfig.0.python_repository
- remoteRepositoryConfig.0.yum_repository
description: |-
Specific settings for a Docker remote repository.
immutable: true
Expand All @@ -352,10 +400,12 @@ properties:
- !ruby/object:Api::Type::NestedObject
name: 'mavenRepository'
exactly_one_of:
- remoteRepositoryConfig.0.apt_repository
- remoteRepositoryConfig.0.docker_repository
- remoteRepositoryConfig.0.maven_repository
- remoteRepositoryConfig.0.npm_repository
- remoteRepositoryConfig.0.python_repository
- remoteRepositoryConfig.0.yum_repository
description: |-
Specific settings for a Maven remote repository.
immutable: true
Expand All @@ -373,10 +423,12 @@ properties:
- !ruby/object:Api::Type::NestedObject
name: 'npmRepository'
exactly_one_of:
- remoteRepositoryConfig.0.apt_repository
- remoteRepositoryConfig.0.docker_repository
- remoteRepositoryConfig.0.maven_repository
- remoteRepositoryConfig.0.npm_repository
- remoteRepositoryConfig.0.python_repository
- remoteRepositoryConfig.0.yum_repository
description: |-
Specific settings for an Npm remote repository.
immutable: true
Expand All @@ -394,10 +446,12 @@ properties:
- !ruby/object:Api::Type::NestedObject
name: 'pythonRepository'
exactly_one_of:
- remoteRepositoryConfig.0.apt_repository
- remoteRepositoryConfig.0.docker_repository
- remoteRepositoryConfig.0.maven_repository
- remoteRepositoryConfig.0.npm_repository
- remoteRepositoryConfig.0.python_repository
- remoteRepositoryConfig.0.yum_repository
description: |-
Specific settings for a Python remote repository.
immutable: true
Expand All @@ -412,6 +466,45 @@ properties:
values:
- :PYPI
default_value: :PYPI
- !ruby/object:Api::Type::NestedObject
name: 'yumRepository'
exactly_one_of:
- remoteRepositoryConfig.0.apt_repository
- remoteRepositoryConfig.0.docker_repository
- remoteRepositoryConfig.0.maven_repository
- remoteRepositoryConfig.0.npm_repository
- remoteRepositoryConfig.0.python_repository
- remoteRepositoryConfig.0.yum_repository
description: |-
Specific settings for an Yum remote repository.
immutable: true
properties:
- !ruby/object:Api::Type::NestedObject
name: 'publicRepository'
description: |-
One of the publicly available Yum repositories supported by Artifact Registry.
immutable: true
properties:
- !ruby/object:Api::Type::Enum
name: 'repositoryBase'
required: true
description: |-
A common public repository base for Yum.
immutable: true
values:
- :CENTOS
- :CENTOS_DEBUG
- :CENTOS_VAULT
- :CENTOS_STREAM
- :ROCKY
- :EPEL
- !ruby/object:Api::Type::String
name: 'repositoryPath'
required: true
description: |-
Specific repository from the base, e.g. `"8-stream/BaseOs/x86_64/os"`
immutable: true

- !ruby/object:Api::Type::Boolean
name: 'cleanupPolicyDryRun'
min_version: beta
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
resource "google_artifact_registry_repository" "<%= ctx[:primary_resource_id] %>" {
location = "us-central1"
repository_id = "<%= ctx[:vars]['repository_id'] %>"
description = "<%= ctx[:vars]['description'] %>"
format = "APT"
mode = "REMOTE_REPOSITORY"
remote_repository_config {
description = "Debian buster remote repository"
apt_repository {
public_repository {
repository_base = "DEBIAN"
repository_path = "debian/dists/buster"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
resource "google_artifact_registry_repository" "<%= ctx[:primary_resource_id] %>" {
location = "us-central1"
repository_id = "<%= ctx[:vars]['repository_id'] %>"
description = "<%= ctx[:vars]['description'] %>"
format = "YUM"
mode = "REMOTE_REPOSITORY"
remote_repository_config {
description = "Centos 8 remote repository"
yum_repository {
public_repository {
repository_base = "CENTOS"
repository_path = "8-stream/BaseOs/x86_64/os"
}
}
}
}

0 comments on commit 954bc68

Please sign in to comment.