{"id":27197847,"url":"https://github.com/preaction/beam-make","last_synced_at":"2025-07-11T01:08:09.144Z","repository":{"id":56833655,"uuid":"263085629","full_name":"preaction/Beam-Make","owner":"preaction","description":"A dependency resolution workflow tool, a la Make","archived":false,"fork":false,"pushed_at":"2020-05-17T21:34:38.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-17T21:16:54.455Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/preaction.png","metadata":{"files":{"readme":"README.mkdn","changelog":"CHANGES","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-11T15:40:45.000Z","updated_at":"2024-04-17T21:16:54.456Z","dependencies_parsed_at":"2022-09-08T07:42:01.252Z","dependency_job_id":null,"html_url":"https://github.com/preaction/Beam-Make","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preaction%2FBeam-Make","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preaction%2FBeam-Make/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preaction%2FBeam-Make/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preaction%2FBeam-Make/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/preaction","download_url":"https://codeload.github.com/preaction/Beam-Make/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248106890,"owners_count":21048818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-09T20:29:45.282Z","updated_at":"2025-04-09T20:29:45.460Z","avatar_url":"https://github.com/preaction.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/preaction/Beam-Make.svg?branch=master)](https://travis-ci.org/preaction/Beam-Make)\n[![Coverage Status](https://coveralls.io/repos/preaction/Beam-Make/badge.svg?branch=master)](https://coveralls.io/r/preaction/Beam-Make?branch=master)\n\n# NAME\n\nBeam::Make - Recipes to declare and resolve dependencies between things\n\n# VERSION\n\nversion 0.003\n\n# SYNOPSIS\n\n    ### container.yml\n    # This Beam::Wire container stores shared objects for our recipes\n    dbh:\n        $class: DBI\n        $method: connect\n        $args:\n            - dbi:SQLite:RECENT.db\n\n    ### Beamfile\n    # This file contains our recipes\n    # Download a list of recent changes to CPAN\n    RECENT-6h.json:\n        commands:\n            - curl -O https://www.cpan.org/RECENT-6h.json\n\n    # Parse that JSON file into a CSV using an external program\n    RECENT-6h.csv:\n        requires:\n            - RECENT-6h.json\n        commands:\n            - yfrom json RECENT-6h.json | yq '.recent.[]' | yto csv \u003e RECENT-6h.csv\n\n    # Build a SQLite database to hold the recent data\n    RECENT.db:\n        $class: Beam::Make::DBI::Schema\n        dbh: { $ref: 'container.yml:dbh' }\n        schema:\n            - table: recent\n              columns:\n                - path: VARCHAR(255)\n                - epoch: DOUBLE\n                - type: VARCHAR(10)\n\n    # Load the recent data CSV into the SQLite database\n    cpan-recent:\n        $class: Beam::Make::DBI::CSV\n        requires:\n            - RECENT.db\n            - RECENT-6h.csv\n        dbh: { $ref: 'container.yml:dbh' }\n        table: recent\n        file: RECENT-6h.csv\n\n    ### Load the recent data into our database\n    $ beam make cpan-recent\n\n# DESCRIPTION\n\n`Beam::Make` allows an author to describe how to build some thing (a\nfile, some data in a database, an image, a container, etc...) and the\nrelationships between things. This is similar to the classic `make`\nprogram used to build some software packages.\n\nEach thing is a `recipe` and can depend on other recipes. A user runs\nthe `beam make` command to build the recipes they want, and\n`Beam::Make` ensures that the recipe's dependencies are satisfied\nbefore building the recipe.\n\nThis class is a [Beam::Runnable](https://metacpan.org/pod/Beam::Runnable) object and can be embedded in other\n[Beam::Wire](https://metacpan.org/pod/Beam::Wire) containers.\n\n## Recipe Classes\n\nUnlike `make`, `Beam::Make` recipes can do more than just execute\na series of shell scripts. Each recipe is a Perl class that describes\nhow to build the desired thing and how to determine if that thing needs\nto be rebuilt.\n\nThese recipe classes come with `Beam::Make`:\n\n- [File](https://metacpan.org/pod/Beam::Make::File) - The default recipe class that creates\na file using one or more shell commands (a la `make`)\n- [DBI](https://metacpan.org/pod/Beam::Make::DBI) - Write data to a database\n- [DBI::Schema](https://metacpan.org/pod/Beam::Make::DBI::Schema) - Create a database\nschema\n- [DBI::CSV](https://metacpan.org/pod/Beam::Make::DBI::CSV) - Load data from a CSV into\na database table\n- [Docker::Image](https://metacpan.org/pod/Beam::Make::Docker::Image) - Build or pull a Docker image\n- [Docker::Container](https://metacpan.org/pod/Beam::Make::Docker::Container) - Build a Docker container\n\nFuture recipe class ideas are:\n\n- **Template rendering**: Files could be generated from a configuration\nfile or database and a template.\n- **Docker compose**: An entire docker-compose network could be rebuilt.\n- **System services (init daemon, systemd service, etc...)**: Services\ncould depend on their configuration files (built with a template) and be\nrestarted when their configuration file is updated.\n\n## Beamfile\n\nThe `Beamfile` defines the recipes. To avoid the pitfalls of `Makefile`, this is\na YAML file containing a mapping of recipe names to recipe configuration. Each\nrecipe configuration is a mapping containing the attributes for the recipe class.\nThe `$class` special configuration key declares the recipe class to use. If no\n`$class` is specified, the default [Beam::Wire::File](https://metacpan.org/pod/Beam::Wire::File) recipe class is used.\nAll recipe classes inherit from [Beam::Class::Recipe](https://metacpan.org/pod/Beam::Class::Recipe) and have the [name](https://metacpan.org/pod/Beam::Class::Recipe#name)\nand [requires](https://metacpan.org/pod/Beam::Class::Recipe#requires) attributes.\n\nFor examples, see the [Beam::Wire examples directory on\nGithub](https://github.com/preaction/Beam-Make/tree/master/eg).\n\n## Object Containers\n\nFor additional configuration, create a [Beam::Wire](https://metacpan.org/pod/Beam::Wire) container and\nreference the objects inside using `$ref: \"\u003ccontainer\u003e:\u003cservice\u003e\"`\nas the value for a recipe attribute.\n\n# TODO\n\n- Target names in `Beamfile` should be regular expressions\n\n    This would work like Make's wildcard recipes, but with Perl regexp. The\n    recipe object's name is the real name, but the recipe chosen is the one\n    the matches the regexp.\n\n- Environment variables should interpolate into all attributes\n\n    Right now, the `NAME=VALUE` arguments to `beam make` only work in\n    recipes that use shell scripts (like [Beam::Make::File](https://metacpan.org/pod/Beam::Make::File)). It would be\n    nice if they were also interpolated into other recipe attributes.\n\n- Recipes should be able to require wildcards and directories\n\n    Recipe requirements should be able to depend on patterns, like all\n    `*.conf` files in a directory. It should also be able to depend on\n    a directory, which would be the same as depending on every file,\n    recursively, in that directory.\n\n    This would allow rebuilding a ZIP file when something changes, or\n    rebuilding a Docker image when needed.\n\n- Beam::Wire should support the \u0026lt;container\u003e:\u0026lt;service\u003e syntax\nfor references\n\n    The [Beam::Wire](https://metacpan.org/pod/Beam::Wire) class should handle the `BEAM_PATH` environment\n    variable directly and be able to resolve services from other files\n    without building another `Beam::Wire` object in the container.\n\n- Beam::Wire should support resolving objects in arbitrary data\nstructures\n\n    [Beam::Wire](https://metacpan.org/pod/Beam::Wire) should have a class method that one can pass in a hash and\n    get back a hash with any `Beam::Wire` object references resolved,\n    including `$ref` or `$class` object.\n\n# SEE ALSO\n\n[Beam::Wire](https://metacpan.org/pod/Beam::Wire)\n\n# AUTHOR\n\nDoug Bell \u003cpreaction@cpan.org\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2020 by Doug Bell.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreaction%2Fbeam-make","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpreaction%2Fbeam-make","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreaction%2Fbeam-make/lists"}