How to use the build.Build function in build

To help you get started, we’ve selected a few build examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jlhood / github-codebuild-logs / test / unit / test_build.py View on Github external
def test_init():
    build_obj = build.Build(_mock_build_event())
    assert build_obj.id == BUILD_ID
    assert build_obj.project_name == test_constants.PROJECT_NAME
    assert build_obj.status == BUILD_STATUS
github jlhood / github-codebuild-logs / test / unit / test_build.py View on Github external
]
        },
        {
            'events': [
                {
                    'message': 'baz',
                },
                {
                    'message': 'blah',
                }
            ]
        },
    ]
    _mock_build_details('pr/123')

    build_obj = build.Build(_mock_build_event())
    build_obj.copy_logs()

    mock_codebuild.batch_get_builds.assert_called_once_with(ids=[BUILD_ID])

    mock_cw_logs.get_paginator.assert_called_once_with('filter_log_events')
    mock_cw_logs.get_paginator.return_value.paginate.assert_called_once_with(
        logGroupName=LOG_GROUP_NAME,
        logStreamNames=[LOG_STREAM_NAME]
    )

    mock_bucket.put_object.assert_called_once_with(
        Key=LOG_STREAM_NAME + '/build.log',
        Body='foobarbazblah',
        ContentType="text/plain"
    )
github jlhood / github-codebuild-logs / test / unit / test_build.py View on Github external
def test_get_logs_url(mocker, mock_codebuild):
    _mock_build_details('pr/123')
    build_obj = build.Build(_mock_build_event())
    assert build_obj.get_logs_url() == test_constants.BUILD_LOGS_API_ENDPOINT + '?key=' + LOG_STREAM_NAME + '%2Fbuild.log'
github philogb / jit / make.py View on Github external
def make_build(fancy=False):
    system('rm -rf Jit/*')
    print "Building Examples..."
    make_examples(fancy)
    system('cp -r Examples Jit/')
    print "Done. Building Extras..."
    system('mkdir Jit/Extras && cp Extras/excanvas.js Jit/Extras/excanvas.js')
    print "Done. Building Library..."
    lib = Build().build()
    license = open('LICENSE', 'r').read()
    f = open('Jit/jit.js', 'w')
    f.write(license)
    f.write(lib)
    f.close()
    print "Done. Compressing Library..."
    f = open('Jit/jit-yc.js', 'w')
    f.write(license)
    f.close()
    system('java -jar Extras/' + YC + ' Jit/jit.js >> Jit/jit-yc.js')
    print "Done. Zipping..."
    system('rm Jit.zip')
    system('zip -r Jit.zip Jit/')
    print "Done, I guess."
github google / shaka-player / build / check.py View on Github external
def complete_build_files():
  """Returns a complete set of build files."""
  complete = build.Build()
  # Normally we don't need to include @core, but because we look at the build
  # object directly, we need to include it here.  When using main(), it will
  # call addCore which will ensure core is included.
  if not complete.parse_build(['+@complete', '+@core'], os.getcwd()):
    logging.error('Error parsing complete build')
    return False
  return complete.include
github perdy / flama / build.py View on Github external
def main():
    return Build().run()
github lihuang / toast / plugin / ci_run / ci_run.py View on Github external
def __build_package(self):
        bp = build.Build(self.options)
        bp.run()