Support Bitbucket CI Provider
MehranShafqat opened this issue · comments
Please provide some suggestion and how I can integrate it with Bitbucket. In our case our version control and Build all on bitbucket.
Yes I use it with bitbucket at work. Just pass the --vcs-provider bitbucket
cli flag
Btw did you mean you use bitbucket rather than circleci for your ci builds too?
You would need to add support for the CI_ prefixed variables for bitbucket. If you can find a list of the env vars which are available to a build runner I can map them
@YOU54F yes Im using bitbucket as our CI build tool as well im not using circle CI. If you please guide me which variables you required and which configuration so I can provide
You need to find env vars that relate to the following
let {
CI_SHA1,
CI_BRANCH,
CI_USERNAME,
CI_BUILD_URL,
CI_BUILD_NUM,
CI_PULL_REQUEST,
CI_PROJECT_REPONAME,
CI_PROJECT_USERNAME,
CI_URL,
CI_CIRCLE_JOB,
} = process.env;
and these can be mapped in this switch block (with a new entry for bitbucket
@YOU54F This will help us please have a look
https://support.atlassian.com/bitbucket-cloud/docs/variables-in-pipelines/
Cheers mate, thats useful.
will make changes when I get some time. I have a bitbucket account so will try and set a pipeline up so I can test it properly
Thanks @YOU54F please try to add this support asap very much required more CI build tools integration
I started having a look yesterday, however there are quite a few variables that aren’t present in bitbucket so I may need to use git to query these ( for committing author amongst others ) and I need to find out the project paths to building links to the build and report.
Will need to set up a bitbucket pipeline to experiment
I have a lot of stuff on so may not be able to look at this in a timely manner but happy to accept a pull request
I started to look at this @MehranShafqat Does BB allow you to store artefacts or do you store them externally?
most of the env vars aren't available but I have something working in https://bitbucket.org/YOU54F/cypress-slack-reporter/src/bitbucketCI/
Here is my bitbucket pipelines that I am testing against
https://bitbucket.org/YOU54F/cypress-slack-reporter/src/bitbucketCI/bitbucket-pipelines.yml
Initial support added in v1.0.1
There isn't many git variables available in bitbucket for the git url but I should be able to construct these from the repo name.
Build urls are pretty predictable to be able to construct https://bitbucket.org/YOU54F/cypress-slack-reporter/addon/pipelines/home#!/results/15
Thank you so much @YOU54F going to try it
@YOU54F BB allow me to store the artefacts for 14 days for experimental we can use this, further maybe I will store it on S3 or some external storage
closing this now until we get further feedback. you can provide your artefact url with the customUrl cli parameter 👍🏽 whether it is BB or S3, you just need to pass your base path