{"user":"avsr","name":"appver-resource","namespace":"avsr","repository_type":"image","status":1,"status_description":"active","description":"Concourse  CI Web Application Version Resource","is_private":false,"is_automated":false,"star_count":0,"pull_count":1035206,"last_updated":"2020-10-18T17:56:38.799065Z","last_modified":"2024-10-16T13:48:34.145251Z","date_registered":"2020-05-13T18:04:26.50015Z","collaborator_count":0,"affiliation":null,"hub_user":"avsr","has_starred":false,"full_description":"\n[![Docker Stars](https://img.shields.io/docker/stars/avsr/appver-resource.svg?style=plastic\u0026logo=docker\u0026label=stars)](https://registry.hub.docker.com/v2/repositories/avsr/appver-resource/stars/count/)\n[![Docker pulls](https://img.shields.io/docker/pulls/avsr/appver-resource.svg?style=plastic\u0026logo=docker\u0026label=pulls)](https://registry.hub.docker.com/v2/repositories/avsr/appver-resource)\n[![Docker build status](https://img.shields.io/docker/cloud/build/avsr/appver-resource.svg?logo=docker\u0026style=plastic\u0026label=build)](https://github.com/aedavelli/appver-resource)\n[![Docker Automated build](https://img.shields.io/docker/cloud/automated/avsr/appver-resource.svg?logo=docker\u0026label=build)](https://github.com/aedavelli/appver-resource)\n[![Docker Size](https://img.shields.io/docker/image-size/avsr/appver-resource/latest?label=size\u0026logo=docker\u0026style=plastic)](https://hub.docker.com/r/avsr/appver-resource/)\n\n[![dockeri.co](http://dockeri.co/image/avsr/appver-resource)](https://hub.docker.com/r/avsr/appver-resource/)\n\n# Concourse CI Web Application Version Resource\n\nImplements a resource that passes to a task the version and different meta data. Can be used to trigger a job based on specified version field change.\n\n## Source Configuration\n\n#### Parameters\n\n* `url`: *Required.* URL which produces version info in one of the JSON/XML/TEXT formats.\n\n* `version_field`: *Optional.* in general. *Required* if response is JSON/XML. The level is separated by *::* 2 colons.\n```json\n{\n  \"version_info\" : {\n    \"git\" : {\n      \"version\" : \"2a3b4e\",\n      \"branch\" : \"release\",\n      \"tag\" : \"v1.1.1\",\n      \"url\" : \"https://github.com/aedavelli/appver-resource\"\n    }\n  }\n}\n ```\n *version_info::git::version* can be used as version_field. All concrete fields under version_info.git will be produced as metadata\n\n* `accept`: *Optional.* in general. If not present defaults to *application/json*\n\n* `username`: *Optional.* in general. Used for basic auth if the URL is protected.\n\n* `password`: *Optional.* in general. Used for basic auth if the URL is protected.\n\n#### Example\n\n``` YAML\nresource_types:\n  - name: appver\n    type: docker-image\n    source:\n      repository: avsr/appver-resource\n\nresources:\n  - name: appver\n    type: appver\n    source:\n      url: http://192.168.1.13:8282/version\n      version_field: \"version_info::git::version\"\n      accept: \"application/json\"\n      username: ((webapp.username))\n      password: ((webapp.password))\n      insecure: true\n      redact: true\n\n\njobs:\n- name: some-job\n  plan:\n  - get: appver\n    trigger: true\n  - task: version-changed-task\n    config:\n      platform: linux\n      image_resource:\n        type: docker-image\n        source: {repository: busybox}\n      # appver directory contains key(filename), value(data inside file)\n      inputs:\n        - name: appver\n      run:\n        # do your work here\n```\n\n## Behavior\n\n### `check`: Check for latest version\n\nWhen no version/latest version  specified, latest version will be returned. If old version specified in request, both old and latest versions will be returned.\n\n### `in`: Write the metadata to the destination dir\n\nFor above mentioned json response below files and content in appver directory\n\nFile|Content|\n--- | ---\nappver/version | 2a3b4e\nappver/branch | release\nappver/tag | v1.1.1\nappver/url | https://github.com/aedavelli/appver-resource\n\n#### Parameters\n\n*None.*\n\n### `out`: Unused\n\nUnused\n\n#### Parameters\n\n*None.*\n\n## Use in a task\n\n```sh\n\nversion=`cat \"${ROOT_FOLDER}/appver/version\"`\necho \"Using web APP with version $version\"\n\n```\n\n## Development\n\n### Prerequisites\n\n* golang is *required* - version 1.14.x is tested; earlier versions may also\n  work.\n* docker is *required* - version 17.06.x is tested; earlier versions may also\n  work.\n\n### Running the tests\n\n```bash\ngo test -v github.com/aedavelli/appver-resource/... -ginkgo.v\n```\nThe tests have been embedded with the `Dockerfile`; ensuring that the testing\nenvironment is consistent across any `docker` enabled platform. When the docker\nimage builds, the test are run inside the docker container, on failure they\nwill stop the build.\n\nRun the tests with the following command:\n\n```sh\ndocker build -t appver-resource .\n```\n\n### Contributing\n\nPlease make all pull requests to the `master` branch and ensure tests pass\nlocally.\n","permissions":{"read":true,"write":false,"admin":false},"media_types":["application/vnd.docker.container.image.v1+json"],"content_types":["image"],"categories":[],"immutable_tags_settings":{"enabled":false,"rules":[".*"]},"storage_size":69000005,"source":null}