Skip to content

Commit 6f76e1b

Browse files
committed
Add STACK_NAME to cdk_package_code workflow and update build path for python lambda functions
1 parent fbe1e3a commit 6f76e1b

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

.github/workflows/cdk_package_code.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: cdk package code
33
on:
44
workflow_call:
55
inputs:
6+
STACK_NAME:
7+
required: true
8+
type: string
69
VERSION_NUMBER:
710
required: true
811
type: string
@@ -58,18 +61,19 @@ jobs:
5861
5962
- name: Build Python Lambda Functions
6063
run: |
61-
mkdir -p packages/slackBotFunction/build
62-
pip3 install -r packages/slackBotFunction/requirements.txt -t packages/slackBotFunction/build
63-
rsync -a --exclude=build packages/slackBotFunction/ packages/slackBotFunction/build/
64+
mkdir -p .build/${{ inputs.STACK_NAME }}-SlackBotFunction
65+
pip3 install -r packages/slackBotFunction/requirements.txt -t .build/${{ inputs.STACK_NAME }}-SlackBotFunction
66+
cp -r packages/slackBotFunction/* .build/${{ inputs.STACK_NAME }}-SlackBotFunction
6467
65-
mkdir -p packages/createIndexFunction/build
66-
pip3 install -r packages/createIndexFunction/requirements.txt -t packages/createIndexFunction/build
67-
rsync -a --exclude=build packages/createIndexFunction/ packages/createIndexFunction/build/
68+
mkdir -p .build/${{ inputs.STACK_NAME }}-CreateIndexFunction
69+
pip3 install -r packages/createIndexFunction/requirements.txt -t .build/${{ inputs.STACK_NAME }}-CreateIndexFunction
70+
cp -r packages/createIndexFunction/* .build/${{ inputs.STACK_NAME }}-CreateIndexFunction
6871
6972
- name: 'Tar files'
7073
run: |
7174
tar -rf artifact.tar \
7275
.tool-versions \
76+
.build \
7377
packages \
7478
node_modules \
7579
package.json \

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ jobs:
9898
needs: [get_commit_id, tag_release]
9999
uses: ./.github/workflows/cdk_package_code.yml
100100
with:
101+
STACK_NAME: epsam
101102
VERSION_NUMBER: ${{ needs.tag_release.outputs.version_tag }}
102103
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
103104

.github/workflows/pull_request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
needs: [get_issue_number, get_commit_id]
5757
uses: ./.github/workflows/cdk_package_code.yml
5858
with:
59+
STACK_NAME: epsam-pr-${{needs.get_issue_number.outputs.issue_number}}
5960
VERSION_NUMBER: PR-${{ needs.get_issue_number.outputs.issue_number }}
6061
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
6162

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ jobs:
117117
needs: [get_commit_id, tag_release]
118118
uses: ./.github/workflows/cdk_package_code.yml
119119
with:
120+
STACK_NAME: epsam
120121
VERSION_NUMBER: ${{ needs.tag_release.outputs.version_tag }}
121122
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
122123

0 commit comments

Comments
 (0)