{"id":21898255,"url":"https://github.com/fasibio/gomake","last_synced_at":"2025-04-15T18:30:32.845Z","repository":{"id":65163613,"uuid":"581987139","full_name":"fasibio/gomake","owner":"fasibio","description":"A make alternative with yaml and go template syntax (like helm)","archived":false,"fork":false,"pushed_at":"2024-01-01T13:41:36.000Z","size":13952,"stargazers_count":6,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T23:34:10.406Z","etag":null,"topics":["bash","build-tool","devops-tools","go","make","makefile","shell"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"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/fasibio.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}},"created_at":"2022-12-25T07:13:38.000Z","updated_at":"2025-01-15T03:45:52.000Z","dependencies_parsed_at":"2024-06-20T03:17:14.214Z","dependency_job_id":"69248597-78b2-43ff-a826-abf043008e27","html_url":"https://github.com/fasibio/gomake","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fasibio%2Fgomake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fasibio%2Fgomake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fasibio%2Fgomake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fasibio%2Fgomake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fasibio","download_url":"https://codeload.github.com/fasibio/gomake/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249128827,"owners_count":21217224,"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":["bash","build-tool","devops-tools","go","make","makefile","shell"],"created_at":"2024-11-28T14:25:04.933Z","updated_at":"2025-04-15T18:30:32.819Z","avatar_url":"https://github.com/fasibio.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"gomake is a command line tool that allows you to execute bash commands described in a yaml file using gotemplates (Helm Like). \nThe yaml file syntax includes a section for variables and a list of commands (see [example](./gomake.yml)), each with a script section for the commands to be executed and an optional on_failure section to specify commands to be executed in case of failure.\n\n```\nNAME:\n   gomake - A helm like makefile\n\nUSAGE:\n   gomake [global options] command [command options] [arguments...]\n\nCOMMANDS:\n   autocomplete  Set Autocomplete helper stuff to current shell session\n   init          Crate a starter gomake.yml to current dir\n   ls            List all commands described at gomake yaml file\n   run           Run commands from gomake.yml file\n   srun          Run commands from gomake.yml file  but it run all commands are inside the given stage and run this in parallel\n   help, h       Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --makefile value, -f value    gomake file to use (default: \"gomake.yml\") [$GOMAKE_MAKEFILE]\n   --executer value, --sh value  Shell to execute gomakefile config (default: \"/bin/sh\") [$GOMAKE_EXECUTER]\n   --help, -h                    show help (default: false)\n```\n\n# Easy to write easy to read\nExample Script: \n```yaml\n{{$bval := \"B\"}}\nvars: \n  A: {{$bval}}\n  FC: {{ .Vars.f}}_included\n  PUB_KEY: {{shell \"cat ~/.ssh/id_rsa.pub\"}}\n  AB: {{$bval}}B\n---\ninstall:\n  doc: I'm a description what this command do\n  script: \n    - touch test.gomake.txt\n    - echo \"Hallo\" \u003e test.gomake.txt\n    - export TEST1234=ShowME\n    - echo $TEST1234\n    {{- if eq .Vars.A \"B\" }}\n    - echo \"LINUX\"\n    {{- end}}\n    - ls {{ .Env.ZDOTDIR}}\n    {{include \"execute\"}}\n    - echo {{.Bar}}\n    - echo {{.Vars.PUB_KEY}}\n    - lf\n  on_failure: \n    - echo \"Error\"\n    {{include \"execute\"}}\nexecute: \n  script:\n    - echo \"execute\"\n    {{include \"extern\"}}\n  on_failure: \n    - echo \"execute Error\"\nextern: \n  script:\n    - echo \"extern\"\n```\n\n\nTo run install commands: \n```bash\ngomake run --var f=foo --var bar=baz install\n```\n\nto check how script lookslike after template execution: \n\n```bash\ngomake run --var f=foo --var bar=baz --dry-run install\n```\n\n# How to Install\n\n## With go\n\n```\ngo install github.com/fasibio/gomake@latest\n```\n\n## Linux (Change version to current)\n```bash\nsudo wget -O /usr/bin/gomake https://github.com/fasibio/gomake/releases/download/1.0.27/gomake_1.0.27_linux_amd64 ; sudo chmod 755 /usr/bin/gomake\n```\n\n\n# Extra functions\n\n**includeFile**\ninclude all variables and commands from an other lokal file\n\nPossible kind of usage: \n- path ==\u003e example (```{{includeFile \"./gomake_helper.yml\"}}```)\n- wildcard ==\u003e example (```{{includeFile \"./gomake_*.yml\"}}```)\n- url ==\u003e example (```{{includeFile \"https://raw.githubusercontent.com/fasibio/gomake/main/gomake_helper.yml\"}}```)\n\n**include**\nother commands script or onFailure depands of position of command\n\n**shell** \ncommand execution before the main script is running useful to fill Variables\n\nAnd all sprig functions ==\u003e [Documentation](http://masterminds.github.io/sprig/)\n\n\n# Use inside Pipeline\nThere is a [Dockerimage](https://hub.docker.com/r/fasibio/gomake)\n\n# parallel execution\n\nYou can use same stage for different commands\n\n```yaml\nbuildBin:\n  stage: build\n  color: \"{{$root.Colors.purple}}\"\n  script: \n    - echo build\nbuildDocker: \n  stage: build\n  color: \"{{$root.Colors.red}}\"\n  script: \n    - docker build -t {{$root.Vars.dockername}}:{{$root.Vars.version}} -f {{$root.Vars.dockerfile}} .\n  on_failure: \n    - docker rmi {{$root.Vars.dockername}}:{{$root.Vars.version}}\n```\nNow you can run by stagename instand of Command name with: \n\n```\ngomake srun build\n```\n\nor show the result after template execution: \n\n```\ngomake srun --dry-run build\n```\n\n**Hint** \n\nColor can help you make it easier to read:\n\nPossible Colors ({{.Colors.red}}): \n - black\n - red\n - green\n - yellow\n - purple\n - magenta\n - teal\n - white\n\n\n\n# Use Docker-Images\n\ndocker cli required\n\nTo execute inside a dockerimage you can use like this: \n```yaml\nbuildContainer: \n  image: \n    name: golang:latest # required\n    volumes: #optional\n      - {{.Env.PWD}}:/build\n    entrypoint: \"\" #optional emtpy string is default\n    executer: /bin/sh #optional /bin/sh is default\n  script: \n    - cd /build\n    - ls\n    {{include \"build\"}}\n  on_failure: \n\n```\n\n\n# Missing\n- Windows tests\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffasibio%2Fgomake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffasibio%2Fgomake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffasibio%2Fgomake/lists"}