Skip to content

Commit

Permalink
Add atmos describe affected CLI command. Update docs website (#274)
Browse files Browse the repository at this point in the history
* Update versions

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Update website/docs/cli/commands/describe/describe-affected.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com>

* Add `atmos describe affected` command

* Add `atmos describe affected` command

* Update website/docs/cli/commands/describe/describe-affected.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com>

* Add `atmos describe affected` command

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <erik@cloudposse.com>
  • Loading branch information
aknysh and osterman committed Dec 15, 2022
1 parent 7697c2c commit c90dcb8
Show file tree
Hide file tree
Showing 15 changed files with 993 additions and 81 deletions.
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 --format=json|yaml ('json' is default)")
describeAffectedCmd.PersistentFlags().Bool("verbose", false, "Print more detailed output when cloning and checking out the Git repository: atmos describe affected --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
)

0 comments on commit c90dcb8

Please sign in to comment.