PePe Amengual
01/12/2023, 11:43 PMprod that then is used to filter PR against a prod environment etcRB
01/12/2023, 11:51 PMRB
01/12/2023, 11:52 PMRB
01/12/2023, 11:53 PMPePe Amengual
01/12/2023, 11:54 PMPePe Amengual
01/12/2023, 11:54 PMPePe Amengual
01/12/2023, 11:55 PMRB
01/12/2023, 11:55 PMPePe Amengual
01/12/2023, 11:55 PMRB
01/12/2023, 11:56 PMPePe Amengual
01/12/2023, 11:57 PMPePe Amengual
01/12/2023, 11:58 PM#!/usr/bin/env bash
atmos describe affected --ref refs/heads/main --file affected.json
stacks=""
components=""
for s in `jq -cr '.[]|.stack' affected.json|uniq`; do stacks+="${s},"; done
for c in `jq -cr '.[]|.component' affected.json|uniq`; do components+="${c},"; done
echo ${stacks%?}
echo ${components%?}
atmos atlantis generate repo-config --config-template config-1 --project-template project-1 --workflow-template workflow-1 --stacks ${stacks%?} --components ${components%?}PePe Amengual
01/12/2023, 11:59 PMPePe Amengual
01/12/2023, 11:59 PMPePe Amengual
01/12/2023, 11:59 PMatlantis.yaml file that will only contain the affected components/projectsPePe Amengual
01/13/2023, 12:00 AMRB
01/13/2023, 12:00 AMRB
01/13/2023, 12:01 AMPePe Amengual
01/13/2023, 12:02 AMatlantis plan -p myproject or have autoplan enabled and it will only plan the stuff that pretends to the PR, do you see how powerful this is?PePe Amengual
01/13/2023, 12:02 AMatlantis to have to have this guardrails and brings is back to the source …..the VCSPePe Amengual
01/13/2023, 12:02 AMRB
01/13/2023, 12:03 AMatlantis.yaml file for only stacks/components affected so you do not need to run the custom shell script e.g. atmos atlantis generate repo-config --affectedPePe Amengual
01/13/2023, 12:05 AMfor s in `jq -cr '.[]|.stack' affected.json|uniq`; do if [ $s == “.*-prod”]; then stacks+=“${s},” fi; done
( I think the syntax is wrong but you get the idea)PePe Amengual
01/13/2023, 12:06 AMPePe Amengual
01/13/2023, 12:08 AMPePe Amengual
01/13/2023, 12:08 AMPePe Amengual
01/13/2023, 12:08 AMAndriy Knysh (Cloud Posse)
01/13/2023, 12:12 AMatmos describe affected - it will eliminate a lot of shell codeAndriy Knysh (Cloud Posse)
01/13/2023, 12:14 AMatmos atlantis generate repo-config --affected-only is another feature, @PePe Amengual if you think it would be useful, please open another issue or add it to the one you already openedPePe Amengual
01/13/2023, 12:37 AMPePe Amengual
01/13/2023, 1:23 AMAndriy Knysh (Cloud Posse)
01/13/2023, 1:34 AM