{"id":16260034,"url":"https://github.com/cludden/concourse-keyval-resource","last_synced_at":"2026-03-01T07:31:55.979Z","repository":{"id":52307402,"uuid":"487408266","full_name":"cludden/concourse-keyval-resource","owner":"cludden","description":"a concourse resource for passing arbitrary data between steps/jobs and curating dynamic filesystem content","archived":false,"fork":false,"pushed_at":"2024-05-11T14:29:34.000Z","size":309,"stargazers_count":0,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-25T04:33:45.466Z","etag":null,"topics":["concourse","concourse-ci","concourse-resource","concourse-resources"],"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/cludden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-05-01T00:07:17.000Z","updated_at":"2022-07-07T14:20:14.000Z","dependencies_parsed_at":"2024-06-21T08:44:12.560Z","dependency_job_id":"4926d206-cfc4-4cc1-ac8c-29f64bb5215c","html_url":"https://github.com/cludden/concourse-keyval-resource","commit_stats":{"total_commits":12,"total_committers":2,"mean_commits":6.0,"dds":0.25,"last_synced_commit":"87269333aa84a0a05bf85b638a2020cdcf74a3f9"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/cludden/concourse-keyval-resource","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cludden%2Fconcourse-keyval-resource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cludden%2Fconcourse-keyval-resource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cludden%2Fconcourse-keyval-resource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cludden%2Fconcourse-keyval-resource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cludden","download_url":"https://codeload.github.com/cludden/concourse-keyval-resource/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cludden%2Fconcourse-keyval-resource/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29963774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T06:55:38.174Z","status":"ssl_error","status_checked_at":"2026-03-01T06:53:04.810Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["concourse","concourse-ci","concourse-resource","concourse-resources"],"created_at":"2024-10-10T16:06:06.327Z","updated_at":"2026-03-01T07:31:55.953Z","avatar_url":"https://github.com/cludden.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# concourse-keyval-resource\na [Concourse](https://concourse-ci.org/resources.html) resource for:\n- passing arbitrary data between steps and/or jobs\n- curating dynamic filesystem content\n\n## Getting Started\n```yaml\nresource_types:\n  - name: keyval\n    type: registry-image\n    source:\n      repository: ghcr.io/cludden/concourse-keyval-resource\n\nresources:\n  - name: keyval\n    type: keyval\n    icon: table\n    expose_build_created_by: true\n\njobs:\n  - name: first\n    plan:\n      - put: keyval\n        params:\n          mapping: |\n            root = this.map_each_key(k -\u003e k.replace_all(\"build_\", \"\"))\n\n  - name: second\n    plan:\n      - get: keyval\n        trigger: true\n        passed: [first]\n        params:\n          files:\n            test.md: |\n              root = \"\"\"\n              # Build Summary\n              | ID | Team | Pipeline | Job | Name |\n              | :---: | :--- | :--- | :--- | :--- |\n              | [%s](%s) | %s | %s | %s | %s |\n              \"\"\".format(id, url, team, pipeline, job, name)\n            test.json: |\n              uid = ksuid()\n              id = id\n              url = url\n\n      - task: print\n        config:\n          platform: linux\n          image_resource:\n            type: registry-image\n            source:\n              repository: busybox\n          inputs:\n            - name: keyval\n          run:\n            path: /bin/sh\n            args:\n              - -c\n              - |\n                ls -lh ./keyval\n                echo \"keyval/version.json:\"\n                cat keyval/version.json\n                echo \"keyval/metadata.json:\"\n                cat keyval/metadata.json\n                echo \"keyval/test.md:\"\n                cat keyval/test.md\n                echo \"keyval/test.json:\"\n                cat keyval/test.json\n```\n\n## Configuration\n\n**Parameters:**\n| Parameter | Type | Description | Required |\n| :--- | :---: | :--- | :---: |\n| archive | [*archive.Archive](https://pkg.go.dev/github.com/cludden/concourse-go-sdk@v0.3.1/pkg/archive#Config) | optional archive config that can be used to enable [resource version archiving](https://github.com/cludden/concourse-go-sdk#archiving) | |\n| initial_mapping | `string` | a [Bloblang mapping](https://www.benthos.dev/docs/guides/bloblang/about) that can be used to customize the initial version returned by this resource. See [Initial Mapping](#initial-mapping) for more details. | ⚠ |\n\n## Behavior\n\n### `check`\nCheck returns the latest available version produced by a `put` step. If `get` is used prior to `put`, an initial version will be returned which can be customized via the `initial_mapping` resource parameter.\n\n### `in`\nFetches arbitrary key value data from a prior put step and writes it the file system as a JSON document.\n\n**Parameters:**\n| Parameter | Type | Description | Required |\n| :--- | :---: | :--- | :---: |\n| files | `map[string]string` | a map of filenames to [Bloblang mappings](https://www.benthos.dev/docs/guides/bloblang/about), where the input document contains the [build metadata](https://concourse-ci.org/implementing-resource-types.html#resource-metadata) along with any key value data from the fetched version, and the output is the content of the file to write (note: unless the file extension is one of `.json`, `.yaml`, or `.yml`, the mapping output must be of type `string` or `[]byte`) | |\n\n**Files:**\n- `version.json` - the key value pairs serialized as a JSON document\n- `metadata.json` - the [build metadata](https://concourse-ci.org/implementing-resource-types.html#resource-metadata) serialized as a JSON document\n- `*` any file mappings defined in the `files` parameter\n\n### `out`\nPublishes arbitrary key value data to be shared across jobs.\n\n**Parameters:**\n| Parameter | Type | Description | Required |\n| :--- | :---: | :--- | :---: |\n| mapping | `string` | a [Bloblang mappings](https://www.benthos.dev/docs/guides/bloblang/about), where the input document contains the [build metadata](https://concourse-ci.org/implementing-resource-types.html#resource-metadata), and the output is a `map[string]string`, defaults to `root = this` | |\n\n## Build Metadata\nEach [Bloblang mappings](https://www.benthos.dev/docs/guides/bloblang/about) the following build metadata as input:\n| Parameter | Type | Description | Always Available |\n| :--- | :---: | :--- | :---: |\n| build_created_by | `string` | the username that created the build, only available when the resource is configured to [expose_build_created_by](https://concourse-ci.org/resources.html#schema.resource.expose_build_created_by) | |\n| build_id | `string` | the unique build identifier | ✓ |\n| build_instance_vars | `string` | instance vars of the instanced pipeline that the build's job lives in, serialized as JSON | |\n| build_job | `string` | the name of the job | ✓ |\n| build_name | `string` | the build id in the context of the pipeline | ✓ |\n| build_pipeline | `string` | the name of the pipeline | ✓ |\n| build_team | `string` | the name of the team | ✓ |\n| build_url | `string` | the fully qualified build url | ✓ |\n\n## Initial Mapping\nIn most sitautions, like the example below, the initial use of this resource is with a `put` step, followed by a later `get` step, in which case this field is not required and checking should be disabled via `check_every: never` to conserve resources. \n\n```yaml\nresource_types:\n  - name: keyval\n    type: registry-image\n    source:\n      repository: ghcr.io/cludden/concourse-keyval-resource\n\nresources:\n  - name: keyval\n    type: keyval\n    icon: table\n    check_every: never\n    expose_build_created_by: true\n\njobs:\n  - name: first\n    plan:\n      - put: keyval\n        params:\n          mapping: |\n            timestamp = now()\n  \n  - name: second\n    plan:\n      - get: keyval\n        passed: [first]\n        trigger: true\n```\n\nIn others, this resource may be initially used with a `get` step (e.g. importing data from a previous build of the same job), in which case this field is required and `check_every` should be set to some value other than `never` in order to allow for Concourse to implicitly run a check when attempting to satisfy inputs for the initial build.\n\n```yaml\nresource_types:\n  - name: keyval\n    type: registry-image\n    source:\n      repository: ghcr.io/cludden/concourse-keyval-resource\n\nresources:\n  - name: keyval\n    type: keyval\n    icon: table\n    check_every: 24h\n    expose_build_created_by: true\n    source:\n      initial_mapping: |\n        count = \"0\"\n\njobs:\n  - name: first\n    plan:\n      - get: previous\n        resource: keyval\n\n      - load_var: data\n        file: previous/version.json\n        reveal: true\n\n      - put: keyval\n        params:\n          mapping: |\n            count = (((.:data.count)) + 1).string()\n```\n\n## License\nLicensed under the [MIT License](LICENSE.md)  \nCopyright (c) 2023 Chris Ludden","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcludden%2Fconcourse-keyval-resource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcludden%2Fconcourse-keyval-resource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcludden%2Fconcourse-keyval-resource/lists"}