Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

running into "LOCAL_PATH must be a directory." issue

gdmacmillan July 4, 2019

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
Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 4, 2019

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. 

gdmacmillan July 5, 2019

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?

gdmacmillan July 5, 2019

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).

Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 6, 2019

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
AUG Leaders

Atlassian Community Events