concourse / semver-resource

automated semantic version bumping
Apache License 2.0
97 stars 105 forks source link

Version number as a variable in a shell script #48

Closed cornedenhollander closed 6 years ago

cornedenhollander commented 6 years ago

I’m using a semver resource where the version number is stored in git. Now I want to use the version number in the filename of the build file that is stored in a S3 bucket. We have the pipeline pointing to a separate task-file which points to a shell script. It is in that shell script that I want to use the version as a variable. Now in the shell file the version variable is replaced by the literal argument text [version/number] instead of with the actual version number.

How would I use the version number from the resource in this case?

cornedenhollander commented 6 years ago

@vito @topherbullock

vito commented 6 years ago

You should cat the version file in your script. It is not exposed as an environment variable.

cornedenhollander commented 6 years ago

Thanks a lot, I'll try that!