Environment var from bash var

#1

Hi,
I was trying to declare a build env var such as
docker-webservice-$VERSION_BASE_NB.$CIRCLE_BUILD_NUM-$CIRCLE_BRANCH

but it does not seem to take my UI declared as well as circle ones into account.
Am I wrong?

Thx!

#2

(Aside: when adding short snippets of code here, please use backticks, thus: docker-webservice-$VERSION_BASE_NB.$CIRCLE_BUILD_NUM-$CIRCLE_BRANCH).

I think this has been covered before - interpolation in env var declarations is tricky on CircleCI. Try this search.

1 Like
#3

thanks, the answer was precisely:

         - run:
           name: Define Environment Variable VERSION_NAME and ENV at Runtime
           command: |
            echo 'export VERSION_NAME=docker- 
            webservice-$VERSION_BASE_NB.$CIRCLE_BUILD_NUM-$CIRCLE_BRANCH' >> $BASH_ENV
            source $BASH_ENV
1 Like
closed #4

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.