Skip to content

Collect PR variables from BitBucket pipelines #15081

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bahmutov opened this issue Feb 12, 2021 · 2 comments · Fixed by #15082
Closed

Collect PR variables from BitBucket pipelines #15081

bahmutov opened this issue Feb 12, 2021 · 2 comments · Fixed by #15082
Assignees
Labels
CI General issues involving running in a CI provider

Comments

@bahmutov
Copy link
Contributor

If the user has enabled Bitbucket pipeline pullrequest builds then there are few more environment variables available with PR number In particular these variables are added to the PR builds

BITBUCKET_PR_DESTINATION_BRANCH
BITBUCKET_PR_DESTINATION_COMMIT
BITBUCKET_PR_ID

For example see https://bitbucket.org/bahmutov/pr-example/addon/pipelines/home#!/

Screen Shot 2021-02-12 at 3 02 37 PM

Additional variables with prefix BITBUCKET in the PR build

BITBUCKET_PR_DESTINATION_BRANCH=main
BITBUCKET_PR_DESTINATION_COMMIT=1863c1de7067
BITBUCKET_PR_ID=1

All PR variables

BITBUCKET_BRANCH=another-branch
BITBUCKET_BUILD_NUMBER=8
BITBUCKET_CLONE_DIR=/opt/atlassian/pipelines/agent/build
BITBUCKET_COMMIT=8e855becb748
BITBUCKET_DOCKER_HOST_INTERNAL=10.36.7.169
BITBUCKET_GIT_HTTP_ORIGIN=http://bitbucket.org/bahmutov/pr-example
BITBUCKET_GIT_SSH_ORIGIN=git@bitbucket.org:bahmutov/pr-example.git
BITBUCKET_PIPELINE_UUID={10a9a146-613f-41af-8237-402f73df4a32}
BITBUCKET_PROJECT_KEY=PREX
BITBUCKET_PROJECT_UUID={9fd62e61-aba5-42f4-ba08-a869a57919a9}
BITBUCKET_PR_DESTINATION_BRANCH=main
BITBUCKET_PR_DESTINATION_COMMIT=1863c1de7067
BITBUCKET_PR_ID=1
BITBUCKET_REPO_FULL_NAME=bahmutov/pr-example
BITBUCKET_REPO_IS_PRIVATE=false
BITBUCKET_REPO_OWNER=bahmutov
BITBUCKET_REPO_OWNER_UUID={e90bb6ae-d39d-4ce5-b77b-84b895d08354}
BITBUCKET_REPO_SLUG=pr-example
BITBUCKET_REPO_UUID={ee273e00-5607-4c77-a29e-777511232cb6}
BITBUCKET_STEP_RUN_NUMBER=1
BITBUCKET_STEP_TRIGGERER_UUID={e90bb6ae-d39d-4ce5-b77b-84b895d08354}
BITBUCKET_STEP_UUID={989dd55d-231b-4c46-a325-59ea39479d18}
BITBUCKET_WORKSPACE=bahmutov

Normal push commit variables on the same branch

BITBUCKET_BRANCH=another-branch
BITBUCKET_BUILD_NUMBER=7
BITBUCKET_CLONE_DIR=/opt/atlassian/pipelines/agent/build
BITBUCKET_COMMIT=8e855becb748a72c49e63c9641bcd38cc7ba836f
BITBUCKET_DOCKER_HOST_INTERNAL=10.36.7.170
BITBUCKET_GIT_HTTP_ORIGIN=http://bitbucket.org/bahmutov/pr-example
BITBUCKET_GIT_SSH_ORIGIN=git@bitbucket.org:bahmutov/pr-example.git
BITBUCKET_PIPELINE_UUID={ae0b0fd7-2d25-493d-a713-115e9000186c}
BITBUCKET_PROJECT_KEY=PREX
BITBUCKET_PROJECT_UUID={9fd62e61-aba5-42f4-ba08-a869a57919a9}
BITBUCKET_REPO_FULL_NAME=bahmutov/pr-example
BITBUCKET_REPO_IS_PRIVATE=false
BITBUCKET_REPO_OWNER=bahmutov
BITBUCKET_REPO_OWNER_UUID={e90bb6ae-d39d-4ce5-b77b-84b895d08354}
BITBUCKET_REPO_SLUG=pr-example
BITBUCKET_REPO_UUID={ee273e00-5607-4c77-a29e-777511232cb6}
BITBUCKET_STEP_RUN_NUMBER=1
BITBUCKET_STEP_TRIGGERER_UUID={e90bb6ae-d39d-4ce5-b77b-84b895d08354}
BITBUCKET_STEP_UUID={6b2bf3bf-e767-4cbd-9dd7-4ff3b7f55005}
BITBUCKET_WORKSPACE=bahmutov
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 14, 2021

The code for this is done in cypress-io/cypress#15082, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@bahmutov
Copy link
Contributor Author

bahmutov commented Apr 7, 2021

released in v6.5.0

@cypress-io cypress-io locked as resolved and limited conversation to collaborators May 5, 2021
@jennifer-shehane jennifer-shehane added CI General issues involving running in a CI provider and removed CI: bitbucket pipeline labels Oct 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI General issues involving running in a CI provider
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants