It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

running into "LOCAL_PATH must be a directory." issue

My Build docs step succeeds, then it says ✖ LOCAL_PATH must be a directory. after downloading image for the Deploy step.

My yaml file:

#bitbucket-pipelines.yml
image: python:3.6.7


pipelines:
default:
- step:
name: Build docs
script:
- source ci_scripts/create_doc.sh $BITBUCKET_PIPELINES_BRANCH "doc_result"
artifacts:
- doc/$BITBUCKET_PIPELINES_BRANCH/**
- step:
name: Deploy
deployment: production
script:
- pipe: atlassian/aws-s3-deploy:0.2.1
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: "us-west-2"
S3_BUCKET: "tools-docs-dist-prod"
LOCAL_PATH: doc/$BITBUCKET_PIPELINES_BRANCH
ACL: "public-read"
CACHE_CONTROL: "max-age=3600"
EXPIRES: "2018-10-01T00:00:00+00:00"
DELETE_FLAG: "true"
EXTRA_ARGS: "--follow-symlinks"
DEBUG: "true"

My create_docs.sh script is similar to this one here: https://github.com/automl/auto-sklearn/blob/master/ci_scripts/create_doc.sh

2 answers

1 accepted

0 votes
Answer accepted

Hi @gdmacmillan . First I wanted to note that you're using an old version 0.2.1 of the pipe. There is a newer version 0.3.2 available, which has improvements related to your issue.
Second, I'd double check if the doc/$BITBUCKET_PIPELINES_BRANCH directory actually exist after you run your create_doc.sh script. Your can do this by checking the Artifacts tab in your build screen. 

OK i switched to the new version but this wasn't the problem. The problem is my build step wasn't creating any artifacts. For one I didn't have a $DOCPUSH variable set which you can see is needed for the main block to run in the referenced create_doc.sh script. This is set to true now. Now the main block runs but it stops when it gets to 

if ! { [ $1 = "master" ] || [ $1 = "development" ]; }; then
{ echo "Not one of the allowed branches"; exit 0; }
fi

 

Since $1 is the environment variable $BITBUCKET_PIPELINES_BRANCH passed to the script at runtime i need to have it say master or development depending on a push to whichever branch triggered the build. I had set the variable manually in the settings. Is there a default variable which has this already set in bitbucket_pipelines?

for example in travis there is TRAVIS_BRANCH:

  • for push builds, or builds not triggered by a pull request, this is the name of the branch.
  • for builds triggered by a pull request this is the name of the branch targeted by the pull request.
  • for builds triggered by a tag, this is the same as the name of the tag (TRAVIS_TAG).

Sure, there are BITBUCKET_BRANCH  and BITBUCKET_TAG environment variables available to you. There are also a bunch of other useful variables, you can fine the full list here: Variables in pipelines.

Like gdmacmillan likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,031 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you