https://github.com/dcsg/datetime-version-resource
Concourse CI - Date Time Version Resource
https://github.com/dcsg/datetime-version-resource
concourse-ci concourse-resource concouse datetime version
Last synced: 9 months ago
JSON representation
Concourse CI - Date Time Version Resource
- Host: GitHub
- URL: https://github.com/dcsg/datetime-version-resource
- Owner: dcsg
- License: mit
- Created: 2020-05-24T07:36:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-26T18:17:00.000Z (over 5 years ago)
- Last Synced: 2025-04-01T15:13:50.933Z (10 months ago)
- Topics: concourse-ci, concourse-resource, concouse, datetime, version
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 5
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Date Time Version Resource
Implements a [Concourse CI](https://concourse-ci.org/) resource type to generate a date time version to be used in your pipeline.
## Source Configuration
* `timezone`: *Optional.* The Timezone in which you want the date generated. Default is `UTC`.
* `format`: *Optional.* The Format of the output Date Time version, it uses the [Go Time Format](https://golang.org/src/time/format.go). Default is `20060102-150405`.
## Behavior
### `check`: None.
### `in`: Generates a `version` file containing the Date Time Version.
#### Parameters
*None.*
### `out`: Generates a Date Time version in the Timezone and Format defined.
#### Parameters
*None.*
## Example
```yaml
---
resource_types:
- name: datetime-version
type: registry-image
source:
repository: dcsg/datetime-version-resource
resources:
- name: datetime-version
type: datetime-version
source:
timezone: 'Europe/Lisbon' # default is 'UTC'
format: '20060102.150405' # default is '20060102-150405'
- name: master-code
type: git
icon: git
source:
uri: https://github.com/dcsg/datetime-version-resource.git
branch: master
jobs:
- name: notify-bugsnag
plan:
- put: datetime-version
- put: master-code
params:
// other git config params
tag: datetime-version/version
only_tag: true
```
## Development
### Prerequisites
* golang is *required* - version 1.14.x is tested; earlier versions may also
work.
* docker is *required* - version 19.03.x is tested; earlier versions may also
work.
### Running the tests
The tests have been embedded with the `Dockerfile`; ensuring that the testing
environment is consistent across any `docker` enabled platform. When the docker
image builds, the test are run inside the docker container, on failure they
will stop the build.
Run the tests with the following command:
```sh
docker build -t datetime-version-resource -f dockerfiles/Dockerfile .
```
### Contributing
Please make all pull requests to the `master` branch.