This package has been deprecated

Author message:

The package @aws-sdk/client-codebuild-browser has been renamed to @aws-sdk/client-codebuild. Please install the renamed package.

@aws-sdk/client-codebuild-browser
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-preview.2 • Public • Published

@aws-sdk/client-codebuild-browser

NPM version NPM downloads

Description

AWS CodeBuild

AWS CodeBuild is a fully managed build service in the cloud. AWS CodeBuild compiles your source code, runs unit tests, and produces artifacts that are ready to deploy. AWS CodeBuild eliminates the need to provision, manage, and scale your own build servers. It provides prepackaged build environments for the most popular programming languages and build tools, such as Apache Maven, Gradle, and more. You can also fully customize build environments in AWS CodeBuild to use your own build tools. AWS CodeBuild scales automatically to meet peak build requests. You pay only for the build time you consume. For more information about AWS CodeBuild, see the AWS CodeBuild User Guide.

AWS CodeBuild supports these operations:

  • BatchDeleteBuilds: Deletes one or more builds.

  • BatchGetProjects: Gets information about one or more build projects. A build project defines how AWS CodeBuild runs a build. This includes information such as where to get the source code to build, the build environment to use, the build commands to run, and where to store the build output. A build environment is a representation of operating system, programming language runtime, and tools that AWS CodeBuild uses to run a build. You can add tags to build projects to help manage your resources and costs.

  • CreateProject: Creates a build project.

  • CreateWebhook: For an existing AWS CodeBuild build project that has its source code stored in a GitHub or Bitbucket repository, enables AWS CodeBuild to start rebuilding the source code every time a code change is pushed to the repository.

  • UpdateWebhook: Changes the settings of an existing webhook.

  • DeleteProject: Deletes a build project.

  • DeleteWebhook: For an existing AWS CodeBuild build project that has its source code stored in a GitHub or Bitbucket repository, stops AWS CodeBuild from rebuilding the source code every time a code change is pushed to the repository.

  • ListProjects: Gets a list of build project names, with each build project name representing a single build project.

  • UpdateProject: Changes the settings of an existing build project.

  • BatchGetBuilds: Gets information about one or more builds.

  • ListBuilds: Gets a list of build IDs, with each build ID representing a single build.

  • ListBuildsForProject: Gets a list of build IDs for the specified build project, with each build ID representing a single build.

  • StartBuild: Starts running a build.

  • StopBuild: Attempts to stop running a build.

  • ListCuratedEnvironmentImages: Gets information about Docker images that are managed by AWS CodeBuild.

  • DeleteSourceCredentials: Deletes a set of GitHub, GitHub Enterprise, or Bitbucket source credentials.

  • ImportSourceCredentials: Imports the source repository credentials for an AWS CodeBuild project that has its source code stored in a GitHub, GitHub Enterprise, or Bitbucket repository.

  • ListSourceCredentials: Returns a list of SourceCredentialsInfo objects. Each SourceCredentialsInfo object includes the authentication type, token ARN, and type of source provider for one set of credentials.

Installing

To install the this package using NPM, simply type the following into a terminal window:

npm install @aws-sdk/client-codebuild-browser

Getting Started

Import

The AWS SDK is modulized by clients and commands in CommonJS modules. To send a request, you only need to import the client(CodeBuildClient) and the commands you need, for example BatchDeleteBuildsCommand:

//JavaScript
const {
  CodeBuildClient
} = require("@aws-sdk/client-codebuild-browser/CodeBuildClient");
const {
  BatchDeleteBuildsCommand
} = require("@aws-sdk/client-codebuild-browser/commands/BatchDeleteBuildsCommand");
//TypeScript
import { CodeBuildClient } from "@aws-sdk/client-codebuild-browser/CodeBuildClient";
import { BatchDeleteBuildsCommand } from "@aws-sdk/client-codebuild-browser/commands/BatchDeleteBuildsCommand";

Usage

To send a request, you:

  • Initiate client with configuration (e.g. credentials, region). For more information you can refer to the API reference.
  • Initiate command with input parameters.
  • Call send operation on client with command object as input.
  • If you are using a custom http handler, you may call destroy() to close open connections.
const codeBuild = new CodeBuildClient({ region: "region" });
//clients can be shared by different commands
const params = {
  ids: [
    /**a list of string*/
  ]
};
const batchDeleteBuildsCommand = new BatchDeleteBuildsCommand(params);
codeBuild
  .send(batchDeleteBuildsCommand)
  .then(data => {
    // do something
  })
  .catch(error => {
    // error handling
  });

In addition to using promises, there are 2 other ways to send a request:

// async/await
try {
  const data = await codeBuild.send(batchDeleteBuildsCommand);
  // do something
} catch (error) {
  // error handling
}
// callback
codeBuild.send(batchDeleteBuildsCommand, (err, data) => {
  //do something
});

The SDK can also send requests using the simplified callback style from version 2 of the SDK.

import * as AWS from "@aws-sdk/@aws-sdk/client-codebuild-browser/CodeBuild";
const codeBuild = new AWS.CodeBuild({ region: "region" });
codeBuild.batchDeleteBuilds(params, (err, data) => {
  //do something
});

Troubleshooting

When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).

try {
  const data = await codeBuild.send(batchDeleteBuildsCommand);
  // do something
} catch (error) {
  const metadata = error.$metadata;
  console.log(
    `requestId: ${metadata.requestId}
cfId: ${metadata.cfId}
extendedRequestId: ${metadata.extendedRequestId}`
  );
  /*
The keys within exceptions are also parsed. You can access them by specifying exception names:
    if(error.name === 'SomeServiceException') {
        const value = error.specialKeyInException;
    }
*/
}

Getting Help

Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests and have limited bandwidth to address them.

  • Ask a question on StackOverflow and tag it with aws-sdk-js
  • Come join the AWS JavaScript community on gitter
  • If it turns out that you may have found a bug, please open an issue

Contributing

This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/@aws-sdk/client-codebuild-browser' package is updated. To contribute to SDK you can checkout our code generator package.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Readme

Keywords

none

Package Sidebar

Install

npm i @aws-sdk/client-codebuild-browser

Weekly Downloads

1

Version

0.1.0-preview.2

License

Apache-2.0

Unpacked Size

430 kB

Total Files

702

Last publish

Collaborators

  • mattsb42-aws
  • kuhe
  • amzn-oss
  • aws-sdk-bot
  • trivikr-aws