Skip to content

Commit

Permalink
Install requirements file into codebuild template
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesls committed Apr 17, 2017
1 parent d64f5be commit 3111fa7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions chalice/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def _add_package_build(self, resources):
" - sudo pip install --upgrade awscli\n"
" - aws --version\n"
" - sudo pip install chalice\n"
" - sudo pip install -r requirements.txt\n"
" - chalice package /tmp/packaged\n"
" - aws cloudformation package"
" --template-file /tmp/packaged/sam.json"
Expand Down
8 changes: 8 additions & 0 deletions tests/unit/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,11 @@ def test_codepipeline_resource(pipeline_gen):
resources['ArtifactBucketStore']['Type'] == 'AWS::S3::Bucket'
resources['CodePipelineRole']['Type'] == 'AWS::IAM::Role'
resources['CFNDeployRole']['Type'] == 'AWS::IAM::Role'


def test_install_requirements_in_buildspec(pipeline_gen):
template = {}
pipeline.CodeBuild().add_to_template(template)
build = template['Resources']['AppPackageBuild']
build_spec = build['Properties']['Source']['BuildSpec']
assert 'pip install -r requirements.txt' in build_spec

0 comments on commit 3111fa7

Please sign in to comment.