How to use build - 10 common examples

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 schubergphilis / towerlib / _CI / scripts / upload.py View on Github external
def upload():
    success = build()
    if not success:
        LOGGER.error('Errors caught on building the artifact, bailing out...')
        raise SystemExit(1)
    if not validate_environment_variable_prerequisites(PREREQUISITES.get('upload_environment_variables', [])):
        LOGGER.error('Prerequisite environment variable for upload missing, cannot continue.')
        raise SystemExit(1)
    upload_command = ('twine upload dist/* '
                      f'-u {os.environ.get("PYPI_UPLOAD_USERNAME")} '
                      f'-p {os.environ.get("PYPI_UPLOAD_PASSWORD")} '
                      '--skip-existing '
                      f'--repository-url {os.environ.get("PYPI_URL")}')
    LOGGER.info('Trying to upload built artifact...')
    success = execute_command(upload_command)
    if success:
        LOGGER.info('%s Successfully uploaded artifact! %s',
                    emojize(':white_heavy_check_mark:'),
github costastf / toonapilib / _CI / scripts / upload.py View on Github external
def upload():
    success = build()
    if not success:
        LOGGER.error('Errors caught on building the artifact, bailing out...')
        raise SystemExit(1)
    if not validate_environment_variable_prerequisites(PREREQUISITES.get('upload_environment_variables', [])):
        LOGGER.error('Prerequisite environment variable for upload missing, cannot continue.')
        raise SystemExit(1)
    upload_command = ('twine upload dist/* '
                      f'-u {os.environ.get("PYPI_UPLOAD_USERNAME")} '
                      f'-p {os.environ.get("PYPI_UPLOAD_PASSWORD")} '
                      '--skip-existing '
                      f'--repository-url {os.environ.get("PYPI_URL")}')
    LOGGER.info('Trying to upload built artifact...')
    success = execute_command(upload_command)
    if success:
        LOGGER.info('%s Successfully uploaded artifact! %s',
                    emojize(':white_heavy_check_mark:'),
github VCVRack / library / scripts / update.py View on Github external
if os.path.isdir(plugin_filename):
		# Check if the library manifest is up to date
		try:
			with open(library_manifest_filename, "r") as f:
				library_manifest = json.load(f)
			if library_manifest and version == library_manifest['version']:
				continue
		except IOError:
			pass

		# Build repo
		print()
		print(f"Building {slug}")
		try:
			build.delete_stage()
			build.build(plugin_filename)
			build.system(f'cp -vi stage/* "{PACKAGES_DIR}"')
			build.system(f'cp -vi stage/* "{RACK_USER_PLUGIN_DIR}"')
		except Exception as e:
			print(e)
			print(f"{slug} build failed")
			input()
			continue
		finally:
			build.delete_stage()

		# Open plugin issue thread
		os.system(f"qutebrowser 'https://github.com/VCVRack/library/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+in%3Atitle+{slug}' &")

	elif plugin_ext == ".zip":
		# Review manifest for errors
		print(json.dumps(manifest, indent="  "))
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 clearlinux / autospec / tests / test_build.py View on Github external
def test_setup_workingdir(self):
        """
        Test that setup_workingdir sets the correct directory patterns
        """
        build.tarball.name = "testtarball"
        build.setup_workingdir("test_directory")
        self.assertEqual(build.base_path, "test_directory")
        self.assertEqual(build.download_path, "test_directory/testtarball")
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 petsc / petsc / config / BuildSystem / install.old / build.py View on Github external
def executeOverDependencies(self, proj, target):
    '''Execute a set of targets over the project dependencies'''
    import build.buildGraph

    self.debugPrint('Executing '+str(target)+' for '+proj.getUrl()+' and dependencies', 3, 'install')
    for p in build.buildGraph.BuildGraph.depthFirstVisit(self.dependenceGraph, proj):
      try:
        maker = self.getMakeModule(p.getRoot()).PetscMake(sys.argv[1:], self.argDB)
      except ImportError:
        self.debugPrint('  No make module present in '+proj.getRoot(), 2, 'install')
        continue
      maker.mainBuild(target)
    return
github wxWidgets / Phoenix / build.py View on Github external
def cmd_docset_py(options, args):
    cmdTimer = CommandTimer('docset_py')
    if not os.path.isdir('docs/html'):
        msg('ERROR: No docs/html, has the sphinx build command been run?')
        sys.exit(1)

    # clear out any old docset build
    name = 'wxPython-{}'.format(version3)
    docset = posixjoin('dist', '{}.docset'.format(name))
    if os.path.isdir(docset):
        shutil.rmtree(docset)

    # run the docset generator
    VERBOSE = '--verbose' if options.verbose else ''
    runcmd('doc2dash {} --name "{}" --icon {} --destination dist docs/html'
           .format(VERBOSE, name, pyICON))

    # update its Info.plist file
github clearlinux / autospec / autospec / autospec.py View on Github external
license.add_license(word)
        except:
            pass
        license.scan_for_licenses(_dir)
        exit(0)

    config.setup_patterns()
    config.config_file = args.config
    config.parse_config_files(build.download_path, args.bump, filemanager)
    config.parse_existing_spec(build.download_path, tarball.name)

    buildreq.set_build_req()
    buildreq.scan_for_configure(_dir)
    specdescription.scan_for_description(name, _dir)
    license.scan_for_licenses(_dir)
    commitmessage.scan_for_changes(build.download_path, _dir)
    add_sources(build.download_path, args.archives)
    test.scan_for_tests(_dir)

    #
    # Now, we have enough to write out a specfile, and try to build it.
    # We will then analyze the build result and learn information until the
    # package builds
    #
    specfile = specfiles.Specfile(tarball.url, tarball.version, tarball.name, tarball.release)
    filemanager.load_specfile(specfile)
    load_specfile(specfile)

    print("\n")

    if args.integrity == True:
        interactive_mode = not args.non_interactive