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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
for example in travis there is TRAVIS_BRANCH
:
for builds triggered by a tag, this is the same as the name of the tag (TRAVIS_TAG
).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Justin Nordstrom I saw you made this work in your issue here: https://community.atlassian.com/t5/Bitbucket-Pipelines-questions/LOCAL-PATH-must-be-a-directory/qaq-p/1006175
Any tips?
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.