Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support vendor.yaml as a new way of vendoring components, stacks or any other artifacts #448

Merged
merged 61 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
484ecba
Add `vendor.yaml`
aknysh Oct 16, 2023
7b8459c
Add `vendor.yaml`
aknysh Oct 16, 2023
e6a8936
Add `vendor.yaml`
aknysh Oct 17, 2023
a48478a
Add `vendor.yaml`
aknysh Oct 17, 2023
a0e5a50
Add `vendor.yaml`
aknysh Oct 18, 2023
d8093e3
Add `vendor.yaml`
aknysh Oct 19, 2023
8c235a2
Add `vendor.yaml`
aknysh Oct 19, 2023
f50c946
Add `vendor.yaml`
aknysh Oct 19, 2023
c2e699b
Add `vendor.yaml`
aknysh Oct 20, 2023
83391c6
Add `vendor.yaml`
aknysh Oct 22, 2023
6cedde5
Add `vendor.yaml`
aknysh Oct 22, 2023
43d7ea7
Add `vendor.yaml`
aknysh Oct 22, 2023
92b1ff4
Add `vendor.yaml`
aknysh Oct 22, 2023
7ac43a7
Add `vendor.yaml`
aknysh Oct 22, 2023
444c845
Add `vendor.yaml`
aknysh Oct 22, 2023
aeaffb7
Add `vendor.yaml`
aknysh Oct 22, 2023
d29fd43
Add `vendor.yaml`
aknysh Oct 22, 2023
e67b309
Add `vendor.yaml`
aknysh Oct 23, 2023
8d90c22
Add `vendor.yaml`
aknysh Oct 23, 2023
51b968d
Add `vendor.yaml`
aknysh Oct 23, 2023
aa4f807
Add `vendor.yaml`
aknysh Oct 23, 2023
ccf4282
Add `vendor.yaml`
aknysh Oct 23, 2023
91b87c1
Add `vendor.yaml`
aknysh Oct 23, 2023
52ef2f4
Add `vendor.yaml`
aknysh Oct 23, 2023
60deea4
update docs
aknysh Oct 23, 2023
0e1f2e8
update docs
aknysh Oct 23, 2023
9a32548
update docs
aknysh Oct 23, 2023
4c75811
update docs
aknysh Oct 23, 2023
fd03dc9
update docs
aknysh Oct 23, 2023
bea8d17
update docs
aknysh Oct 23, 2023
987afb9
update docs
aknysh Oct 24, 2023
ff70ec4
update docs
aknysh Oct 24, 2023
e217433
update docs
aknysh Oct 24, 2023
26f7ee7
update docs
aknysh Oct 24, 2023
ce61345
update docs
aknysh Oct 24, 2023
fdc90e4
update docs
aknysh Oct 24, 2023
317f24f
update docs
aknysh Oct 24, 2023
3f76c9a
update docs
aknysh Oct 24, 2023
2644882
Update examples/complete/vendor.yaml
aknysh Oct 24, 2023
a3b5ef6
Update examples/complete/vendor/vendor2.yaml
aknysh Oct 24, 2023
478a31f
Update examples/complete/vendor/vendor5.yaml
aknysh Oct 24, 2023
64aaa78
Update examples/complete/vendor/vendor6.yaml
aknysh Oct 24, 2023
c5255b3
Update examples/complete/vendor/vendor3.yaml
aknysh Oct 24, 2023
48e877d
Update examples/complete/vendor/vendor4.yaml
aknysh Oct 24, 2023
42f2c32
Update website/docs/cli/commands/vendor/vendor-pull.md
aknysh Oct 24, 2023
5a6de19
Update website/docs/core-concepts/vendoring/vendoring.md
aknysh Oct 24, 2023
d22cb95
update docs
aknysh Oct 24, 2023
10cc7df
update docs
aknysh Oct 24, 2023
359e550
update docs
aknysh Oct 24, 2023
69cf3ee
updates
aknysh Oct 24, 2023
f146fda
updates
aknysh Oct 24, 2023
2249fe6
updates
aknysh Oct 25, 2023
a0058aa
updates
aknysh Oct 25, 2023
b56c285
Update website/docs/core-concepts/vendoring/vendoring.md
aknysh Oct 25, 2023
ab7a057
updates
aknysh Oct 25, 2023
e1e6582
Merge remote-tracking branch 'origin/add-vendor-yaml' into add-vendor…
aknysh Oct 25, 2023
b613797
updates
aknysh Oct 25, 2023
166d4af
updates
aknysh Oct 25, 2023
489a967
updates
aknysh Oct 25, 2023
a7c93be
make file extensions of vendoring manifests optional, assume and use …
aknysh Oct 25, 2023
d868606
make file extensions of vendoring manifests optional, assume and use …
aknysh Oct 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/atlantis_generate_repo_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func init() {
atlantisGenerateRepoConfigCmd.PersistentFlags().String("stacks", "",
"Generate Atlantis projects for the specified stacks only (comma-separated values).\n"+
"atmos atlantis generate repo-config --config-template <config_template> --project-template <project_template> --stacks <stack1>,<stack2>\n"+
"The filter can contain the names of the top-level stack config files and the logical stack names (derived from the context vars)\n"+
"The filter can contain the names of the top-level stack manifests and the logical stack names (derived from the context vars)\n"+
"atmos atlantis generate repo-config --config-template <config_template> --project-template <project_template> --stacks orgs/cp/tenant1/staging/us-east-2,orgs/cp/tenant2/dev/us-east-2\n"+
"atmos atlantis generate repo-config --config-template <config_template> --project-template <project_template> --stacks tenant1-ue2-staging,tenant1-ue2-prod\n"+
"atmos atlantis generate repo-config --config-template <config_template> --project-template <project_template> --stacks orgs/cp/tenant1/staging/us-east-2,tenant1-ue2-prod",
Expand Down
2 changes: 1 addition & 1 deletion cmd/describe_stacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func init() {

describeStacksCmd.PersistentFlags().StringP("stack", "s", "",
"Filter by a specific stack: atmos describe stacks -s <stack>\n"+
"The filter supports names of the top-level stack config files (including subfolder paths), and 'atmos' stack names (derived from the context vars)",
"The filter supports names of the top-level stack manifests (including subfolder paths), and 'atmos' stack names (derived from the context vars)",
)

describeStacksCmd.PersistentFlags().String("components", "", "Filter by specific 'atmos' components: atmos describe stacks --components=<component1>,<component2>")
Expand Down
4 changes: 3 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package cmd

import (
"errors"

"github.com/spf13/cobra"

cfg "github.com/cloudposse/atmos/pkg/config"
Expand Down Expand Up @@ -28,7 +30,7 @@ func init() {
// system dir, home dir, current dir, ENV vars, command-line arguments
// Here we need the custom commands from the config
cliConfig, err := cfg.InitCliConfig(schema.ConfigAndStacksInfo{}, false)
if err != nil && err != cfg.NotFound {
if err != nil && !errors.Is(err, cfg.NotFound) {
u.LogErrorAndExit(err)
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/terraform_generate_backends.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func init() {
terraformGenerateBackendsCmd.PersistentFlags().String("stacks", "",
"Only process the specified stacks (comma-separated values).\n"+
"atmos terraform generate backends --file-template <file_template> --stacks <stack1>,<stack2>\n"+
"The filter can contain names of the top-level stack config files (including subfolder paths), and 'atmos' stack names (derived from the context vars)\n"+
"The filter can contain names of the top-level stack manifests (including subfolder paths), and 'atmos' stack names (derived from the context vars)\n"+
"atmos terraform generate backends --stacks orgs/cp/tenant1/staging/us-east-2,orgs/cp/tenant2/dev/us-east-2\n"+
"atmos terraform generate backends --stacks tenant1-ue2-staging,tenant1-ue2-prod\n"+
"atmos terraform generate backends --stacks orgs/cp/tenant1/staging/us-east-2,tenant1-ue2-prod",
Expand Down
2 changes: 1 addition & 1 deletion cmd/terraform_generate_varfiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func init() {
terraformGenerateVarfilesCmd.PersistentFlags().String("stacks", "",
"Only process the specified stacks (comma-separated values).\n"+
"atmos terraform generate varfiles --file-template <file_template> --stacks <stack1>,<stack2>\n"+
"The filter can contain names of the top-level stack config files (including subfolder paths), and 'atmos' stack names (derived from the context vars)\n"+
"The filter can contain names of the top-level stack manifests (including subfolder paths), and 'atmos' stack names (derived from the context vars)\n"+
"atmos terraform generate varfiles --stacks orgs/cp/tenant1/staging/us-east-2,orgs/cp/tenant2/dev/us-east-2\n"+
"atmos terraform generate varfiles --stacks tenant1-ue2-staging,tenant1-ue2-prod\n"+
"atmos terraform generate varfiles --stacks orgs/cp/tenant1/staging/us-east-2,tenant1-ue2-prod",
Expand Down
6 changes: 3 additions & 3 deletions examples/complete/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Geodesic: https://github.com/cloudposse/geodesic/
ARG GEODESIC_VERSION=2.6.0
ARG GEODESIC_VERSION=2.7.0
ARG GEODESIC_OS=debian

# atmos: https://github.com/cloudposse/atmos
ARG ATMOS_VERSION=1.46.0
ARG ATMOS_VERSION=1.47.0

# Terraform: https://github.com/hashicorp/terraform/releases
ARG TF_VERSION=1.6.1
ARG TF_VERSION=1.6.2

FROM cloudposse/geodesic:${GEODESIC_VERSION}-${GEODESIC_OS}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
# In 'uri', Golang templates are supported https://pkg.go.dev/text/template
# If 'version' is provided, '{{.Version}}' will be replaced with the 'version' value before pulling the files from 'uri'
uri: github.com/cloudposse/terraform-aws-components.git//modules/account-map?ref={{.Version}}
version: 1.315.1
version: 1.323.0
# Only include the files that match the 'included_paths' patterns
# If 'included_paths' is not specified, all files will be matched except those that match the patterns from 'excluded_paths'
# 'included_paths' support POSIX-style Globs for file names/paths (double-star `**` is supported)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
# In 'uri', Golang templates are supported https://pkg.go.dev/text/template
# If 'version' is provided, '{{.Version}}' will be replaced with the 'version' value before pulling the files from 'uri'
uri: github.com/cloudposse/terraform-aws-components.git//modules/vpc-flow-logs-bucket?ref={{.Version}}
version: 1.315.1
version: 1.323.0
# Only include the files that match the 'included_paths' patterns
# If 'included_paths' is not specified, all files will be matched except those that match the patterns from 'excluded_paths'
# 'included_paths' support POSIX-style Globs for file names/paths (double-star `**` is supported)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "flow_logs_s3_bucket" {
source = "cloudposse/vpc-flow-logs-s3-bucket/aws"
version = "0.18.0"
version = "1.0.1"

lifecycle_prefix = var.lifecycle_prefix
lifecycle_tags = var.lifecycle_tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
# In 'uri', Golang templates are supported https://pkg.go.dev/text/template
# If 'version' is provided, '{{.Version}}' will be replaced with the 'version' value before pulling the files from 'uri'
uri: github.com/cloudposse/terraform-aws-components.git//modules/vpc?ref={{.Version}}
version: 1.315.1
version: 1.323.0
# Only include the files that match the 'included_paths' patterns
# If 'included_paths' is not specified, all files will be matched except those that match the patterns from 'excluded_paths'
# 'included_paths' support POSIX-style Globs for file names/paths (double-star `**` is supported)
Expand Down
39 changes: 39 additions & 0 deletions examples/complete/vendor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: atmos/v1
kind: AtmosVendorConfig
metadata:
name: example-vendor-config
description: Atmos vendoring manifest
spec:
# `imports` or `sources` (or both) must be defined in a vendoring manifest
imports:
- "vendor/vendor2"
- "vendor/vendor3.yaml"

sources:
# `source` supports the following protocols: OCI (https://opencontainers.org), Git, Mercurial, HTTP, HTTPS, Amazon S3, Google GCP,
# and all URL and archive formats as described in https://github.com/hashicorp/go-getter.
# In 'source', Golang templates are supported https://pkg.go.dev/text/template.
# If 'version' is provided, '{{.Version}}' will be replaced with the 'version' value before pulling the files from 'source'.
# Download the component from the AWS public ECR registry (https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html).
- component: "vpc"
source: "oci://public.ecr.aws/cloudposse/components/terraform/stable/aws/vpc:{{.Version}}"
version: "latest"
targets:
- "components/terraform/infra/vpc3"
# Only include the files that match the 'included_paths' patterns.
# If 'included_paths' is not specified, all files will be matched except those that match the patterns from 'excluded_paths'.
# 'included_paths' support POSIX-style Globs for file names/paths (double-star `**` is supported).
# https://en.wikipedia.org/wiki/Glob_(programming)
# https://github.com/bmatcuk/doublestar#patterns
included_paths:
- "**/*.tf"
- "**/*.tfvars"
- "**/*.md"
- component: "vpc-flow-logs-bucket"
source: "github.com/cloudposse/terraform-aws-components.git//modules/vpc-flow-logs-bucket?ref={{.Version}}"
version: "1.323.0"
targets:
- "components/terraform/infra/vpc-flow-logs-bucket/{{.Version}}"
excluded_paths:
- "**/*.yaml"
- "**/*.yml"
20 changes: 20 additions & 0 deletions examples/complete/vendor/vendor2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: atmos/v1
kind: AtmosVendorConfig
metadata:
name: example-vendor-config-2
description: Atmos vendoring manifest
spec:
imports:
- "vendor/vendor4"

sources:
- component: "my-vpc1"
source: "oci://public.ecr.aws/cloudposse/components/terraform/stable/aws/vpc:{{.Version}}"
version: "latest"
targets:
- "components/terraform/infra/my-vpc1"
- component: "my-vpc2"
source: "github.com/cloudposse/terraform-aws-components.git//modules/vpc?ref={{.Version}}"
version: "1.320.0"
targets:
- "components/terraform/infra/my-vpc2"
8 changes: 8 additions & 0 deletions examples/complete/vendor/vendor3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: atmos/v1
kind: AtmosVendorConfig
metadata:
name: example-vendor-config-3
description: Atmos vendoring manifest
spec:
imports:
- "vendor/vendor6"
15 changes: 15 additions & 0 deletions examples/complete/vendor/vendor4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: atmos/v1
kind: AtmosVendorConfig
metadata:
name: example-vendor-config-4
description: Atmos vendoring manifest
spec:
imports:
- "vendor/vendor5"

sources:
- component: "my-vpc4"
source: "github.com/cloudposse/terraform-aws-components.git//modules/vpc?ref={{.Version}}"
version: "1.319.0"
targets:
- "components/terraform/infra/my-vpc4"
12 changes: 12 additions & 0 deletions examples/complete/vendor/vendor5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: atmos/v1
kind: AtmosVendorConfig
metadata:
name: example-vendor-config-5
description: Atmos vendoring manifest
spec:
sources:
- component: "my-vpc5"
source: "github.com/cloudposse/terraform-aws-components.git//modules/vpc?ref={{.Version}}"
version: "1.317.0"
targets:
- "components/terraform/infra/my-vpc5"
12 changes: 12 additions & 0 deletions examples/complete/vendor/vendor6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: atmos/v1
kind: AtmosVendorConfig
metadata:
name: example-vendor-config-6
description: Atmos vendoring manifest
spec:
sources:
- component: "my-vpc6"
source: "github.com/cloudposse/terraform-aws-components.git//modules/vpc?ref={{.Version}}"
version: "1.315.0"
targets:
- "components/terraform/infra/my-vpc6"
18 changes: 9 additions & 9 deletions go.mod
aknysh marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ go 1.21

require (
github.com/Masterminds/sprig/v3 v3.2.3
github.com/bmatcuk/doublestar/v4 v4.6.0
github.com/bmatcuk/doublestar/v4 v4.6.1
aknysh marked this conversation as resolved.
Show resolved Hide resolved
aknysh marked this conversation as resolved.
Show resolved Hide resolved
aknysh marked this conversation as resolved.
Show resolved Hide resolved
aknysh marked this conversation as resolved.
Show resolved Hide resolved
aknysh marked this conversation as resolved.
Show resolved Hide resolved
github.com/fatih/color v1.15.0
github.com/go-git/go-git/v5 v5.9.0
github.com/google/go-containerregistry v0.16.1
github.com/google/uuid v1.3.1
github.com/hashicorp/go-getter v1.7.2
github.com/hashicorp/go-getter v1.7.3
github.com/hashicorp/hcl v1.0.0
github.com/hashicorp/hcl/v2 v2.18.1
github.com/hashicorp/hcl/v2 v2.19.1
github.com/hashicorp/terraform-config-inspect v0.0.0-20230925220900-5a6f8d18746d
github.com/imdario/mergo v0.3.13
github.com/json-iterator/go v1.1.12
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/mapstructure v1.5.0
github.com/open-policy-agent/opa v0.57.0
github.com/open-policy-agent/opa v0.57.1
github.com/otiai10/copy v1.14.0
github.com/pkg/errors v0.9.1
github.com/samber/lo v1.38.1
Expand Down Expand Up @@ -119,17 +119,17 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tchap/go-patricia/v2 v2.3.1 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/vbatts/tar-split v0.11.3 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/yashtewari/glob-intersection v0.2.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/otel v1.16.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/otel/sdk v1.16.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect
go.opentelemetry.io/otel v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.opentelemetry.io/otel/sdk v1.19.0 // indirect
go.opentelemetry.io/otel/trace v1.19.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
Expand Down
Loading
Loading