-1

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?

1 Answers1

2

The version number will be stored in a file called <version-resource-name>/version in the task container, so to access the version number you will want to cat that file.

For example, if have a job that gets a version resource.

get: my-version

I can access the version number in my task.sh with:

VERSION="$(cat my-version/version)"
Josh Zarrabi
  • 1,054
  • 7
  • 15