{"id":19259244,"url":"https://github.com/concourse/mock-resource","last_synced_at":"2025-04-07T08:23:36.166Z","repository":{"id":50136373,"uuid":"149696003","full_name":"concourse/mock-resource","owner":"concourse","description":"a resource for testing; reflects the version it's told, and is able to mirror itself","archived":false,"fork":false,"pushed_at":"2025-03-13T01:31:11.000Z","size":54,"stargazers_count":9,"open_issues_count":0,"forks_count":6,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-31T06:09:10.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/concourse.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":"2018-09-21T02:02:47.000Z","updated_at":"2025-03-13T01:31:13.000Z","dependencies_parsed_at":"2024-06-19T01:46:54.785Z","dependency_job_id":"aacedf9e-9f09-4beb-9ed4-58a4c3265350","html_url":"https://github.com/concourse/mock-resource","commit_stats":{"total_commits":41,"total_committers":10,"mean_commits":4.1,"dds":0.5121951219512195,"last_synced_commit":"f58423bf6deff50248b2da12fe5504e680eac298"},"previous_names":["concourse/mirror-resource"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concourse%2Fmock-resource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concourse%2Fmock-resource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concourse%2Fmock-resource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concourse%2Fmock-resource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/concourse","download_url":"https://codeload.github.com/concourse/mock-resource/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247616013,"owners_count":20967313,"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":[],"created_at":"2024-11-09T19:15:50.373Z","updated_at":"2025-04-07T08:23:36.145Z","avatar_url":"https://github.com/concourse.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mock Resource\n\nUsed for testing resource (and resource type) actions without depending on the\noutside world.\n\nAll source fields and parameters are optional.\n\n## Source Configuration\n\n* `mirror_self`: For use on `task.image_resource`, returns itself as an image that tasks can run on.\n\n* `initial_version`: Initial version that the resource should emit. Defaults to `mock`.\n\n* `no_initial_version`: Disable initial version, useful for testing resource triggers.\n\n* `force_version`: Always emit a version regardless of any param during `check`.\n\n* `create_files`: Example:\n  ```yaml\n  create_files:\n    file1.yml: |\n      foo: bar\n    file2.sh |\n      #!/bin/sh\n      echo \"hello world\"\n  ```\n\n* `check_delay`: Amount of time to sleep before returning from the `check`. Uses Go duration format.\n\n* `check_failure`: Force every check to return this error message.\n\n* `metadata`: List of name-value pairs to return as metadata on every get and put. Example:\n  ```yaml\n  metadata:\n  - name: foo\n    value: bar\n  - name: baz\n    value: qux\n  ```\n\n* `log`: Print a message on every action.\n\n## Behavior\n\n### `check`:\n\nIf `force_version` is set, then only that version will ever be emitted, otherwise any version passed into the `check` is returned. This way you can generate a new version `foo` by running `fly check-resource --resource pipeline/resource --from version:foo`.\n\n### `in`:\n\nSince the mock resource is included as a base resource type, it can be used as the image for a task without requiring internet connection (unlike registry-image resource). It can also be used to create files without requiring external state.\n\n#### Parameters\n\n* `mirror_self_via_params`: Same as configuring `mirror_self` in source when set to true. Default false.\n\n* `create_files_via_params`: Similar to `create_files` in source; merged in so that additional (or replaced) files can be specified.\n\n#### Files created by the resource\n\n* `./version`: A file containing the version.\n\n* `./privileged`: A file containing a boolean for if the resource was run with elevated privileges.\n\n* `./rootfs/` and `./metadata.json`: Only populated if mirroring self, contains the rootfs and metadata to run this resource as an image.\n\n* Any files specified by the create files source or param.\n\n### `out`:\n\n#### Parameters\n\n* `version`: Version to create.\n\n* `print_env`: Print all environment variables to stdout when set to true. Default false.\n\n* `file`: Contents will be read from the file and emitted as the version\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcourse%2Fmock-resource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconcourse%2Fmock-resource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcourse%2Fmock-resource/lists"}