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

Add atmos describe affected CLI command. Update docs website #274

Merged
merged 49 commits into from Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1e3bcf9
Update versions
aknysh Dec 13, 2022
56d89d1
Add `atmos describe affected` command
aknysh Dec 13, 2022
0394de0
Add `atmos describe affected` command
aknysh Dec 13, 2022
1e90abc
Add `atmos describe affected` command
aknysh Dec 13, 2022
15701db
Add `atmos describe affected` command
aknysh Dec 13, 2022
02d95a4
Add `atmos describe affected` command
aknysh Dec 13, 2022
28e6376
Add `atmos describe affected` command
aknysh Dec 13, 2022
55f1a82
Add `atmos describe affected` command
aknysh Dec 14, 2022
97b2313
Add `atmos describe affected` command
aknysh Dec 14, 2022
f9ade38
Add `atmos describe affected` command
aknysh Dec 14, 2022
85577af
Add `atmos describe affected` command
aknysh Dec 14, 2022
68981fb
Add `atmos describe affected` command
aknysh Dec 14, 2022
12ba1eb
Add `atmos describe affected` command
aknysh Dec 14, 2022
84a88eb
Add `atmos describe affected` command
aknysh Dec 14, 2022
b7560da
Add `atmos describe affected` command
aknysh Dec 14, 2022
419eb9e
Add `atmos describe affected` command
aknysh Dec 14, 2022
c1173e8
Add `atmos describe affected` command
aknysh Dec 14, 2022
3937ed5
Add `atmos describe affected` command
aknysh Dec 14, 2022
d0eafe6
Add `atmos describe affected` command
aknysh Dec 14, 2022
13cc1ea
Add `atmos describe affected` command
aknysh Dec 14, 2022
6c60358
Add `atmos describe affected` command
aknysh Dec 14, 2022
5f18e6f
Add `atmos describe affected` command
aknysh Dec 14, 2022
1bdac55
Add `atmos describe affected` command
aknysh Dec 14, 2022
4b6a45b
Add `atmos describe affected` command
aknysh Dec 14, 2022
ad021c0
Add `atmos describe affected` command
aknysh Dec 14, 2022
78b89a3
Add `atmos describe affected` command
aknysh Dec 14, 2022
f8fd5aa
Merge branch 'master' into add-describe-affected-cli-command
aknysh Dec 14, 2022
c746fc6
Add `atmos describe affected` command
aknysh Dec 14, 2022
6ab91cb
Add `atmos describe affected` command
aknysh Dec 14, 2022
4e8e53f
Add `atmos describe affected` command
aknysh Dec 14, 2022
46b9ae6
Add `atmos describe affected` command
aknysh Dec 15, 2022
517fc69
Add `atmos describe affected` command
aknysh Dec 15, 2022
325f340
Add `atmos describe affected` command
aknysh Dec 15, 2022
bbc5f69
Add `atmos describe affected` command
aknysh Dec 15, 2022
f376f19
Add `atmos describe affected` command
aknysh Dec 15, 2022
8636adb
Add `atmos describe affected` command
aknysh Dec 15, 2022
7d37c1e
Add `atmos describe affected` command
aknysh Dec 15, 2022
26ff11b
Add `atmos describe affected` command
aknysh Dec 15, 2022
5fc42b7
Add `atmos describe affected` command
aknysh Dec 15, 2022
d9226b0
Add `atmos describe affected` command
aknysh Dec 15, 2022
429d6f5
Add `atmos describe affected` command
aknysh Dec 15, 2022
41cf866
Add `atmos describe affected` command
aknysh Dec 15, 2022
5023796
Add `atmos describe affected` command
aknysh Dec 15, 2022
e3f4a89
Update website/docs/cli/commands/describe/describe-affected.md
aknysh Dec 15, 2022
20b89ae
Add `atmos describe affected` command
aknysh Dec 15, 2022
8c7134e
Add `atmos describe affected` command
aknysh Dec 15, 2022
93424c7
Update website/docs/cli/commands/describe/describe-affected.md
aknysh Dec 15, 2022
d0710a2
Add `atmos describe affected` command
aknysh Dec 15, 2022
da4ca8b
Merge branch 'master' into add-describe-affected-cli-command
aknysh Dec 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 34 additions & 0 deletions cmd/describe_affected.go
@@ -0,0 +1,34 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
)

// describeAffectedCmd produces a list of the affected Atmos components and stacks given two Git commits
var describeAffectedCmd = &cobra.Command{
Use: "affected",
Short: "Execute 'describe affected' command",
Long: `This command produces a list of the affected Atmos components and stacks given two Git commits: atmos describe stacks [options]`,
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: true},
Run: func(cmd *cobra.Command, args []string) {
err := e.ExecuteDescribeAffectedCmd(cmd, args)
if err != nil {
u.PrintErrorToStdErrorAndExit(err)
}
},
}

func init() {
describeAffectedCmd.DisableFlagParsing = false

describeAffectedCmd.PersistentFlags().String("ref", "", "Git reference with which to compare the current branch: atmos describe affected --ref refs/heads/main. Refer to https://git-scm.com/book/en/v2/Git-Internals-Git-References for more details")
describeAffectedCmd.PersistentFlags().String("sha", "", "Git commit SHA with which to compare the current branch: atmos describe affected --sha 3a5eafeab90426bd82bf5899896b28cc0bab3073")
describeAffectedCmd.PersistentFlags().String("file", "", "Write the result to the file: atmos describe affected --ref refs/tags/v1.16.0 --file affected.json")
describeAffectedCmd.PersistentFlags().String("format", "json", "The output format: atmos describe affected --ref refs/heads/main --format=json|yaml ('json' is default)")
describeAffectedCmd.PersistentFlags().Bool("verbose", false, "atmos describe affected --ref refs/heads/main --verbose=true")

describeCmd.AddCommand(describeAffectedCmd)
}
6 changes: 3 additions & 3 deletions examples/complete/Dockerfile
@@ -1,10 +1,10 @@
# Geodesic: https://github.com/cloudposse/geodesic/
ARG GEODESIC_VERSION=1.3.2
ARG GEODESIC_VERSION=1.6.0
ARG GEODESIC_OS=debian
# atmos: https://github.com/cloudposse/atmos
ARG ATMOS_VERSION=1.9.0
ARG ATMOS_VERSION=1.17.0
# Terraform: https://github.com/hashicorp/terraform/releases
ARG TF_VERSION=1.3.0
ARG TF_VERSION=1.3.6

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

Expand Down
38 changes: 27 additions & 11 deletions go.mod
Expand Up @@ -5,14 +5,15 @@ go 1.19
require (
github.com/bmatcuk/doublestar/v4 v4.4.0
github.com/fatih/color v1.13.0
github.com/go-git/go-git/v5 v5.5.1
github.com/hashicorp/go-getter v1.6.2
github.com/hashicorp/hcl v1.0.0
github.com/hashicorp/hcl/v2 v2.15.0
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.46.1
github.com/open-policy-agent/opa v0.47.3
github.com/otiai10/copy v1.9.0
github.com/pkg/errors v0.9.1
github.com/santhosh-tekuri/jsonschema/v5 v5.1.1
Expand All @@ -21,7 +22,7 @@ require (
github.com/stretchr/testify v1.8.1
github.com/zclconf/go-cty v1.12.1
gopkg.in/yaml.v2 v2.4.0
mvdan.cc/sh/v3 v3.5.1
mvdan.cc/sh/v3 v3.6.0
)

require (
Expand All @@ -31,16 +32,20 @@ require (
cloud.google.com/go/iam v0.3.0 // indirect
cloud.google.com/go/storage v1.23.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/OneOfOne/xxhash v1.2.8 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/agext/levenshtein v1.2.1 // indirect
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/aws/aws-sdk-go v1.15.78 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bytecodealliance/wasmtime-go v1.0.0 // indirect
github.com/bytecodealliance/wasmtime-go/v3 v3.0.2 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/containerd/containerd v1.6.9 // indirect
github.com/cloudflare/circl v1.1.0 // indirect
github.com/containerd/containerd v1.6.10 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/cli v20.10.17+incompatible // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
Expand All @@ -49,8 +54,11 @@ require (
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.3.1 // indirect
github.com/go-ini/ini v1.67.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
Expand All @@ -68,7 +76,9 @@ require (
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.1.0 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
Expand All @@ -85,41 +95,47 @@ require (
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/pjbgf/sha1cd v0.2.3 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.13.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/skeema/knownhosts v1.1.0 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/tchap/go-patricia/v2 v2.3.1 // indirect
github.com/ulikunitz/xz v0.5.8 // 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.1.0 // indirect
go.opencensus.io v0.23.0 // indirect
go.opentelemetry.io/otel v1.7.0 // indirect
go.opentelemetry.io/otel/sdk v1.7.0 // indirect
go.opentelemetry.io/otel/trace v1.7.0 // indirect
golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect
golang.org/x/crypto v0.3.0 // indirect
golang.org/x/net v0.4.0 // indirect
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.0.0-20221010170243-090e33056c14 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/term v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.102.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e // indirect
google.golang.org/grpc v1.50.1 // indirect
google.golang.org/grpc v1.51.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
oras.land/oras-go v1.2.1 // indirect
)