in aws_lambda_builders/workflows/go_dep/workflow.py [0:0]
def __init__(self, source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=None, osutils=None, **kwargs):
super(GoDepWorkflow, self).__init__(
source_dir, artifacts_dir, scratch_dir, manifest_path, runtime=runtime, **kwargs
)
options = kwargs["options"] if "options" in kwargs else {}
handler = options.get("artifact_executable_name", None)
if osutils is None:
osutils = OSUtils()
# project base name, where the Gopkg.toml and vendor dir are.
base_dir = osutils.abspath(osutils.dirname(manifest_path))
output_path = osutils.joinpath(osutils.abspath(artifacts_dir), handler)
subprocess_dep = SubprocessExec(osutils, "dep")
subprocess_go = SubprocessExec(osutils, "go")
self.actions = [
DepEnsureAction(base_dir, subprocess_dep),
GoBuildAction(
base_dir,
osutils.abspath(source_dir),
output_path,
subprocess_go,
self.architecture,
env=osutils.environ,
),
]