Skip to content

Commit 3efee6c

Browse files
committed
merged master
2 parents 2435c73 + 525f355 commit 3efee6c

File tree

4 files changed

+159
-24
lines changed

4 files changed

+159
-24
lines changed

examples/snippets/.github/workflows/atmos-pro-terraform-apply.yaml

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,68 @@
11
<<<<<<< HEAD
2+
<<<<<<< HEAD
23
name: Atmos Pro Terraform Apply
4+
=======
5+
name: 👽 Atmos Pro Terraform Apply
6+
run-name: apply ${{ inputs.component }}/${{ inputs.stack }}/${{ inputs.atmos_pro_run_id}}
7+
>>>>>>> 525f355ffc4471dbb3988fdb48edc3d1b84efc13
38

49
on:
5-
workflow_call:
10+
workflow_dispatch:
611
inputs:
12+
atmos_pro_run_id:
13+
description: "Atmos Pro Run ID"
14+
type: string
15+
sha:
16+
description: "Commit SHA"
17+
type: string
18+
component:
19+
description: "Component"
20+
required: true
21+
type: string
722
stack:
23+
description: "Stack"
824
required: true
925
type: string
10-
component:
26+
github_environment:
27+
description: "GitHub Environment"
1128
required: true
1229
type: string
1330

31+
# Avoid running the same stack in parallel mode (from different workflows)
32+
# This applied to across workflows to both plan and apply
33+
concurrency:
34+
group: "${{ inputs.stack }}-${{ inputs.component }}"
35+
cancel-in-progress: false
36+
37+
permissions:
38+
id-token: write # This is required for requesting the JWT
39+
contents: read # This is required for actions/checkout
40+
1441
jobs:
15-
apply:
16-
runs-on: ubuntu-latest
42+
atmos-apply:
43+
name: ${{ inputs.component }}-${{ inputs.stack }}
44+
45+
# The GitHub environment is defined in Atmos Pro settings.
46+
# Typically this is <tenant>-<stage>
47+
environment: ${{ inputs.github_environment }}
48+
49+
runs-on:
50+
- "runs-on=${{ github.run_id }}"
51+
- "runner=terraform"
52+
- "tag=${{ inputs.component }}-${{ inputs.stack }}"
53+
- "private=false"
54+
1755
steps:
18-
- name: Terraform Apply
19-
uses: cloudposse/github-action-atmos-pro-terraform-apply@main
56+
- uses: runs-on/action@v1
57+
- uses: unfor19/install-aws-cli-action@v1
58+
59+
- name: Apply Atmos Component
60+
uses: cloudposse/github-action-atmos-terraform-apply@v4
2061
with:
21-
workspace-id: ${{ vars.ATMOS_PRO_WORKSPACE_ID }}
22-
api-key: ${{ secrets.ATMOS_PRO_API_KEY }}
62+
# Atmos Pro args
63+
component: ${{ inputs.component }}
2364
stack: ${{ inputs.stack }}
65+
<<<<<<< HEAD
2466
component: ${{ inputs.component }}
2567
=======
2668
name: 👽 Atmos Pro Terraform Apply
@@ -82,8 +124,14 @@ jobs:
82124
# Atmos Pro args
83125
component: ${{ inputs.component }}
84126
stack: ${{ inputs.stack }}
127+
=======
128+
>>>>>>> 525f355ffc4471dbb3988fdb48edc3d1b84efc13
85129
sha: ${{ inputs.sha }}
86130
# Atmos required configuration
87131
atmos-version: ${{ vars.ATMOS_VERSION }}
88132
atmos-config-path: ${{ vars.ATMOS_CONFIG_PATH }}
133+
<<<<<<< HEAD
89134
>>>>>>> master
135+
=======
136+
137+
>>>>>>> 525f355ffc4471dbb3988fdb48edc3d1b84efc13

examples/snippets/.github/workflows/atmos-pro-terraform-plan.yaml

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,60 @@
11
<<<<<<< HEAD
2+
<<<<<<< HEAD
23
name: Atmos Pro Terraform Plan
4+
=======
5+
name: 👽 Atmos Pro Terraform Plan
6+
run-name: plan ${{ inputs.component }}/${{ inputs.stack }}/${{ inputs.atmos_pro_run_id}}
7+
>>>>>>> 525f355ffc4471dbb3988fdb48edc3d1b84efc13
38

49
on:
5-
workflow_call:
10+
workflow_dispatch:
611
inputs:
7-
stack:
8-
required: true
12+
atmos_pro_run_id:
13+
description: "Atmos Pro Run ID"
14+
type: string
15+
sha:
16+
description: "Commit SHA"
917
type: string
1018
component:
19+
description: "Component"
20+
required: true
21+
type: string
22+
stack:
23+
description: "Stack"
1124
required: true
1225
type: string
1326

27+
# Avoid running the same stack in parallel mode (from different workflows)
28+
# This applied to across workflows to both plan and apply
29+
concurrency:
30+
group: "${{ inputs.stack }}-${{ inputs.component }}"
31+
cancel-in-progress: false
32+
33+
permissions:
34+
id-token: write # This is required for requesting the JWT (OIDC) token
35+
contents: read # This is required for actions/checkout
36+
1437
jobs:
15-
plan:
16-
runs-on: ubuntu-latest
38+
atmos-plan:
39+
name: ${{ inputs.component }}-${{ inputs.stack }}
40+
41+
runs-on:
42+
- "runs-on=${{ github.run_id }}"
43+
- "runner=terraform"
44+
- "tag=${{ inputs.component }}-${{ inputs.stack }}"
45+
- "private=false"
46+
1747
steps:
18-
- name: Terraform Plan
19-
uses: cloudposse/github-action-atmos-pro-terraform-plan@main
48+
- uses: runs-on/action@v1
49+
- uses: unfor19/install-aws-cli-action@v1
50+
51+
- name: Plan Atmos Component
52+
uses: cloudposse/github-action-atmos-terraform-plan@v5
2053
with:
21-
workspace-id: ${{ vars.ATMOS_PRO_WORKSPACE_ID }}
22-
api-key: ${{ secrets.ATMOS_PRO_API_KEY }}
54+
# Atmos Pro args
55+
component: ${{ inputs.component }}
2356
stack: ${{ inputs.stack }}
57+
<<<<<<< HEAD
2458
component: ${{ inputs.component }}
2559
=======
2660
name: 👽 Atmos Pro Terraform Plan
@@ -74,8 +108,14 @@ jobs:
74108
# Atmos Pro args
75109
component: ${{ inputs.component }}
76110
stack: ${{ inputs.stack }}
111+
=======
112+
>>>>>>> 525f355ffc4471dbb3988fdb48edc3d1b84efc13
77113
sha: ${{ inputs.sha }}
78114
# Atmos required configuration
79115
atmos-version: ${{ vars.ATMOS_VERSION }}
80116
atmos-config-path: ${{ vars.ATMOS_CONFIG_PATH }}
117+
<<<<<<< HEAD
81118
>>>>>>> master
119+
=======
120+
121+
>>>>>>> 525f355ffc4471dbb3988fdb48edc3d1b84efc13

examples/snippets/.github/workflows/atmos-pro.yaml

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,58 @@
11
<<<<<<< HEAD
2+
<<<<<<< HEAD
23
name: Atmos Pro
4+
=======
5+
name: 👽 Atmos Pro Determine Affected Stacks
6+
run-name: 👽 Atmos Pro Determine Affected Stacks
7+
>>>>>>> 525f355ffc4471dbb3988fdb48edc3d1b84efc13
38

9+
# Atmos Pro reacts to events defined in the Atmos stack settings
10+
# and will trigger the appropriate workflows for the given event.
11+
#
12+
# For example, pull requests opened, synchronize, and reopened will trigger plan workflows.
13+
# Whereas pull requests merged will trigger apply workflows
414
on:
515
pull_request:
6-
types: [opened, synchronize, reopened]
7-
workflow_dispatch:
16+
types:
17+
- opened
18+
- synchronize
19+
- reopened
20+
- closed
21+
branches:
22+
- main
23+
24+
# Avoid conflicting workflow triggers.
25+
# For example, wait to trigger apply until plan has been triggered
26+
concurrency:
27+
group: "${{ github.ref }}"
28+
cancel-in-progress: false
29+
30+
permissions:
31+
id-token: write # This is required for requesting the JWT (OIDC) token
32+
contents: read # This is required for actions/checkout
833

934
jobs:
10-
describe-affected:
11-
runs-on: ubuntu-latest
35+
affected:
36+
name: Trigger Affected Stacks
37+
38+
runs-on:
39+
- "runs-on=${{ github.run_id }}"
40+
- "runner=small"
41+
- "tag=affected-stacks"
42+
- "private=false"
43+
44+
# Trigger Atmos Pro for Pull Request plan events and specifically closed PRs that have been merged (not just closed)
45+
if: github.event.action != 'closed' || (github.event.action == 'closed' && github.event.pull_request.merged == true)
46+
1247
steps:
13-
- name: Describe Affected
14-
uses: cloudposse/github-action-atmos-pro-describe-affected@main
48+
- uses: runs-on/action@v1
49+
- name: Checkout
50+
# For merged PRs, we will need to checkout the base branch to get the correct base branch SHA.
51+
# This isn't necessary for other events.
52+
if: github.event.action == 'closed'
53+
uses: actions/checkout@v4
1554
with:
55+
<<<<<<< HEAD
1656
workspace-id: ${{ vars.ATMOS_PRO_WORKSPACE_ID }}
1757
api-key: ${{ secrets.ATMOS_PRO_API_KEY }}
1858
=======
@@ -65,6 +105,8 @@ jobs:
65105
if: github.event.action == 'closed'
66106
uses: actions/checkout@v4
67107
with:
108+
=======
109+
>>>>>>> 525f355ffc4471dbb3988fdb48edc3d1b84efc13
68110
fetch-depth: 0 # Fetch all history for all branches and tags
69111

70112
# For merged PRs, we want to use 1 previous commit from the base branch SHA
@@ -98,4 +140,8 @@ jobs:
98140
# If the PR is merged, compare the head of the PR to 1 previous commit on the base branch.
99141
head-ref: ${{ github.event.pull_request.head.sha }}
100142
base-ref: ${{ github.event.action == 'closed' && steps.get_parent.outputs.parent_commit || github.event.pull_request.base.sha }}
143+
<<<<<<< HEAD
101144
>>>>>>> master
145+
=======
146+
147+
>>>>>>> 525f355ffc4471dbb3988fdb48edc3d1b84efc13

examples/snippets/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
ARG GEODESIC_VERSION=4.3.0
33
ARG GEODESIC_OS=debian
44
# https://github.com/cloudposse/atmos
5-
ARG ATMOS_VERSION=1.180.0
5+
ARG ATMOS_VERSION=1.179.0
6+
# This should match the version set in stacks/catalog/spacelift.yaml
67
# This should match the version set in .github/workflows/auto-format.yaml
78
ARG TF_1_VERSION=1.5.7
89
ARG TOFU_VERSION=1.8.8

0 commit comments

Comments
 (0)