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

feat(build): Build a single function #1146

Merged
merged 2 commits into from
Apr 24, 2019

Conversation

jfuss
Copy link
Contributor

@jfuss jfuss commented Apr 23, 2019

Issue #, if available:
N/A

Description of changes:

This enables a customer to build a single function similar to how they would invoke a single function. To build a single function, you can pass the LogicalID to the command sam build <MyLogicalId>. If the LogicalID is omitted, the command will behave exactly how it does not and build the whole template.

Concerns on approach:

This change enables a customer (or IDE) to quickly build a single function for faster test cycles. This could result in a deployment to of source code instead of built code, if the customer only builds one of the n number of functions in the template and then does a package and deploy. With this change, customers will need to still use sam build without the logicalId before package and deploying. This could create more customer confusion in the short term.

Checklist:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@sriram-mv sriram-mv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome!

function_logical_id)

all_artifacts = set(os.listdir(str(resource_artifact_dir)))
print(all_artifacts)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove prints

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

tests/integration/buildcmd/test_build_cmd.py Show resolved Hide resolved
"jinja2",
'requirements.txt'}

def test_fucntion_not_found(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: typo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


EXPECTED_FILES_GLOBAL_MANIFEST = set()
EXPECTED_FILES_PROJECT_MANIFEST = {'__init__.py', 'main.py', 'numpy',
# 'cryptography',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is cryptography commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was copied from the above python tests.

This is the specific reason: https://github.com/awslabs/aws-sam-cli/blob/develop/tests/integration/testdata/buildcmd/Python/requirements.txt#L4

@sriram-mv sriram-mv merged commit 4512794 into aws:develop Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants