Skip to content

Commit

Permalink
Enhance Packer shell provisioner: add critical package installations …
Browse files Browse the repository at this point in the history
…and verification steps
  • Loading branch information
Your Name committed May 9, 2025
1 parent e8ee80f commit 0e94a66
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packer.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,9 @@ build {
"echo '=== Debug: Pip version ==='",
"pip3 --version",

"echo '=== Installing requirements.txt dependencies ==='",
"echo '=== Installing dependencies from requirements.txt ==='",
"pip3 install --no-cache-dir -r /tmp/requirements.txt -t /var/task -v",

"echo '=== Installing pydantic explicitly ==='",
"pip3 install --no-cache-dir 'pydantic~=2.6' -t /var/task -v",

"echo '=== Installing package in development mode ==='",
"pip3 install --no-cache-dir -e /tmp -t /var/task -v",

Expand All @@ -62,11 +59,20 @@ build {
"echo '=== Explicitly copying template_automation package directory ==='",
"cp -r /tmp/template_automation /var/task/",

"echo '=== Verifying dependencies installation ==='",
"python3 -c \"import sys; print(sys.path)\"",
"python3 -c \"import jinja2; print(f'jinja2 version: {jinja2.__version__}')\" || echo 'jinja2 not installed correctly'",
"python3 -c \"import github; print(f'PyGithub version: {github.__version__}')\" || echo 'PyGithub not installed correctly'",
"python3 -c \"import pydantic; print(f'pydantic version: {pydantic.__version__}')\" || echo 'pydantic not installed correctly'",
"python3 -c \"import boto3; print(f'boto3 version: {boto3.__version__}')\" || echo 'boto3 not installed correctly'",
"python3 -c \"import template_automation; print('template_automation package found')\" || echo 'template_automation not installed correctly'",

"echo '=== Listing installed Python packages ==='",
"pip3 list",

"echo '=== Verifying task directory contents ==='",
"ls -la /var/task"
"ls -la /var/task",
"ls -la /var/task/template_automation"
]
}

Expand Down

0 comments on commit 0e94a66

Please sign in to comment.