How to use bitbucket - 6 common examples

To help you get started, we’ve selected a few bitbucket examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github naholyr / github-todos / lib / issue-service / bitbucket.js View on Github external
function connect (conf) {
  if (conf["bitbucket.secret"] && conf["bitbucket.key"]) {
    var oauth = {
      "consumer_key":     conf["bitbucket.key"],
      "consumer_secret":  conf["bitbucket.secret"]
    };

    return checkOAuth(oauth).then(null, createOAuth);
  } else {
    // No token found: create new one
    return createOAuth();
  }
}
github naholyr / github-todos / lib / issue-service / bitbucket.js View on Github external
function connect (conf) {
  if (conf["bitbucket.secret"] && conf["bitbucket.key"]) {
    var oauth = {
      "consumer_key":     conf["bitbucket.key"],
      "consumer_secret":  conf["bitbucket.secret"]
    };

    return checkOAuth(oauth).then(null, createOAuth);
  } else {
    // No token found: create new one
    return createOAuth();
  }
}
github naholyr / github-todos / lib / issue-service / bitbucket.js View on Github external
function connect (conf) {
  if (conf["bitbucket.secret"] && conf["bitbucket.key"]) {
    var oauth = {
      "consumer_key":     conf["bitbucket.key"],
      "consumer_secret":  conf["bitbucket.secret"]
    };

    return checkOAuth(oauth).then(null, createOAuth);
  } else {
    // No token found: create new one
    return createOAuth();
  }
}
github DXHeroes / dx-scanner / src / services / bitbucket / BitbucketService.ts View on Github external
constructor(@inject(Types.ArgumentsProvider) argumentsProvider: ArgumentsProvider) {
    this.cache = new InMemoryCache();

    // const clientOptions = {
    //   baseUrl: 'https://api.bitbucket.org/2.0',
    //   headers: {},
    //   options: {
    //     timeout: 10,
    //   },
    // };

    this.client = new Bitbucket();

    let auth: Bitbucket.Auth;
    if (argumentsProvider.auth) {
      auth = { type: 'token', token: argumentsProvider.auth };
      this.client.authenticate(auth);
    }
  }
github christiangalsterer / bitbucket-asciidoc-plugin / src / main / resources / static / asciidoc-handler / asciidoc-handler.js View on Github external
deferred.resolve(view);
            }).fail(function() {
                console.log('error while asynchronously loading asciidoc-view resources');
                return deferred.reject();
            });

            return deferred;
        }

        return false;
    }
});


require('bitbucket/feature/files/file-handlers').register({
    weight: 900,
    handle: function(options) {
        return require('asciidoc/asciidoc-handler').apply(this, arguments);
    }
});
github ParameterizedBuilds / parameterized-builds / src / main / resources / scripts / jenkins / pb-pr-trigger.js View on Github external
$(".parameterized-build-pullrequest").click(function() {
        var prJSON = require('bitbucket/internal/model/page-state').getPullRequest().toJSON();
        var branch = prJSON.fromRef.id;
        var commit = prJSON.fromRef.latestCommit;
        var prDest = prJSON.toRef.displayId;

        var resourceUrl = getResourceUrl("getJobs") + "?branch=" + encodeURIComponent(branch) + "&commit=" + commit + "&prdestination=" + encodeURIComponent(prDest) + "&prid=" + prJSON.id;

        return $.when(getJobs(resourceUrl)).then(function( jobs ) {
            allJobs = jobs
            if (jobs.length == 1){
                if (jobs[0].buildParameters.length == 0){
                    var splitBranch = branch.split("/")
                    splitBranch.splice(0, 2) //remove ref/heads or ref/tags
                    var branchName = splitBranch.join("%2F")
                    var buildUrl = getResourceUrl("triggerBuild/0/" + encodeURIComponent(branchName));
                    triggerBuild(buildUrl);
                    return false;

bitbucket

Bitbucket API client for Browser and Node.js

MIT
Latest version published 6 months ago

Package Health Score

64 / 100
Full package analysis