Im trying to run the following step, but it does not execute the \"if\" steps (lines 5 and 6) (I\'m pretty sure they should as the directory tested for does not exist, i tried i
Basically, Bb Pipelines support conditions, be it file checks using -e
or comparisons. For instance, these lines all do work:
script:
- '[ ! -e "$BITBUCKET_CLONE_DIR/missing.txt" ] && echo "File does not exist"'
- 'if [ ! -e "$BITBUCKET_CLONE_DIR/missing.txt" ]; then echo "File does not exist"; fi'
- if [ ! -e "$BITBUCKET_CLONE_DIR/missing.txt" ]; then echo "File does not exist"; fi
As shown in the example, for some commands it can be needed to wrap the line in single quotes (here, only for demonstration purposes), so if Bb reports a syntax error, you should experiment with that.
But: are you sure you really want $HOME
? By default, you are in $BITBUCKET_CLONE_DIR
– not in $HOME
–, and therefore the curl
call downloads the SDK to $BITBUCKET_CLONE_DIR
.