{"id":18385344,"url":"https://github.com/upsight/ron","last_synced_at":"2025-04-07T00:31:59.811Z","repository":{"id":57523340,"uuid":"66398789","full_name":"upsight/ron","owner":"upsight","description":"Package ron provides a command line interface to common build tasks.","archived":false,"fork":false,"pushed_at":"2018-11-14T21:59:35.000Z","size":174,"stargazers_count":4,"open_issues_count":4,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-22T09:32:38.197Z","etag":null,"topics":["go","golang","make","task-runner"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/upsight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-23T19:59:59.000Z","updated_at":"2018-11-14T21:59:01.000Z","dependencies_parsed_at":"2022-08-28T11:12:08.892Z","dependency_job_id":null,"html_url":"https://github.com/upsight/ron","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upsight%2Fron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upsight%2Fron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upsight%2Fron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upsight%2Fron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/upsight","download_url":"https://codeload.github.com/upsight/ron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247574088,"owners_count":20960495,"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":["go","golang","make","task-runner"],"created_at":"2024-11-06T01:17:21.114Z","updated_at":"2025-04-07T00:31:59.559Z","avatar_url":"https://github.com/upsight.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![ron](ron.jpg)\n\n# Ron [![GoDoc](https://godoc.org/github.com/upsight/ron?status.svg)](http://godoc.org/github.com/upsight/ron) [![Build Status](https://travis-ci.org/upsight/ron.svg?branch=master)](https://travis-ci.org/upsight/ron)\n\nPackage ron provides a command line interface to common build tasks.\n\n\t$ ron\n\tUsage: ron \u003ccommand\u003e\n\n\tAvailable commands are:\n\t    b, bash_completion    Print the bash completion script.\n\t    burgundy              Stay classy.\n\t    cmd                   Run a command with optional restart and watch for changes to restart.\n\t    hs, httpstat          HTTP trace timings\n\t    replace               Find and replace in text.\n\t    t, target             Execute a configured target.\n\t    template              Render a Go template using environment variables.\n\t    upgrade               Upgrade the ron binary.\n\t    version               Print the version.\n\nhttp://godoc.org/github.com/upsight/ron\n\n### Installation\n\n\t$ go get -u github.com/upsight/ron/cmd/...\n\nor download from [releases](https://github.com/upsight/ron/releases)\n\n### Upgrade\n\n\tLATEST_URL=https://github.com/upsight/ron/releases/download/v1.1.3/ron-linux-v1.1.3 ron upgrade\n\n### Testing\n\n\t$ ron t go:test\n\n### Extending\n\nTo extend or customize ron, you can either fork the repo, or vendor it and overwrite the target/default.yaml\nfile and add custom commands.\n\nThe vendoring approach may look something like this:\n\n1. Add vendor/github.com/upsight/ron to your project with whatever package manager you choose (dep, glide, etc.)\n\n2. Create a new folder for your custom commands ./commands/commandname/commandname.go\n\n```go\npackage commandname\n\nimport (\n\t\"fmt\"\n\t\"io\"\n)\n\n// Command ...\ntype Command struct {\n\tName       string\n\tW          io.Writer\n\tWErr       io.Writer\n\tAppName    string\n\tAppVersion string\n\tGitCommit  string\n}\n\n// Run ...\nfunc (c *Command) Run(args []string) (int, error) {\n\tfmt.Fprintln(c.W, c.AppName, c.AppVersion, c.GitCommit)\n\treturn 0, nil\n}\n\n// Key returns the commands name for sorting.\nfunc (c *Command) Key() string {\n\treturn c.Name\n}\n\n// Aliases are the aliases and name for the command. For instance\n// a command can have a long form and short form.\nfunc (c *Command) Aliases() map[string]struct{} {\n\treturn map[string]struct{}{\n\t\t\"someothername\": struct{}{},\n\t}\n}\n\n// Description is what is printed in Usage.\nfunc (c *Command) Description() string {\n\treturn \"My command.\"\n}\n```\n\n3. Create a custom cmd/ron/main.go and add all of your commands.\n\n```golang\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\n\t\"mygitrepo.com/ron/commands/commandname\"\n\n\t\"github.com/upsight/ron\"\n\t\"github.com/upsight/ron/color\"\n)\n\nfunc main() {\n\tc := ron.NewDefaultCommander(os.Stdout, os.Stderr)\n\tc.Add(\u0026commandname.Command{AppName: ron.AppName, Name: \"project\", W: os.Stdout, WErr: os.Stderr})\n\tstatus, err := ron.Run(c, os.Args[1:])\n\tif err != nil {\n\t\thostname, _ := os.Hostname()\n\t\tlog.Println(hostname, color.Red(err.Error()))\n\t}\n\tos.Exit(status)\n}\n```\n\n4. Optionally overwrite ./vendor/github.com/upsight/ron/target/default.yaml to have custom targets.\n\nThis can be done in a target or manually.\n\n```bash\ntouch default.yaml\ncp default.yaml vendor/$RONREPO/target/default.yaml\n```\n\n5. Create a ./ron.yaml file with instructions on how to put it all together.\n\n```yaml\n{{$path := \"export PATH=$GOPATH/bin:$PATH\"}}\nenvs:\n  - APP: ron\n  - ARCH: amd64\n  - PACKAGE_VERSION: +echo `git describe --tags`.`git rev-parse HEAD`\n  - REPO: myrepo.com/ron\n  - RONREPO: github.com/upsight/ron\n  - UNAME: +uname | tr '[:upper:]' '[:lower:]'\n  - VERSION: 1.4.0\n  - TAG: v${VERSION}\ntargets:\n  prep:\n    description: Compile the default yaml asset to a go file.\n    cmd: |\n      go install ./vendor/github.com/jteeuwen/go-bindata/go-bindata || go get -u github.com/jteeuwen/go-bindata/...\n      cp default.yaml vendor/$RONREPO/target/default.yaml\n      cd vendor/$RONREPO/target\n      go-bindata -o default.go -pkg=target default.yaml\n  build:\n    description: Compile a binary to ./bin/${UNAME}_${ARCH}\n    before:\n      - go:prep\n    cmd: |\n      {{$path}}\n      mkdir -p bin/${UNAME}_${ARCH}\n      GOARCH=$ARCH GOOS=$UNAME go build -o bin/${UNAME}_${ARCH}/${APP}-${UNAME}-${TAG} -ldflags \"-X $REPO/vendor/$RONREPO.GitCommit=$PACKAGE_VERSION -X $REPO/vendor/$RONREPO.AppVersion=$TAG -X $REPO/vendor/$RONREPO.AppName=$APP\" cmd/ron/*.go\n```\n\n6. Run the build\n\n```bash\nron t ron:build \u0026\u0026 ls bin/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupsight%2Fron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fupsight%2Fron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupsight%2Fron/lists"}