Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5770a06
Update atlantis integration
aknysh Feb 14, 2023
b108e91
Add `settings.atlantis` section
aknysh Feb 19, 2023
6446718
Add `settings.atlantis` section
aknysh Feb 19, 2023
cb5befb
Add `settings.atlantis` section
aknysh Feb 19, 2023
856e044
Add `settings.atlantis` section
aknysh Feb 19, 2023
ac94ecd
Update Atlantis integration
aknysh Feb 19, 2023
ed32fbb
Update Atlantis integration
aknysh Feb 19, 2023
ef5c451
Update Atlantis integration
aknysh Feb 19, 2023
b343d1d
Update Atlantis integration
aknysh Feb 19, 2023
5f3d8c6
Update Atlantis integration
aknysh Feb 19, 2023
94f0ce6
Update Atlantis integration
aknysh Feb 19, 2023
f2e53a2
Update Atlantis integration
aknysh Feb 20, 2023
348ec6c
Update Atlantis integration
aknysh Feb 20, 2023
f3abe6f
Update Atlantis integration
aknysh Feb 20, 2023
31b794d
Update Atlantis integration
aknysh Feb 20, 2023
eb451c9
Update docs
aknysh Feb 20, 2023
d006dab
Update docs
aknysh Feb 20, 2023
3ea20ae
Update docs
aknysh Feb 20, 2023
4395de4
Update docs
aknysh Feb 20, 2023
05a0a4c
Update docs
aknysh Feb 20, 2023
f5a48e2
Update docs
aknysh Feb 20, 2023
b7d6e1c
Update docs
aknysh Feb 21, 2023
0631c5c
Update docs
aknysh Feb 21, 2023
67efd7d
Update docs
aknysh Feb 21, 2023
f18cf9f
Update docs
aknysh Feb 21, 2023
f30459a
Update docs
aknysh Feb 21, 2023
54d202c
Update docs
aknysh Feb 21, 2023
2f68994
Update docs
aknysh Feb 21, 2023
edada38
Update docs
aknysh Feb 21, 2023
ddcbbab
Update docs
aknysh Feb 21, 2023
89a4a00
Update docs
aknysh Feb 21, 2023
dcbec64
Update docs
aknysh Feb 21, 2023
4c7aa16
Update docs
aknysh Feb 21, 2023
e1e80af
Update docs
aknysh Feb 21, 2023
c500fb4
Add `--format` and `--file` flags to `atmos describe component` command
aknysh Feb 22, 2023
a7a9104
Update website/docs/integrations/atlantis.md
aknysh Feb 24, 2023
66c02ae
Update website/docs/integrations/atlantis.md
aknysh Feb 24, 2023
d75c29e
Update website/docs/integrations/atlantis.md
aknysh Feb 24, 2023
181c4a9
Update website/docs/integrations/atlantis.md
aknysh Feb 24, 2023
aaa6734
Update website/docs/integrations/atlantis.md
aknysh Feb 24, 2023
a11e83e
Update website/docs/integrations/atlantis.md
aknysh Feb 24, 2023
4894602
Update website/docs/integrations/atlantis.md
aknysh Feb 24, 2023
564c0fd
Update website/docs/integrations/atlantis.md
aknysh Feb 24, 2023
0343edd
Update website/docs/integrations/atlantis.md
aknysh Feb 24, 2023
e4dec46
Update website/docs/integrations/atlantis.md
aknysh Feb 24, 2023
16f95c8
Update website/docs/integrations/atlantis.md
aknysh Feb 24, 2023
8efde07
Updates
aknysh Feb 24, 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
72 changes: 72 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
name: Bug report
description: Create a report to help us improve
labels: ["bug"]
assignees: [""]
body:
- type: markdown
attributes:
value: |
Found a bug?

Please checkout our [Slack Community](https://slack.cloudposse.com)
or visit our [Slack Archive](https://archive.sweetops.com/).

[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)

- type: textarea
id: concise-description
attributes:
label: Describe the Bug
description: A clear and concise description of what the bug is.
placeholder: What is the bug about?
validations:
required: true

- type: textarea
id: expected
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected.
placeholder: What happened?
validations:
required: true

- type: textarea
id: reproduction-steps
attributes:
label: Steps to Reproduce
description: Steps to reproduce the behavior.
placeholder: How do we reproduce it?
validations:
required: true

- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If applicable, add screenshots or logs to help explain.
validations:
required: false

- type: textarea
id: environment
attributes:
label: Environment
description: Anything that will help us triage the bug.
placeholder: |
- OS: [e.g. Linux, OSX, WSL, etc]
- Version [e.g. 10.15]
- Module version
- Terraform version
validations:
required: false

- type: textarea
id: additional
attributes:
label: Additional Context
description: |
Add any other context about the problem here.
validations:
required: false
71 changes: 71 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
name: Feature Request
description: Suggest an idea for this project
labels: ["feature request"]
assignees: [""]
body:
- type: markdown
attributes:
value: |
Have a question?

Please checkout our [Slack Community](https://slack.cloudposse.com)
or visit our [Slack Archive](https://archive.sweetops.com/).

[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)

- type: textarea
id: concise-description
attributes:
label: Describe the Feature
description: A clear and concise description of what the feature is.
placeholder: What is the feature about?
validations:
required: true

- type: textarea
id: expected
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected.
placeholder: What happened?
validations:
required: true

- type: textarea
id: use-case
attributes:
label: Use Case
description: |
Is your feature request related to a problem/challenge you are trying
to solve?

Please provide some additional context of why this feature or
capability will be valuable.
validations:
required: true

- type: textarea
id: ideal-solution
attributes:
label: Describe Ideal Solution
description: A clear and concise description of what you want to happen.
validations:
required: true

- type: textarea
id: alternatives-considered
attributes:
label: Alternatives Considered
description: Explain alternative solutions or features considered.
validations:
required: false

- type: textarea
id: additional
attributes:
label: Additional Context
description: |
Add any other context about the problem here.
validations:
required: false
22 changes: 15 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
## what
* Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?)
* Use bullet points to be concise and to the point.

<!--
- Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?)
- Use bullet points to be concise and to the point.
-->

## why
* Provide the justifications for the changes (e.g. business case).
* Describe why these changes were made (e.g. why do these commits fix the problem?)
* Use bullet points to be concise and to the point.

<!--
- Provide the justifications for the changes (e.g. business case).
- Describe why these changes were made (e.g. why do these commits fix the problem?)
- Use bullet points to be concise and to the point.
-->

## references
* Link to any supporting github issues or helpful documentation to add some context (e.g. stackoverflow).
* Use `closes #123`, if this PR closes a GitHub issue `#123`

<!--
- Link to any supporting github issues or helpful documentation to add some context (e.g. stackoverflow).
- Use `closes #123`, if this PR closes a GitHub issue `#123`
-->
4 changes: 2 additions & 2 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
- uses: actions-ecosystem/action-get-merged-pull-request@v1
id: get-merged-pull-request
with:
github_token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
github_token: ${{ secrets.REPO_ACCESS_TOKEN }}
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v5
with:
publish: ${{ !contains(steps.get-merged-pull-request.outputs.labels, 'no-release') }}
prerelease: false
config-name: auto-release.yml
env:
GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/validate-codeowners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
checks: "syntax,owners,duppatterns"
owner_checker_allow_unowned_patterns: "false"
# GitHub access token is required only if the `owners` check is enabled
github_access_token: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"
github_access_token: "${{ secrets.REPO_ACCESS_TOKEN }}"
- uses: mszostok/codeowners-validator@v0.7.1
if: github.event.pull_request.head.repo.full_name != github.repository
name: "Syntax check of CODEOWNERS"
Expand Down
1 change: 0 additions & 1 deletion atmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ integrations:
# Workflow templates
# https://www.runatlantis.io/docs/custom-workflows.html#custom-init-plan-apply-commands
# https://www.runatlantis.io/docs/custom-workflows.html#custom-run-command
# Select a template by using the '--workflow-template <workflow_template>' command-line argument in 'atmos atlantis generate repo-config' command
workflow_templates:
workflow-1:
plan:
Expand Down
33 changes: 17 additions & 16 deletions cmd/atlantis_generate_repo_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,35 @@ var atlantisGenerateRepoConfigCmd = &cobra.Command{
func init() {
atlantisGenerateRepoConfigCmd.DisableFlagParsing = false

atlantisGenerateRepoConfigCmd.PersistentFlags().String("output-path", "", "atmos atlantis generate repo-config --output-path ./atlantis.yaml --config-template config-1 --project-template project-1 --workflow-template workflow-1")
atlantisGenerateRepoConfigCmd.PersistentFlags().String("config-template", "", "atmos atlantis generate repo-config --config-template config-1 --project-template project-1 --workflow-template workflow-1")
atlantisGenerateRepoConfigCmd.PersistentFlags().String("project-template", "", "atmos atlantis generate repo-config --config-template config-1 --project-template project-1 --workflow-template workflow-1")
atlantisGenerateRepoConfigCmd.PersistentFlags().String("workflow-template", "", "atmos atlantis generate repo-config --config-template config-1 --project-template project-1 --workflow-template workflow-1")
atlantisGenerateRepoConfigCmd.PersistentFlags().String("output-path", "", "atmos atlantis generate repo-config --output-path ./atlantis.yaml --config-template config-1 --project-template project-1")
atlantisGenerateRepoConfigCmd.PersistentFlags().String("config-template", "", "atmos atlantis generate repo-config --config-template config-1 --project-template project-1")
atlantisGenerateRepoConfigCmd.PersistentFlags().String("project-template", "", "atmos atlantis generate repo-config --config-template config-1 --project-template project-1")

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"+
"atmos atlantis generate repo-config --config-template <config_template> --project-template <project_template> --workflow-template <workflow_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> --workflow-template <workflow_template> --stacks tenant1-ue2-staging,tenant1-ue2-prod\n"+
"atmos atlantis generate repo-config --config-template <config_template> --project-template <project_template> --workflow-template <workflow_template> --stacks orgs/cp/tenant1/staging/us-east-2,tenant1-ue2-prod",
"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",
)

atlantisGenerateRepoConfigCmd.PersistentFlags().String("components", "",
"Generate Atlantis projects for the specified components only (comma-separated values).\n"+
"atmos atlantis generate repo-config --config-template <config_template> --project-template <project_template> --workflow-template <workflow_template> --components <component1>,<component2>",
"atmos atlantis generate repo-config --config-template <config_template> --project-template <project_template> --components <component1>,<component2>",
)

err := atlantisGenerateRepoConfigCmd.MarkPersistentFlagRequired("config-template")
if err != nil {
u.PrintErrorToStdErrorAndExit(err)
}
atlantisGenerateRepoConfigCmd.PersistentFlags().Bool("affected-only", false,
"Generate Atlantis projects only for the Atmos components changed between two Git commits.\n"+
"atmos atlantis generate repo-config --affected-only=true",
)

err = atlantisGenerateRepoConfigCmd.MarkPersistentFlagRequired("project-template")
if err != nil {
u.PrintErrorToStdErrorAndExit(err)
}
atlantisGenerateRepoConfigCmd.PersistentFlags().String("repo-path", "", "Filesystem path to the already cloned target repository with which to compare the current branch: atmos atlantis generate repo-config --affected-only=true --repo-path <path_to_already_cloned_repo>")
atlantisGenerateRepoConfigCmd.PersistentFlags().String("ref", "", "Git reference with which to compare the current branch: atmos atlantis generate repo-config --affected-only=true --ref refs/heads/main. Refer to https://git-scm.com/book/en/v2/Git-Internals-Git-References for more details")
atlantisGenerateRepoConfigCmd.PersistentFlags().String("sha", "", "Git commit SHA with which to compare the current branch: atmos atlantis generate repo-config --affected-only=true --sha 3a5eafeab90426bd82bf5899896b28cc0bab3073")
atlantisGenerateRepoConfigCmd.PersistentFlags().Bool("verbose", false, "Print more detailed output when cloning and checking out the Git repository: atmos atlantis generate repo-config --affected-only=true --verbose=true")
atlantisGenerateRepoConfigCmd.PersistentFlags().String("ssh-key", "", "Path to PEM-encoded private key to clone private repos using SSH: atmos atlantis generate repo-config --affected-only=true --ssh-key <path_to_ssh_key>")
atlantisGenerateRepoConfigCmd.PersistentFlags().String("ssh-key-password", "", "Encryption password for the PEM-encoded private key if the key contains a password-encrypted PEM block: atmos atlantis generate repo-config --affected-only=true --ssh-key <path_to_ssh_key> --ssh-key-password <password>")

atlantisGenerateCmd.AddCommand(atlantisGenerateRepoConfigCmd)
}
2 changes: 2 additions & 0 deletions cmd/describe_component.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ var describeComponentCmd = &cobra.Command{
func init() {
describeComponentCmd.DisableFlagParsing = false
describeComponentCmd.PersistentFlags().StringP("stack", "s", "", "atmos describe component <component> -s <stack>")
describeComponentCmd.PersistentFlags().StringP("format", "f", "yaml", "The output format: atmos describe component <component> -s <stack> --format=yaml|json ('yaml' is default)")
describeComponentCmd.PersistentFlags().String("file", "", "Write the result to the file: atmos describe component <component> -s <stack> --file component.yaml")

err := describeComponentCmd.MarkPersistentFlagRequired("stack")
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/describe_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var describeConfigCmd = &cobra.Command{

func init() {
describeConfigCmd.DisableFlagParsing = false
describeConfigCmd.PersistentFlags().StringP("format", "f", "json", "'atmos describe config -f json' or 'atmos describe config -f yaml'")
describeConfigCmd.PersistentFlags().StringP("format", "f", "json", "The output format: atmos describe config -f json|yaml")

describeCmd.AddCommand(describeConfigCmd)
}
4 changes: 2 additions & 2 deletions examples/complete/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
ARG GEODESIC_VERSION=1.7.0
ARG GEODESIC_OS=debian
# atmos: https://github.com/cloudposse/atmos
ARG ATMOS_VERSION=1.24.0
ARG ATMOS_VERSION=1.30.0
# Terraform: https://github.com/hashicorp/terraform/releases
ARG TF_VERSION=1.3.7
ARG TF_VERSION=1.3.8

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

Expand Down
1 change: 0 additions & 1 deletion examples/complete/atmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ integrations:
# Workflow templates
# https://www.runatlantis.io/docs/custom-workflows.html#custom-init-plan-apply-commands
# https://www.runatlantis.io/docs/custom-workflows.html#custom-run-command
# Select a template by using the '--workflow-template <workflow_template>' command-line argument in 'atmos atlantis generate repo-config' command
workflow_templates:
workflow-1:
plan:
Expand Down
1 change: 0 additions & 1 deletion examples/complete/rootfs/usr/local/etc/atmos/atmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ integrations:
# Workflow templates
# https://www.runatlantis.io/docs/custom-workflows.html#custom-init-plan-apply-commands
# https://www.runatlantis.io/docs/custom-workflows.html#custom-run-command
# Select a template by using the '--workflow-template <workflow_template>' command-line argument in 'atmos atlantis generate repo-config' command
workflow_templates:
workflow-1:
plan:
Expand Down
33 changes: 33 additions & 0 deletions examples/complete/stacks/orgs/cp/_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,36 @@ helmfile:
components:
terraform: {}
helmfile: {}

settings:
atlantis:
# Select a config template defined in `atmos.yaml` in the `integrations.atlantis.config_templates` section
config_template_name: "config-1"

# Select a project template defined in `atmos.yaml` in the `integrations.atlantis.project_templates` section
project_template_name: "project-1"

# Workflow templates
# https://www.runatlantis.io/docs/custom-workflows.html#custom-init-plan-apply-commands
# https://www.runatlantis.io/docs/custom-workflows.html#custom-run-command
workflow_templates:
workflow-1:
plan:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does plan support the env key for arbitrary environment variables?

https://www.runatlantis.io/docs/custom-workflows.html#step

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure I'm following, can you provide an example of that?

(the workflows configs are just copied to the atlantis.yaml file verbatim if you use the repo level workflows)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok so something like this would work then since atlantis supports? That means that this object is now an any?

    workflow_templates:
      workflow-1:
        plan:
          steps:
          - env:
              name: ENV_NAME
              value: hard-coded-value
          - env:
              name: ENV_NAME_2
              command: 'echo "dynamic-value-$(date)"'

If so, perfect :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

atmos does not touch the internals of the workflows definitions. You can def use any ENV vars in there that are set in the process (atmos does not check what's inside the workflows and does not set any ENV vars for it)

steps:
- run: terraform init
# When using workspaces, you need to select the workspace using the $WORKSPACE environment variable
- run: terraform workspace select $WORKSPACE || terraform workspace new $WORKSPACE
# You must output the plan using '-out $PLANFILE' because Atlantis expects plans to be in a specific location
- run: terraform plan -out $PLANFILE -var-file varfiles/$PROJECT_NAME.tfvars.json
apply:
steps:
- run: terraform apply $PLANFILE
workflow-2:
plan:
steps:
- run: terraform init -reconfigure
- run: terraform workspace select $WORKSPACE || terraform workspace new $WORKSPACE
- run: terraform plan -out $PLANFILE -var-file varfiles/$PROJECT_NAME.tfvars.json
apply:
steps:
- run: terraform apply $PLANFILE
32 changes: 32 additions & 0 deletions examples/complete/stacks/orgs/cp/tenant1/dev/us-east-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,35 @@ components:
- us-east-2a
- us-east-2b
- us-east-2c

settings:
atlantis:

# For this `tenant1-ue2-dev` stack, override the org-wide config template specified in `examples/complete/stacks/orgs/cp/_defaults.yaml`
# in the `settings.atlantis.config_template_name` section
config_template:
version: 3
automerge: false
delete_source_branch_on_merge: false
parallel_plan: true
parallel_apply: false
allowed_regexp_prefixes:
- dev/

# For this `tenant1-ue2-dev` stack, override the org-wide project template specified in `examples/complete/stacks/orgs/cp/_defaults.yaml`
# in the `settings.atlantis.project_template_name` section
project_template:
# generate a project entry for each component in every stack
name: "{tenant}-{environment}-{stage}-{component}"
workspace: "{workspace}"
workflow: "workflow-1"
dir: "{component-path}"
terraform_version: v1.3
delete_source_branch_on_merge: false
autoplan:
enabled: true
when_modified:
- "**/*.tf"
- "varfiles/$PROJECT_NAME.tfvars.json"
apply_requirements:
- "approved"
Loading