{"id":15694098,"url":"https://github.com/jeffdecola/concourse-resource-template","last_synced_at":"2025-08-01T16:08:55.034Z","repository":{"id":48563030,"uuid":"68176382","full_name":"JeffDeCola/concourse-resource-template","owner":"JeffDeCola","description":"Can be used as a template for developing a concourse resource.","archived":false,"fork":false,"pushed_at":"2025-04-20T18:56:48.000Z","size":2489,"stargazers_count":7,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-08T16:52:35.810Z","etag":null,"topics":["concourse","concourse-resources"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/JeffDeCola.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,"zenodo":null}},"created_at":"2016-09-14T05:35:02.000Z","updated_at":"2025-04-20T18:56:52.000Z","dependencies_parsed_at":"2025-02-04T20:19:38.701Z","dependency_job_id":"35f2af15-7ed0-4043-961c-a078f01b3641","html_url":"https://github.com/JeffDeCola/concourse-resource-template","commit_stats":null,"previous_names":["jeffdecola/resource-template"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/JeffDeCola/concourse-resource-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffDeCola%2Fconcourse-resource-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffDeCola%2Fconcourse-resource-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffDeCola%2Fconcourse-resource-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffDeCola%2Fconcourse-resource-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JeffDeCola","download_url":"https://codeload.github.com/JeffDeCola/concourse-resource-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffDeCola%2Fconcourse-resource-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268257060,"owners_count":24221054,"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-08-01T02:00:08.611Z","response_time":67,"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":["concourse","concourse-resources"],"created_at":"2024-10-03T18:52:23.190Z","updated_at":"2025-08-01T16:08:55.011Z","avatar_url":"https://github.com/JeffDeCola.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CONCOURSE RESOURCE TEMPLATE\n\n[![Tag Latest](https://img.shields.io/github/v/tag/jeffdecola/concourse-resource-template)](https://github.com/JeffDeCola/concourse-resource-template/tags)\n[![jeffdecola.com](https://img.shields.io/badge/website-jeffdecola.com-blue)](https://jeffdecola.com)\n[![MIT License](https://img.shields.io/:license-mit-blue.svg)](https://jeffdecola.mit-license.org)\n[![Docker Pulls](https://badgen.net/docker/pulls/jeffdecola/concourse-resource-template?icon=docker\u0026label=pulls)](https://hub.docker.com/r/jeffdecola/concourse-resource-template/)\n\n_Can be used as a template for developing a concourse resource._\n\nTable of Contents\n\n* [OVERVIEW](https://github.com/JeffDeCola/concourse-resource-template#overview)\n  * [CHECK](https://github.com/JeffDeCola/concourse-resource-template#check)\n  * [IN](https://github.com/JeffDeCola/concourse-resource-template#in)\n  * [OUT](https://github.com/JeffDeCola/concourse-resource-template#out)\n* [BUILD AND PUSH THE RESOURCE](https://github.com/JeffDeCola/concourse-resource-template#build-and-push-the-resource)\n* [TEST THIS RESOURCE](https://github.com/JeffDeCola/concourse-resource-template#test-this-resource)\n\nDocumentation and Reference\n\n* [concourse-resource-template docker image](https://hub.docker.com/r/jeffdecola/concourse-resource-template)\n  on DockerHub\n* This repos\n  [github webpage](https://jeffdecola.github.io/concourse-resource-template/)\n  _built with\n  [concourse](https://github.com/JeffDeCola/concourse-resource-template/blob/master/ci-README.md)_\n\n## OVERVIEW\n\nA concourse resource is a docker image.\n\nIt requires 3 kinds of scripts or executables,\n\n* **check** - Detecting new versions of the STUFF (e.g. git version)\n* **in** - GET STUFF\n* **out** - PUT STUFF\n\nYou build your resource with a Dockerfile by using the\n`concourse docker base image` and adding your scripts/executables to `/opt/resource`.\n\nThe three scripts/executables can be written with bash, go, etc.\n\n* My go is build is located in\n  [/build-resource-using-go](https://github.com/JeffDeCola/concourse-resource-template/tree/master/build-resource-using-go-in-development)\n  _(In development)_\n* My bash build is located in\n  [/build-resource-using-bash](https://github.com/JeffDeCola/concourse-resource-template/tree/master/build-resource-using-bash)\n\n![IMAGE - concourse-check-in-out-pipeline - IMAGE](docs/pics/concourse-check-in-out-pipeline.svg)\n\n---\n\n### CHECK\n\n[check](https://github.com/JeffDeCola/concourse-resource-template/blob/master/build-resource-using-bash/check-in-out/check)\nis performed before anything can use the resource. It is used to\ndetermine if the STUFF has changed (checks version of STUFF).\n\n#### PART 1 - Input\n\nConcourse will send **stdin** for `check` to parse, where the source\nand comes from the pipeline and the version comes from the check.\n\n```json\n{\n  \"source\": {\n    \"source1\": \"source1 info\",\n    \"source2\": \"source2 info\",\n    \"source3\": \"source3 info\"\n  },\n  \"version\": {\n    \"ref\": \"null\"\n  }\n}\n```\n\n#### PART 2 - Check/Update Version\n\nIn this example, I will mimic a getting a new version and increment until\nversion 5.\n\n#### PART 3 - Output\n\nCheck will send **stdout** that will be used in the next step in the pipeline.\n\n```json\n[\n  {\n    \"ref\": \"1\"\n  }\n]\n```\n\n---\n\n### IN\n\nThe\n[in](https://github.com/JeffDeCola/concourse-resource-template/blob/master/build-resource-using-bash/check-in-out/in)\nis performed after a check has confirmed there is something there.\nFor my resource,\n[in](https://github.com/JeffDeCola/concourse-resource-template/blob/master/build-resource-using-bash/check-in-out/in)\nwill mimic **fetching STUFF** and place a file in the working directory.\n\n#### PART 1 - Input\n\nConcourse will send **stdin** for `in` to parse, where the source\nand params come from the pipeline and the version comes from the check.\n\n```json\n{\n  \"params\": {\n    \"param1\": \"get param1\",\n    \"param2\": \"get param2\",\n    \"param3\": \"get param3\"\n  },\n  \"source\": {\n    \"source1\": \"source1 info\",\n    \"source2\": \"source2 info\",\n    \"source3\": \"source3 info\"\n  },\n  \"version\": {\n    \"ref\": \"1\"\n  }\n}\n```\n\n#### PART 2 - GET Something\n\nIn this example, I will mimic a fetch some STUFF and place a file\n`get_fetch.json` in the working directory.\n\n#### PART 3 - Output\n\nInput will send **stdout** that will be used in the next step in the pipeline.\n\n```json\n{\n  \"version\": {\n    \"ref\": \"1\"\n  },\n  \"metadata\": [\n    { \"name\": \"author\", \"value\": \"Jeff DeCola\"},\n    { \"name\": \"author_date\", \"value\": \"March 2023\"},\n    { \"name\": \"executable\", \"value\": \"in\"},\n    { \"name\": \"version\", \"value\": \"1\" }\n  ]\n}\n```\n\n---\n\n### OUT\n\nThe\n[out](https://github.com/JeffDeCola/concourse-resource-template/blob/master/build-resource-using-bash/check-in-out/out)\nwill mimic **updating STUFF**\nand is performed after the task.\n\n#### PART 1 - Input\n\nConcourse will send **stdin** for `out` to parse, where the source\nand params come from the pipeline.\n\n```json\n{\n  \"params\": {\n    \"param1\": \"put param1\",\n    \"param2\": \"put param2\",\n    \"param3\": \"put param3\"\n  },\n  \"source\": {\n    \"source1\": \"source1 info\",\n    \"source2\": \"source2 info\",\n    \"source3\": \"source3 info\"\n  }\n}\n```\n\n#### PART 2 - PUT Something\n\nIn this example, I will mimic a push/deploy to STUFF and place a file\n`put_fetch.json` in the working directory.\n\nIt is important you must recheck version here. **So you must get the version.**\n\n#### PART 3 - Output\n\nYou send **stdout** that will be used in the next step in the pipeline.\n\n```json\n{\n  \"version\": {\n    \"ref\": \"1\"\n  },\n  \"metadata\": [\n    { \"name\": \"author\", \"value\": \"Addie DeCola\"},\n    { \"name\": \"author_date\", \"value\": \"April 2021\"},\n    { \"name\": \"executable\", \"value\": \"out\"},\n    { \"name\": \"version\", \"value\": \"1\" }\n  ]\n}\n```\n\n## BUILD AND PUSH THE RESOURCE\n\nI am using bash shell scripts to build the resource docker image.\nUsing go is still in development.\n\nTo\n[build.sh](https://github.com/JeffDeCola/concourse-resource-template/blob/master/build-resource-using-bash/build/build.sh)\nusing the\n[Dockerfile](https://github.com/JeffDeCola/concourse-resource-template/blob/master/build-resource-using-bash/build/Dockerfile),\n\n```bash\ncd build-resource-using-bash/build\nsh build-resource.sh\n```\n\nNote how a concourse base image is used to build the resource.\n\nTo\n[push.sh](https://github.com/JeffDeCola/concourse-resource-template/blob/master/build-resource-using-bash/push/push.sh)\nthe resource docker image to dockerhub,\n\n```bash\ncd build-resource-using-bash/push\nsh push.sh\n```\n\nYou can check this docker image,\n\n```bash\ndocker images jeffdecola/concourse-resource-template\ndocker run --name concourse-resource-template -dit jeffdecola/concourse-resource-template\ndocker exec -i -t concourse-resource-template /bin/bash\ncd /opt/resource\ntree\ndocker logs concourse-resource-template\ndocker rm -f concourse-resource-template\n```\n\n## TEST THIS RESOURCE\n\nNow we can test the resource in a concourse pipeline.\n\nTo [set-pipeline.sh](https://github.com/JeffDeCola/concourse-resource-template/blob/master/test-this-resource/set-pipeline.sh)\nfor concourse,\n\n```bash\ncd test-this-resource\nsh set-pipeline.sh.\n```\n\nWhere the\n[pipeline.yml](https://github.com/JeffDeCola/concourse-resource-template/blob/master/test-this-resource/pipeline.yml),\n\n```yml\n#------------------------------------------------------------------------------------------\njobs:\n\n#**********************************************\n- name: job-test-concourse-resource-template\n#**********************************************\n  plan:\n\n    # GET REPO FROM GITHUB\n    - get: concourse-resource-template\n      trigger: true\n\n    # CONCOURSE RESOURCE TEMPLATE\n    - get: concourse-resource-template-test\n      params:\n        param1: \"get param1\"\n        param2: \"get param2\"\n        param3: \"get param3\"\n\n    # RUN TASK IN REPO USING ALPINE DOCKER IMAGE\n    - task: task-test-concourse-resource-template\n      file: concourse-resource-template/test-this-resource/tasks/task-test-concourse-resource-template.yml\n\n      # TASK SUCCESS\n      on_success:\n        do:\n          # CONCOURSE RESOURCE TEMPLATE\n          - put: concourse-resource-template-test\n            params:\n              param1: \"put param1\"\n              param2: \"put param2\"\n              param3: \"put param3\"\n\n#------------------------------------------------------------------------------------------\nresource_types:\n\n  - name: jeffs-resource\n    type: docker-image\n    source:\n      repository: jeffdecola/concourse-resource-template\n      tag: latest\n\n#------------------------------------------------------------------------------------------\nresources:\n\n  - name: concourse-resource-template\n    type: git\n    icon: github\n    source:\n      uri: git@github.com:jeffdecola/concourse-resource-template.git\n      branch: master\n      private_key: ((git_private_key))\n\n  - name: concourse-resource-template-test\n    type: jeffs-resource\n    source:\n      source1: \"source1 info\"\n      source2: \"source2 info\"\n      source3: \"source3 info\"\n```\n\nNote: You will need to put your `((git_private_key))` in a .credentials\nfile in the root of this repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffdecola%2Fconcourse-resource-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeffdecola%2Fconcourse-resource-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffdecola%2Fconcourse-resource-template/lists"}