Quantcast
Channel: CircleCI Discuss - Latest posts
Viewing all articles
Browse latest Browse all 14877

Environment Variable Repalce

$
0
0

I created my first pipeline yesterday and I wanted to replace a placeholder in my bundle.gradle file with the CIRCLE_BUILD_NUM environment variable. The only method I found find was writing my own ‘sed’ command and executing the regex in a run statement. This worked fine to get up and running, since there was only one variable to replace, however this method obviously won’t scale, down the road. Is there a CircleCI feature/orb or other method to do a more comprehensive placeholder/envar swap throughout my project?

  - run:
      name: Increment build id
      command: sed "s/_buildNum/${CIRCLE_BUILD_NUM}/g" -i build.gradle

Viewing all articles
Browse latest Browse all 14877