Skip to content

Commit

Permalink
Add support for remote OS repositories to Artifact Registry
Browse files Browse the repository at this point in the history
  • Loading branch information
juliocc committed Sep 22, 2023
1 parent 91afc18 commit d5ea055
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
87 changes: 87 additions & 0 deletions mmv1/products/artifactregistry/Repository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ 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_cleanup'
min_version: beta
Expand Down Expand Up @@ -328,13 +334,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 +394,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 +417,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 +440,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 +460,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"
}
}
}
}

0 comments on commit d5ea055

Please sign in to comment.