Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DONT MERGE : Eng 542 prod channel lambda functions do not deploy with correct folder structure #13

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
2 changes: 1 addition & 1 deletion blambda/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def publish(name, role, zipfile, options, dryrun):
ZipFile=file_bytes
)

time.sleep(5)
time.sleep(15)

cprint("Updating lambda function configuration", 'yellow')
response = client.update_function_configuration(
Expand Down
11 changes: 7 additions & 4 deletions blambda/utils/lambda_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def source_files(self, dest_dir: Path = None):

for src in src_paths:
src = (self.basedir / src).resolve()
dst = dest_dir / dst_pattern
dst = dest_dir / self.short_name / dst_pattern

if '*' in dst.name:
dst = dst.parent / src.name
Expand Down Expand Up @@ -197,18 +197,21 @@ def process_manifest(self, clean=False, prod=False):

tempdir = tempfile.mkdtemp()
node_modules = Path(tempdir) / "node_modules"
node_modules.symlink_to(self.node_dir)
# node_modules.symlink_to(self.node_dir)
os.system(f"ln -s {node_modules} {self.node_dir}")

if clean and self.node_dir.exists():
shutil.rmtree(self.node_dir)

self.node_dir.mkdir(exist_ok=True)
# self.node_dir.mkdir(exist_ok=True)

# install node dependencies 1 at a time to avoid race condition issues
for dependency, version in deps_to_install.items():
spawn(f"npm install {dependency}@{version}", show=True, working_directory=tempdir)

shutil.rmtree(tempdir)
# Commenting below line because symlink is created to temp directory and
# While deploying lambda it is trying to copy content from symlinked dir.
# shutil.rmtree(tempdir)

else:
raise RuntimeError("Unknown runtime: " + self.runtime)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
author='Balihoo Developers',
author_email='[email protected]',
license='MIT',
url='git@github.com:balihoo/fulfillment-lambda-functions.git',
url='git+https://github.com/balihoo/fulfillment-lambda-functions.git',
install_requires=['boto3', 'python-dateutil', 'requests', 'termcolor', 'lxml', 'beautifulsoup4'],
packages=find_packages(exclude=['tests']),
include_package_data=True,
Expand Down