{"id":13840124,"url":"https://github.com/getporter/skeletor","last_synced_at":"2025-07-28T01:33:05.463Z","repository":{"id":40791060,"uuid":"186688332","full_name":"getporter/skeletor","owner":"getporter","description":"This repository contains the skeleton structure of a Porter Mixin. You can clone this repository and use it as a starting point to build new mixins.","archived":false,"fork":false,"pushed_at":"2025-03-13T01:29:18.000Z","size":2981,"stargazers_count":12,"open_issues_count":3,"forks_count":17,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-04T11:22:26.127Z","etag":null,"topics":["mixin","porter","template"],"latest_commit_sha":null,"homepage":"https://getporter.org/mixin-dev-guide/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getporter.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":"2019-05-14T19:38:51.000Z","updated_at":"2025-02-03T08:12:34.000Z","dependencies_parsed_at":"2024-03-01T06:32:43.171Z","dependency_job_id":"29dc927f-c454-42b9-9a01-8091dba37442","html_url":"https://github.com/getporter/skeletor","commit_stats":null,"previous_names":["deislabs/porter-skeletor"],"tags_count":5,"template":true,"template_full_name":null,"purl":"pkg:github/getporter/skeletor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getporter%2Fskeletor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getporter%2Fskeletor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getporter%2Fskeletor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getporter%2Fskeletor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getporter","download_url":"https://codeload.github.com/getporter/skeletor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getporter%2Fskeletor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267451073,"owners_count":24089291,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["mixin","porter","template"],"created_at":"2024-08-04T17:00:42.304Z","updated_at":"2025-07-28T01:33:05.200Z","avatar_url":"https://github.com/getporter.png","language":"Go","funding_links":[],"categories":["Implementations"],"sub_categories":["Porter"],"readme":"# A Porter Mixin Skeleton\n\n[![Build Status](https://dev.azure.com/getporter/porter/_apis/build/status/skeletor?branchName=main)](https://dev.azure.com/getporter/porter/_build/latest?definitionId=13\u0026branchName=main)\n\nThis repository contains the skeleton structure of a Porter Mixin. You can clone\nthis repository and use it as a starting point to build new mixins. The\nstructure of this project matches closely with existing Porter [Mixins](https://porter.sh/mixins).\n\n1. Create a new repository in GitHub [using this repository as a\n   template](https://help.github.com/en/articles/creating-a-repository-from-a-template).\n1. Go 1.17 or higher is required. You can choose to clone into the GOPATH or not according to preference.\n1. Rename the `cmd/skeletor` and `pkg/skeletor` directories to `cmd/YOURMIXIN` and\n   `pkg/YOURMIXIN`.\n1. Find any remaining `skeletor` text in the repository and replace it with `YOURMIXIN`.\n1. In `pkg/YOURMIXIN/version.go` replace `YOURNAME` with the name you would like displayed as the mixin\n   author. This value is displayed as the author of your mixin when `porter mixins list` is run.\n1. Replace the `YOURNAME` instances in `pkg/YOURMIXIN/version_test.go` with the name used above.\n1. Run `mage build test` to try out all the make targets and\n   verify that everything executes without failing. You may need to fix a test string or two.\n1. Run `mage install` to install your mixin into the Porter home directory. If\n   you don't already have Porter installed, [install](https://porter.sh/install) it first.\n1. Now your mixin is installed, you are ready start customizing and iterating on\n   your mixin!\n\n## Customize your mixin\n\nThis mixin is ready to wrap an existing command-line tool. The shortest path\nwould be to edit `build.go` to add the instructions to download the tool\nand you are all set. It will look and feel like the [gcloud](https://porter.sh/mixins/gcloud)\nor [aws](https://porter.sh/mixins/aws) mixins, both of which are built on top of the exec mixin.\n\nEdit the `Build` function in `pkg/skeletor/build.go`.\nHere you can add any Dockerfile lines that you require to download and install\nadditional tools, configuration files, etc necessary for your mixin. The Build\nfunction should write the Dockerfile lines to `m.Out` which is a pipe from the\nmixin back to porter.\nYou will also find the basic logic supporting mixin configuration.  Support for `clientVersion` is ready to go, which enables users to specify the version of the underlying tool/utility provided by the mixin, if applicable.\n\nSearch for `TODO` in the code and follow the instructions to customize the mixin.\n\nHere is an example from the aws mixin, where it downloads the latest version of\nof the aws binary and installs it:\n\nhttps://github.com/getporter/aws-mixin/blob/001c19bfe06d248143353a55f07a42c913579481/pkg/aws/build.go#L7\n\nThis is enough to have a working mixin. Run `mage build install` and then test\nit out with a bundle.\n\nThat will get you started but make sure to read the mixin developer\ndocumentation for how to create a full featured mixin:\n\n* [Mixin Architecture](https://porter.sh/mixin-dev-guide/architecture/)\n* [Mixin Commands](https://porter.sh/mixin-dev-guide/commands/)\n* [Distributing Mixins](https://porter.sh/mixin-dev-guide/distribution/)\n\nOnce ready for primetime, don't forget to revisit this `README.md` and update/replace it with details on your mixin.\n\n## Project Structure\n\nIn the `cmd/skeletor` directory, you will find a cli built using [spf13/cobra](https://github.com/spf13/cobra). The CLI contains a go file for each basic capability a Mixin should implement:\n\n* build\n* schema\n* version\n* install\n* upgrade\n* invoke\n* uninstall\n\nEach of these command implementations have a corresponding Mixin implementation in the `pkg/skeletor` directory. Each of the commands above is wired into an empty implementation in `pkg/skeletor` that needs to be completed. In order to build a new Mixin, you need to complete these implementations with the relevant technology. For example, to build a [Cloud Formation](https://aws.amazon.com/cloudformation/) mixin, you might implement the methods in `pkg/skeletor` using the [AWS Go SDK](https://docs.aws.amazon.com/sdk-for-go/api/service/cloudformation/).\n\n## Provided capabilities\n\nThis skeleton mixin project brings some free capabilities:\n\n### File System Access and Context\n\nPorter provides the [portercontext](https://porter.sh/src/pkg/portercontext) package that has helpful mechanisms for accessing the File System using [spf13/afero](https://github.com/spf13/afero). This makes it easy to provide mock File System implementations during testing. The portercontext package also provides a mechanism to encapsulate stdin, stdout and stderr so that they can easily be passed from `cmd/skeletor` code to implementing `pkg/skeletor` code.\n\n### Template and Static Asset Handling\n\nThe project go:embed for dealing with static files, such as templates or other content that is best modeled outside of a Go file. You can see an example of this in `pkg/skeletor/schema.go`.\n\n### Basic Schema\n\nThe project provides an implementation of the `skeletor schema` command that is mostly functional. To fully implement this for your mixin, you simply need to provide a valid JSON schema. For reference, consult `pkg/skeletor/schema/schema.json`.\n\n### Basic Tests\n\nThe project provides some very basic test skeletons that you can use as a starting point for building tests for your mixin.\n\n### Magefile\n\nThe project also includes a [Magefile] that is used to build, test, and publish the mixin.\n\n### Publish\n\nYou must set the `GITHUB_TOKEN` environment variable with your personal access token in order to use the default publish target.\n\nPublish uploads cross-compiled binaries of your mixin to a GitHub release.\nYou must set the `PORTER_RELEASE_REPOSITORY` environment variable to your GitHub repository name, e.g. github.com/YOURNAME/YOURREPO.\nThere is a placeholder in the Publish magefile target where you can set that value.\n\nCreate a tag, for example `git tag v0.1.0`, and push it to your repository.\nRun `mage XBuildAll Publish` to build your mixin and upload the binaries to the github release for that tag.\nIf the commit is not tagged, the release is named \"canary\".\n\nIf you want to generate a mixin feed file (atom.xml), edit the Publish magefile target, uncomment out the rest of the function, and set the `PORTER_PACKAGES_REMOTE` environment variable to a repository where the atom.xml file should be committed.\nFor example, Porter uses github.com/getporter/packages for publishing our mixin feed.\n\n[Magefile]: https://magefile.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetporter%2Fskeletor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetporter%2Fskeletor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetporter%2Fskeletor/lists"}