Skip to content

Commit

Permalink
Move atmos-gitops-config.yaml to atmos.yaml (#39)
Browse files Browse the repository at this point in the history
* Move configs to atmos.yaml

* Move configs to atmos.yaml

* Move configs to atmos.yaml

* Move configs to atmos.yaml

* Update README

* Update README

* Fix atmos terraform

* Fix atmos terraform

* Fix atmos terraform

* Fix atmos terraform

* Fix atmos terraform

* Fix atmos terraform

* Added rename

* Added rename

* Added rename

* Added rename

* Added rename

* Added rename

* Added rename

* Added rename

* Fix readme

* Address comments

* Address comments

* Replace storage with artifact-storage in atmos.yaml config

* Replace storage with artifact-storage in atmos.yaml config

* Address comments
  • Loading branch information
goruha authored Mar 11, 2024
1 parent c52520f commit 3ec18a4
Show file tree
Hide file tree
Showing 6 changed files with 379 additions and 212 deletions.
53 changes: 25 additions & 28 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,29 @@ jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- shell: bash
run: |
mkdir -p ${{ runner.temp }}
cat > ${{ runner.temp }}/atmos-gitops.yaml <<EOL
atmos-version: 1.45.3
atmos-config-path: ./tests/
terraform-state-bucket: ${{ secrets.TERRAFORM_STATE_BUCKET }}
terraform-state-table: ${{ secrets.TERRAFORM_STATE_TABLE }}
terraform-state-role: ${{ secrets.TERRAFORM_STATE_ROLE }}
terraform-plan-role: ${{ secrets.TERRAFORM_APPLY_ROLE }}
terraform-version: 1.5.2
aws-region: ${{ env.AWS_REGION }}
sort-by: .stack_slug
group-by: .stack_slug | split("-") | [.[0], .[2]] | join("-")
EOL
cp ./tests/atmos.yaml ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__INFRACOST_ENABLED__#false#g' ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__STORAGE_REGION__#${{ env.AWS_REGION }}#g' ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__STORAGE_BUCKET__#${{ secrets.TERRAFORM_STATE_BUCKET }}#g' ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g' ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g' ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__STORAGE_ROLE__#${{ secrets.TERRAFORM_STATE_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__PLAN_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__APPLY_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
- name: Plan Atmos Component
uses: cloudposse/github-action-atmos-terraform-plan@v1
uses: cloudposse/github-action-atmos-terraform-plan@use-atmos-config
with:
component: "foobar"
stack: "plat-ue2-sandbox"
atmos-gitops-config-path: "${{ runner.temp }}/atmos-gitops.yaml"
atmos-config-path: ${{ runner.temp }}

test:
runs-on: ubuntu-latest
Expand All @@ -53,24 +54,20 @@ jobs:
- shell: bash
run: |
mkdir -p ${{ runner.temp }}
cat > ${{ runner.temp }}/atmos-gitops.yaml <<EOL
atmos-version: 1.45.3
atmos-config-path: ./tests/
terraform-state-bucket: ${{ secrets.TERRAFORM_STATE_BUCKET }}
terraform-state-table: ${{ secrets.TERRAFORM_STATE_TABLE }}
terraform-state-role: ${{ secrets.TERRAFORM_STATE_ROLE }}
terraform-plan-role: ${{ secrets.TERRAFORM_APPLY_ROLE }}
terraform-apply-role: ${{ secrets.TERRAFORM_APPLY_ROLE }}
terraform-version: 1.5.2
aws-region: ${{ env.AWS_REGION }}
sort-by: .stack_slug
group-by: .stack_slug | split("-") | [.[0], .[2]] | join("-")
EOL
cp ./tests/atmos.yaml ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__INFRACOST_ENABLED__#false#g' ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__STORAGE_REGION__#${{ env.AWS_REGION }}#g' ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__STORAGE_BUCKET__#${{ secrets.TERRAFORM_STATE_BUCKET }}#g' ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g' ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g' ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__STORAGE_ROLE__#${{ secrets.TERRAFORM_STATE_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__PLAN_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
sed -i -e 's#__APPLY_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
- name: Apply Atmos Component
uses: ./
with:
component: "foobar"
stack: "plat-ue2-sandbox"
atmos-gitops-config-path: "${{ runner.temp }}/atmos-gitops.yaml"
atmos-config-path: ${{ runner.temp }}
debug: true
Loading

0 comments on commit 3ec18a4

Please sign in to comment.