{"id":27786298,"url":"https://github.com/clever/launch-gen","last_synced_at":"2025-09-13T21:09:35.708Z","repository":{"id":33855206,"uuid":"127257564","full_name":"Clever/launch-gen","owner":"Clever","description":"Generate config package from launch YML file","archived":false,"fork":false,"pushed_at":"2025-04-24T00:27:46.000Z","size":95,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-04-24T01:26:40.906Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Clever.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-03-29T07:57:58.000Z","updated_at":"2025-04-24T00:27:50.000Z","dependencies_parsed_at":"2024-04-29T23:26:19.253Z","dependency_job_id":"ffe52b2c-203e-4c93-88ed-89e845fffe1c","html_url":"https://github.com/Clever/launch-gen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clever%2Flaunch-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clever%2Flaunch-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clever%2Flaunch-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Clever%2Flaunch-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Clever","download_url":"https://codeload.github.com/Clever/launch-gen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251737850,"owners_count":21635690,"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-30T15:59:15.416Z","updated_at":"2025-04-30T15:59:16.471Z","avatar_url":"https://github.com/Clever.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# launch-gen\n\nGenerate code from launch YML\n\n## Running\n\nBuild it\n\n```\nmake build\n```\n\nRun it\n\n```\n./bin/launch-gen \u003cpath-to-launch-yml\u003e\n```\n\n## Migrating to use in a Golang repo\n\nThis assumes you have a `go mod` repo.\n\n1. Grab the latest version of `launch-gen`.\n\n```bash\ngo get github.com/Clever/launch-gen\n```\n\n2. Within your repo's `Makefile`, declare `launch-gen` to be built on every `install_deps` invocation. Example:\n\n```bash\ninstall_deps:\n    go mod vendor\n    go build -o bin/launch-gen -mod=vendor ./vendor/github.com/Clever/launch-gen\n```\n\n3. Include as a blank import, to make sure `launch-gen` is declared as a dependency in `go.mod`. See [Clever/template-wag](https://github.com/Clever/template-wag/blob/2cbdec713ce3787970c25aa6c08a32ceb4c12336/tools/tools.go) for an example.\n\n4. On the entry point of your application, include a stanza to generate the config. This should match the launch YAML in `launch/`.\n\n```golang\n// generate launch config\n//go:generate sh -c \"$PWD/bin/launch-gen -o launch.go -p main $PWD/launch/\u003cyour-application\u003e.yml\"\n```\n\nIf you scope the current project's `/bin/` to the Makefile's path, then you can simplify the stanza:\n\n```golang\n// generate launch config\n//go:generate launch-gen -o launch.go -p main $PWD/launch/\u003cyour-application\u003e.yml\n```\n\n5. Ensure you call `go generate ./...` in the Makefile for paths that would be relevant for building or running the application. This allows the `//go:generate` stanza to run, which helps with building.\n\nFor example:\n\n```bash\nPKGS := $(shell go list ./... | grep -v /vendor | grep -v tools)\n$(PKGS): generate golang-test-all-strict-deps\n\t$(call golang-test-all-strict,$@)\n\n# Before the `test` recipe is called, `make generate` is called as a prerequisite.\ntest: $(PKGS)\n\n# Before the `build` recipe is called, `make generate` is called as a prerequisite.\nbuild: generate\n\t$(call golang-build,$(PKG),$(EXECUTABLE))\n\n# Create a target that will run `go generate` when `make generate` is called.\ngenerate:\n\tgo generate ./...\n```\n\n6. Run `make generate`. `launch.go` should be within the specified directory.\n\n7. Call `InitLaunchConfig()` during startup of your program, and use it when needed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclever%2Flaunch-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclever%2Flaunch-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclever%2Flaunch-gen/lists"}