Skip to content
Merged
15 changes: 8 additions & 7 deletions .github/workflows/cdk_package_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
id: asdf-version
run: echo "version=$(awk '!/^#/ && NF {print $1; exit}' .tool-versions.asdf)" >> "$GITHUB_OUTPUT"


# using git commit sha for version of action to ensure we have stable version
- name: Install asdf
uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
Expand Down Expand Up @@ -67,16 +66,18 @@ jobs:

- name: Build Python Lambda Functions
run: |
poetry export --without-hashes --format=requirements.txt --with slackBotFunction > requirements_slackBotFunction
poetry export --without-hashes --format=requirements.txt --with syncKnowledgeBaseFunction > requirements_syncKnowledgeBaseFunction
if [ ! -s requirements_slackBotFunction ]; then \
echo "Error: requirements_slackBotFunction is empty or missing"; \
poetry show --only=slackBotFunction | grep -E "^[a-zA-Z]" | awk '{print $1"=="$2}' > requirements_slackBotFunction
poetry show --only=syncKnowledgeBaseFunction | grep -E "^[a-zA-Z]" | awk '{print $1"=="$2}' > requirements_syncKnowledgeBaseFunction
if [ ! -s requirements_slackBotFunction ] || [ "$(grep -c -v '^[[:space:]]*$' requirements_slackBotFunction)" -eq 0 ]; then \
echo "Error: requirements_slackBotFunction is empty or contains only blank lines"; \
exit 1; \
fi
if [ ! -s requirements_syncKnowledgeBaseFunction ]; then \
echo "Error: requirements_syncKnowledgeBaseFunction is empty or missing"; \
if [ ! -s requirements_syncKnowledgeBaseFunction ] || [ "$(grep -c -v '^[[:space:]]*$' requirements_syncKnowledgeBaseFunction)" -eq 0 ]; then \
echo "Error: requirements_syncKnowledgeBaseFunction is empty or contains only blank lines"; \
exit 1; \
fi
mkdir -p .dependencies/slackBotFunction/python
mkdir -p .dependencies/syncKnowledgeBaseFunction/python
pip3 install -r requirements_slackBotFunction -t .dependencies/slackBotFunction/python
pip3 install -r requirements_syncKnowledgeBaseFunction -t .dependencies/syncKnowledgeBaseFunction/python

Expand Down
Loading