Hi everyone,
In Bamboo, I want a build to stop executing the following tasks based the last part of a variable. To be more specific: I only want to continue if the Maven version of the project I'm working on is a SNAPSHOT. I installed the Maven pom value extractor plugin, and now I have the project version, but how do I get the last part of that variable? I tried these:
#!/bin/bash
echo "========================================================"
echo Maven version is ${bamboo.maven.version}
echo Last 10 pos is ${bamboo.maven.version:(-10)}
echo ${bamboo.maven.version} | tail -c 10
echo "========================================================"
but they give these errors:
13-Nov-2018 12:44:17 ========================================================
13-Nov-2018 12:44:17 Maven version is 2.0.3-SNAPSHOT
13-Nov-2018 12:44:17 /opt/atlassian/bamboo/temp/DLWO-YLAN-BA-37-ScriptBuildTask-1970695706317157380.sh: line 5: ${bamboo.maven.version:(-10)}: bad substitution
13-Nov-2018 12:44:17 tail: cannot open `10' for reading: No such file or directory
13-Nov-2018 12:44:17 ========================================================
These commands work when run from a normal shell script. What can I do in a Bamboo script task to achieve this?
TIA,
Jules.