I'm using Bamboo cloud to run a maven build on an EC2 instance.
Some of the tests require the local ip address of the instance. Of course, I can hard code that as either an environment variable or a system property in my build plan. However, this doesn't work well if the instance were to crash.
Luckily, Amazon provides the metadata service that allows me to get this value dynamically from any EC2 instance:
/usr/bin/curl http://169.254.169.254/latest/meta-data/local-ipv4
So essentially, I just want to execute that one line and place the resulting value in either an environment variable or a system property that can be used within my build plan.
I've read the Bamboo documentation up and down and tried several approaches (setting global variable, exporting environment variable in instance startup script, setting Maven environment variable in build plan, executing a script task), but none of them have worked.
Is there a way to do this that I'm missing?
You can create a script task that will output the required data into a file and then use the variable inject task to feed them into Bamboo.
@Tim Kral , see documentation for this task - https://confluence.atlassian.com/bamboo/configuring-a-variables-task-687213475.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.