{"id":15714727,"url":"https://github.com/cga1123/slugcmplr","last_synced_at":"2025-04-30T07:02:45.380Z","repository":{"id":39824887,"uuid":"369012818","full_name":"CGA1123/slugcmplr","owner":"CGA1123","description":"🐌 A CLI for compiling your Heroku apps into slugs.","archived":false,"fork":false,"pushed_at":"2025-03-21T18:29:45.000Z","size":16858,"stargazers_count":11,"open_issues_count":9,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-21T18:33:36.418Z","etag":null,"topics":["build-automation","build-tools","compiler","continuous-deployment","heroku","slug","works-with-codespaces"],"latest_commit_sha":null,"homepage":"","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/CGA1123.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-19T22:07:37.000Z","updated_at":"2025-03-21T18:29:48.000Z","dependencies_parsed_at":"2024-10-24T12:02:45.822Z","dependency_job_id":"7e952ff3-a541-449d-83dc-afac59d00915","html_url":"https://github.com/CGA1123/slugcmplr","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CGA1123%2Fslugcmplr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CGA1123%2Fslugcmplr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CGA1123%2Fslugcmplr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CGA1123%2Fslugcmplr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CGA1123","download_url":"https://codeload.github.com/CGA1123/slugcmplr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246326600,"owners_count":20759436,"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":["build-automation","build-tools","compiler","continuous-deployment","heroku","slug","works-with-codespaces"],"created_at":"2024-10-03T21:39:30.463Z","updated_at":"2025-03-31T13:30:58.818Z","avatar_url":"https://github.com/CGA1123.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slugcmplr\n\n`slugcmplr` allows you to compile Heroku compatible slugs using official and\ncustom buildpacks, in the same manner as the [Heroku Slug Compiler](https://devcenter.heroku.com/articles/slug-compiler)\n\nThis enables more control over the build process and allows for\ndetaching building and releasing your Heroku applications.\n\n## Install\n\nWith the `go` toolchain installed:\n```bash\n# In order to use this as a library\ngo get github.com/cga1123/slugcmplr\n\n# In order to install as a CLI\ngo install github.com/cga1123/slugcmplr@latest\n```\n\nThere are also precompiled binaries and their associated checksums are\navailable attached to tagged [releases].\n\n## Info\n\n`slugcmplr` has 3 steps/sub-commands:\n\n#### `prepare [APPLICATION] --build-dir [BUILD-DIR] --source-dir [SOURCE-DIR]`\n\nIn the prepare step, `slugcmplr` will fetch the metadata required to compile\nyour application. It will copy your project `SOURCE-DIR` into `BUILD-DIR/app`.\n\nIt will fetch the buildpacks as defined by your Heroku application, download, and\ndecompress them into `BUILD-DIR/buildpacks`. If using official buildpacks (e.g.\n`heroku/go`, `heroku/ruby`) `slugcmplr` will use the same buildpack as\ncurrently deployed to Heroku's production environment.\n\nIt will fetch the config vars as defined by your Heroku application and put\nthem into the `BUILD-DIR/environment` directory.\n\nFinally, `prepare` writes metadata (such as the application name, stack,\nbuildpack order, source version) to the `BUILD-DIR/compile.json` file to allow\nthe `compile` step to bootstrap itself.\n\n#### `compile --build-dir [BUILD-DIR] --cache-dir [CACHE-DIR]`\n\nIn the compile step, `slugcmplr` executes your buildpacks in the specified\norder, outputs your Heroku slug, and uploads it to Heroku for future release.\n\n`compile` will output the slug for your application to `BUILD-DIR/app.tgz`\n\n`compile` will output metadata about the compilation to\n`BUILD-DIR/release.tgz`, this contains information such as the slug ID as\nuploaded to Heroku.\n\nThe `CACHE-DIR` will be used by the buildpacks as their cache argument to speed\nup builds in the future, as per the [Buildpack API](https://devcenter.heroku.com/articles/buildpack-api)\n\nTo guarantee full compatibility, it is recommended to run this step using\nHeroku's build containers. e.g. `heroku/heroku:24-build`.\n\n#### `release --build-dir [BUILD-DIR]`\n\nIn the release step, `slugcmplr` triggers a release of your previously compiled\nslug.\n\nIt uses the `BUILD-DIR/release.json` file in order to fetch metadata in order\nto create this release.\n\nYou can optionally pass `--app [APPLICATION]` to target an application that is\ndifferent from the one you built from. This will work as long as the\napplications are in the same Heroku team. (This is becuase the slug must be\naccessible to the application).\n\nYou can optionally pass `--commit [COMMIT]` to associate this release with a\nseparate commit from the one used to build this slug initially.\n\n## Authentication\n\nThe `slugcmplr` CLI looks for credentials to `api.heroku.com` in your `.netrc`\nfile, this is the same technique used by [`heroku/cli`] and so if you are\ncurrently making use of the `heroku` command during CI, you should already be\nlogging in somehow and have no issues.\n\nOtherwise populating your `.netrc` should be a case of adding something\nequivalent to the following script (assuming the `HEROKU_EMAIL` and\n`HEROKU_API_KEY` are correctly populated environment variables):\n\n```bash\ncat \u003c\u003c EOF \u003e\u003e ${HOME}/.netrc\nmachine api.heroku.com\n  login ${HEROKU_EMAIL}\n  password ${HEROKU_API_KEY}\nEOF\n```\n\nBy default, `slugcmplr` will look in `${HOME}/.netrc` for the credentials,\nhowever it will respect the `${NETRC}` environment variable if set and\nnon-empty.\n\n## Testing\n\nThe majority of tests for this project are acceptance tests that will create\nand release live Heroku applications. These require the correct credentials to\nbe set in the environment as well as setting a sentinel value to execute the\nacceptance tests:\n\n```bash\nSLUGCMPLR_ACC=true \\\n  SLUGCMPLR_ACC_HEROKU_PASS=\u003cHEROKU-API-KEY\u003e \\\n  SLUGCMPLR_ACC_HEROKU_EMAIL=\u003cHEROKU-EMAIL\u003e \\\n  go test -v\n```\n\nFixture application are hosted in separate repositories which will be cloned\nand created by using the `withHarness` function. Fixture repositories are\nexpected to contain a `app.json` file which describes the Heroku applications.\n\nSee [app.json Schema](https://devcenter.heroku.com/articles/app-json-schema)\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/CGA1123/slugcmplr\n\nSee [issues](https://github.com/CGA1123/slugcmplr/issues) if you want any\ninspiration as to what to help with or of any pending discussion/work.\n\nThis project is Codespaces compatible! If you want to get started quickly spin one up.\n\nThe `script` directory should help you get going with building and testing.\n\nSome buildpacks are not compatible with `arm`/`arm64` architectures, you may experience\nissues testing `slugcmplr` on an M1 Chip, even if using docker containers.\n\n---\n\nFor more background on this you might find [this] Medium article helpful.\n\n[this]: https://medium.com/carwow-product-engineering/speeding-up-our-heroku-deploys-by-35-percent-f9fa6f6cf404\n[`heroku/cli`]: https://github.com/heroku/cli\n[releases]: https://github.com/cga1123/slugcmplr/releases\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcga1123%2Fslugcmplr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcga1123%2Fslugcmplr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcga1123%2Fslugcmplr/lists"}