virtual

package
v10.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const AlpinePackageType = "alpine"
View Source
const BowerPackageType = "bower"
View Source
const DebianPackageType = "debian"
View Source
const DockerPackageType = "docker"
View Source
const GoPackageType = "go"
View Source
const HelmPackageType = "helm"
View Source
const NpmPackageType = "npm"
View Source
const NugetPackageType = "nuget"
View Source
const Rclass = "virtual"
View Source
const RpmPackageType = "rpm"

Variables

View Source
var AlpineVirtualSchema = utilsdk.MergeMaps(
	BaseVirtualRepoSchema,
	RetrievalCachePeriodSecondsSchema,
	map[string]*schema.Schema{
		"primary_keypair_ref": {
			Type:             schema.TypeString,
			Optional:         true,
			ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotEmpty),
			Description:      "Primary keypair used to sign artifacts. Default value is empty.",
		},
	},
	repository.RepoLayoutRefSchema(Rclass, AlpinePackageType))
View Source
var BaseVirtualRepoSchema = utilsdk.MergeMaps(
	repository.BaseRepoSchema,
	map[string]*schema.Schema{
		"repositories": {
			Type:        schema.TypeList,
			Elem:        &schema.Schema{Type: schema.TypeString},
			Optional:    true,
			Description: "The effective list of actual repositories included in this virtual repository.",
		},
		"artifactory_requests_can_retrieve_remote_artifacts": {
			Type:        schema.TypeBool,
			Optional:    true,
			Default:     false,
			Description: "Whether the virtual repository should search through remote repositories when trying to resolve an artifact requested by another Artifactory instance.",
		},
		"default_deployment_repo": {
			Type:        schema.TypeString,
			Optional:    true,
			Description: "Default repository to deploy artifacts.",
		},
	},
)
View Source
var BowerVirtualSchema = utilsdk.MergeMaps(
	BaseVirtualRepoSchema,
	externalDependenciesSchema,
	repository.RepoLayoutRefSchema(Rclass, BowerPackageType),
)
View Source
var DebianVirtualSchema = utilsdk.MergeMaps(
	BaseVirtualRepoSchema,
	RetrievalCachePeriodSecondsSchema,
	map[string]*schema.Schema{
		"primary_keypair_ref": {
			Type:             schema.TypeString,
			Optional:         true,
			ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotEmpty),
			Description:      "Primary keypair used to sign artifacts. Default is empty.",
		},
		"secondary_keypair_ref": {
			Type:             schema.TypeString,
			Optional:         true,
			ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotEmpty),
			Description:      "Secondary keypair used to sign artifacts. Default is empty.",
		},
		"optional_index_compression_formats": {
			Type:     schema.TypeSet,
			Optional: true,
			MinItems: 0,
			Computed: true,
			Elem: &schema.Schema{
				Type:         schema.TypeString,
				ValidateFunc: validation.StringInSlice([]string{"bz2", "lzma", "xz"}, false),
			},
			Description: `Index file formats you would like to create in addition to the default Gzip (.gzip extension). Supported values are 'bz2','lzma' and 'xz'. Default value is 'bz2'.`,
		},
		"debian_default_architectures": {
			Type:             schema.TypeString,
			Optional:         true,
			Default:          "amd64,i386",
			ValidateDiagFunc: validation.ToDiagFunc(validation.All(validation.StringIsNotEmpty, validation.StringMatch(regexp.MustCompile(`.+(?:,.+)*`), "must be comma separated string"))),
			StateFunc:        utilsdk.FormatCommaSeparatedString,
			Description:      `Specifying  architectures will speed up Artifactory's initial metadata indexing process. The default architecture values are amd64 and i386.`,
		},
	}, repository.RepoLayoutRefSchema(Rclass, DebianPackageType))
View Source
var DockerVirtualSchema = utilsdk.MergeMaps(BaseVirtualRepoSchema, map[string]*schema.Schema{
	"resolve_docker_tags_by_timestamp": {
		Type:        schema.TypeBool,
		Optional:    true,
		Default:     false,
		Description: "When enabled, in cases where the same Docker tag exists in two or more of the aggregated repositories, Artifactory will return the tag that has the latest timestamp.",
	},
}, repository.RepoLayoutRefSchema(Rclass, DockerPackageType))
View Source
var GoVirtualSchema = utilsdk.MergeMaps(BaseVirtualRepoSchema, map[string]*schema.Schema{

	"external_dependencies_enabled": {
		Type:        schema.TypeBool,
		Default:     true,
		Optional:    true,
		Description: "When set (default), Artifactory will automatically follow remote VCS roots in 'go-import' meta tags to download remote modules.",
	},
	"external_dependencies_patterns": {
		Type:     schema.TypeList,
		Optional: true,
		ForceNew: true,
		Elem: &schema.Schema{
			Type: schema.TypeString,
		},
		RequiredWith: []string{"external_dependencies_enabled"},
		Description: "An allow list of Ant-style path patterns that determine which remote VCS roots Artifactory will " +
			"follow to download remote modules from, when presented with 'go-import' meta tags in the remote repository response.",
	},
}, repository.RepoLayoutRefSchema(Rclass, GoPackageType))
View Source
var HelmVirtualSchema = utilsdk.MergeMaps(
	BaseVirtualRepoSchema,
	RetrievalCachePeriodSecondsSchema,
	map[string]*schema.Schema{
		"use_namespaces": {
			Type:        schema.TypeBool,
			Optional:    true,
			Default:     false,
			Description: "From Artifactory 7.24.1 (SaaS Version), you can explicitly state a specific aggregated local or remote repository to fetch from a virtual by assigning namespaces to local and remote repositories\nSee https://www.jfrog.com/confluence/display/JFROG/Kubernetes+Helm+Chart+Repositories#KubernetesHelmChartRepositories-NamespaceSupportforHelmVirtualRepositories. Default to 'false'",
		},
	},
	repository.RepoLayoutRefSchema(Rclass, HelmPackageType))
View Source
var JavaVirtualSchema = map[string]*schema.Schema{
	"force_maven_authentication": {
		Type:        schema.TypeBool,
		Computed:    true,
		Optional:    true,
		Description: "User authentication is required when accessing the repository. An anonymous request will display an HTTP 401 error. This is also enforced when aggregated repositories support anonymous requests.",
	},
	"pom_repository_references_cleanup_policy": {
		Type:     schema.TypeString,
		Optional: true,
		Computed: true,
		ValidateFunc: validation.StringInSlice(
			[]string{"discard_active_reference", "discard_any_reference", "nothing"}, false,
		),
		Description: "(1: discard_active_reference) Discard Active References - Removes repository elements that are declared directly under project or under a profile in the same POM that is activeByDefault.\n" +
			"(2: discard_any_reference) Discard Any References - Removes all repository elements regardless of whether they are included in an active profile or not.\n" +
			"(3: nothing) Nothing - Does not remove any repository elements declared in the POM.",
	},
	"key_pair": {
		Type:        schema.TypeString,
		Optional:    true,
		Description: "The keypair used to sign artifacts",
	},
}
View Source
var NugetVirtualSchema = utilsdk.MergeMaps(BaseVirtualRepoSchema, map[string]*schema.Schema{
	"force_nuget_authentication": {
		Type:        schema.TypeBool,
		Optional:    true,
		Default:     false,
		Description: "If set, user authentication is required when accessing the repository. An anonymous request will display an HTTP 401 error. This is also enforced when aggregated repositories support anonymous requests.",
	},
}, repository.RepoLayoutRefSchema(Rclass, NugetPackageType))
View Source
var PackageTypesLikeGeneric = []string{
	"gems",
	"generic",
	"gitlfs",
	"composer",
	"p2",
	"pub",
	"puppet",
	"pypi",
	"swift",
	"terraform",
}
View Source
var PackageTypesLikeGenericWithRetrievalCachePeriodSecs = []string{
	"chef",
	"conda",
	"cran",
}
View Source
var RetrievalCachePeriodSecondsSchema = map[string]*schema.Schema{
	"retrieval_cache_period_seconds": {
		Type:     schema.TypeInt,
		Optional: true,
		Default:  7200,
		Description: "This value refers to the number of seconds to cache metadata files before checking for newer " +
			"versions on aggregated repositories. A value of 0 indicates no caching.",
		ValidateFunc: validation.IntAtLeast(0),
	},
}
View Source
var RpmVirtualSchema = utilsdk.MergeMaps(BaseVirtualRepoSchema, map[string]*schema.Schema{
	"primary_keypair_ref": {
		Type:             schema.TypeString,
		Optional:         true,
		ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotEmpty),
		Description:      "Primary keypair used to sign artifacts.",
	},
	"secondary_keypair_ref": {
		Type:             schema.TypeString,
		Optional:         true,
		ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotEmpty),
		Description:      "Secondary keypair used to sign artifacts.",
	},
}, repository.RepoLayoutRefSchema(Rclass, RpmPackageType))

Functions

func ResourceArtifactoryVirtualAlpineRepository

func ResourceArtifactoryVirtualAlpineRepository() *schema.Resource

func ResourceArtifactoryVirtualBowerRepository

func ResourceArtifactoryVirtualBowerRepository() *schema.Resource

func ResourceArtifactoryVirtualConanRepository

func ResourceArtifactoryVirtualConanRepository() *schema.Resource

func ResourceArtifactoryVirtualDebianRepository

func ResourceArtifactoryVirtualDebianRepository() *schema.Resource

func ResourceArtifactoryVirtualDockerRepository

func ResourceArtifactoryVirtualDockerRepository() *schema.Resource

func ResourceArtifactoryVirtualGenericRepository

func ResourceArtifactoryVirtualGenericRepository(pkt string) *schema.Resource

func ResourceArtifactoryVirtualGoRepository

func ResourceArtifactoryVirtualGoRepository() *schema.Resource

func ResourceArtifactoryVirtualHelmRepository

func ResourceArtifactoryVirtualHelmRepository() *schema.Resource

func ResourceArtifactoryVirtualJavaRepository

func ResourceArtifactoryVirtualJavaRepository(repoType string) *schema.Resource

func ResourceArtifactoryVirtualNpmRepository

func ResourceArtifactoryVirtualNpmRepository() *schema.Resource

func ResourceArtifactoryVirtualNugetRepository

func ResourceArtifactoryVirtualNugetRepository() *schema.Resource

func ResourceArtifactoryVirtualRepositoryWithRetrievalCachePeriodSecs

func ResourceArtifactoryVirtualRepositoryWithRetrievalCachePeriodSecs(pkt string) *schema.Resource

func ResourceArtifactoryVirtualRpmRepository

func ResourceArtifactoryVirtualRpmRepository() *schema.Resource

Types

type CommonJavaVirtualRepositoryParams

type CommonJavaVirtualRepositoryParams struct {
	ForceMavenAuthentication             bool   `json:"forceMavenAuthentication,omitempty"`
	PomRepositoryReferencesCleanupPolicy string `hcl:"pom_repository_references_cleanup_policy" json:"pomRepositoryReferencesCleanupPolicy,omitempty"`
	KeyPair                              string `hcl:"key_pair" json:"keyPair,omitempty"`
}

type ExternalDependenciesVirtualRepositoryParams

type ExternalDependenciesVirtualRepositoryParams struct {
	RepositoryBaseParams
	ExternalDependenciesEnabled    bool     `json:"externalDependenciesEnabled"`
	ExternalDependenciesRemoteRepo string   `json:"externalDependenciesRemoteRepo"`
	ExternalDependenciesPatterns   []string `json:"externalDependenciesPatterns"`
}

type RepositoryBaseParams

type RepositoryBaseParams struct {
	Key                                           string   `hcl:"key" json:"key,omitempty"`
	ProjectKey                                    string   `json:"projectKey"`
	ProjectEnvironments                           []string `json:"environments"`
	Rclass                                        string   `json:"rclass"`
	PackageType                                   string   `hcl:"package_type" json:"packageType,omitempty"`
	Description                                   string   `json:"description"`
	Notes                                         string   `json:"notes"`
	IncludesPattern                               string   `json:"includesPattern"`
	ExcludesPattern                               string   `json:"excludesPattern"`
	RepoLayoutRef                                 string   `hcl:"repo_layout_ref" json:"repoLayoutRef,omitempty"`
	Repositories                                  []string `hcl:"repositories" json:"repositories,omitempty"`
	ArtifactoryRequestsCanRetrieveRemoteArtifacts bool     `hcl:"artifactory_requests_can_retrieve_remote_artifacts" json:"artifactoryRequestsCanRetrieveRemoteArtifacts"`
	DefaultDeploymentRepo                         string   `hcl:"default_deployment_repo" json:"defaultDeploymentRepo,omitempty"`
}

func UnpackBaseVirtRepo

func UnpackBaseVirtRepo(s *schema.ResourceData, packageType string) RepositoryBaseParams

func (RepositoryBaseParams) Id

func (bp RepositoryBaseParams) Id() string

type RepositoryBaseParamsWithRetrievalCachePeriodSecs

type RepositoryBaseParamsWithRetrievalCachePeriodSecs struct {
	RepositoryBaseParams
	VirtualRetrievalCachePeriodSecs int `hcl:"retrieval_cache_period_seconds" json:"virtualRetrievalCachePeriodSecs"`
}

func UnpackBaseVirtRepoWithRetrievalCachePeriodSecs

func UnpackBaseVirtRepoWithRetrievalCachePeriodSecs(s *schema.ResourceData, packageType string) RepositoryBaseParamsWithRetrievalCachePeriodSecs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL