Skip to content

docs(platform/codecommit): rewrite and mention deprecation #30479

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 55 additions & 52 deletions lib/modules/platform/codecommit/readme.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,78 @@
# AWS CodeCommit

<!-- prettier-ignore -->
!!! warning "No new features for the Codecommit platform"
Amazon has deprecated the Codecommit platform.
We will not work on new features for the Codecommit platform.
Read the [AWS blog, how to migrate your AWS Codecommit repository](https://aws.amazon.com/blogs/devops/how-to-migrate-your-aws-codecommit-repository-to-another-git-provider/) to learn more.

<!-- prettier-ignore -->
!!! warning "This feature is flagged as experimental"
Experimental features might be changed or even removed at any time.
Subscribe to [GitHub issue #2868](https://github.com/renovatebot/renovate/issues/2868) to be notified of any changes.

## Authentication

### IAM Role

#### Machine pre-requisites

1. `aws-cli` installed.
2. Set up the environment with `git-credentials-helper`.
EC2/linux: [EC2 codecommit git integration](https://aws.amazon.com/premiumsupport/knowledge-center/codecommit-git-repositories-ec2/).
1. Install the `aws-cli` program on the machine.
2. Set up the environment with the `git-credentials-helper`:

windows: [windows codecommit git integration](https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-windows.html).
- For EC2 or Linux: [EC2 codecommit git integration](https://aws.amazon.com/premiumsupport/knowledge-center/codecommit-git-repositories-ec2/).
- For Windows: [windows codecommit git integration](https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-windows.html).

3. Set the environment variable `AWS_REGION`.

#### Codebuild Configuration

add `git-credential-helper` to your `buildspec.yml`.

```yaml
```yaml title="Add git-credential helper to your buildspec.yml file"
env: git-credential-helper:yes
```

### IAM User

First, you must get an AWS [IAM Access Key id and a Secret access key id](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html)
First, you must get an AWS [IAM Access Key id and a Secret access key id](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).
After that, let Renovate use the AWS CodeCommit authentication keys, by picking _one_ of these methods:

Let Renovate use AWS CodeCommit authentication keys by doing one of the following:
- Create a Renovate config file (`config.js`)
- Set the environment with all required AWS environment variables
- Set AWS credentials with CLI parameters

- Set a Renovate configuration file - `config.js`:
#### Method 1: Create a Renovate config file (`config.js`)

```
username: AWS IAM access key id
password: AWS Secret access key
endpoint: the URL endpoint e.g https://git-codecommit.us-east-1.amazonaws.com/
token: AWS session token, if you have one
```
```
username: AWS IAM access key id
password: AWS Secret access key
endpoint: the URL endpoint e.g https://git-codecommit.us-east-1.amazonaws.com/
token: AWS session token, if you have one
```

- Set up the environment with all required AWS environment variables:
#### Method 2: Set the environment with all required AWS environment variables

```
AWS_ACCESS_KEY_ID: AWS IAM access key id
AWS_SECRET_ACCESS_KEY: AWS Secret access key
AWS_REGION: the AWS region e.g us-east-1
AWS_SESSION_TOKEN: AWS session token, if you have one
```
```
AWS_ACCESS_KEY_ID: AWS IAM access key id
AWS_SECRET_ACCESS_KEY: AWS Secret access key
AWS_REGION: the AWS region e.g us-east-1
AWS_SESSION_TOKEN: AWS session token, if you have one
```

- Set up AWS credentials using CLI parameters:
#### Method 3: Set AWS credentials with CLI parameters

```
--username: AWS IAM access key id
--password: AWS Secret access key
--endpoint: the URL endpoint for example https://git-codecommit.us-east-1.amazonaws.com/
--token: AWS session token, if you have one
```
```
--username: AWS IAM access key id
--password: AWS Secret access key
--endpoint: the URL endpoint for example https://git-codecommit.us-east-1.amazonaws.com/
--token: AWS session token, if you have one
```

## Permissions

Create a new AWS policy for renovate with these permissions, then attach it to the user/role.

Change the `Resource` value to the resources you want to use.
Create a new AWS policy for Renovate with these permissions, then attach it to the user/role.

The policy json.
Change the `Resource` value to the resources you want to use:

```json
```json title="Example policy JSON file"
{
"Version": "2012-10-17",
"Statement": [
Expand Down Expand Up @@ -100,31 +104,31 @@ The policy json.

## Running Renovate

Set up a global configuration file (`config.js`), or use CLI parameters or environment variables, to run Renovate on CodeCommit:
Once you have followed method 1, 2 or 3, _and_ have set up the permissions, you're ready to configure Renovate:

- Set `platform: 'codecommit'`
- Set `repositories: ['{repository, names, separated, by, comma}']`, or use [Renovate’s `autodiscover` feature](../../../self-hosted-configuration.md#autodiscover)

Run Renovate and it will process your repositories.
You're ready to run Renovate now, and it will process your repositories.

## Unsupported platform features/concepts

These features are not supported:
These Renovate features are not supported on Codecommit:

- Adding assignees to PRs
- Auto-merge
- Automerge
- [`rebaseLabel`](../../../configuration-options.md#rebaselabel) (request a rebase for Renovate)

## Recommendations

- We recommend that you limit the number of open Renovate PRs by setting a `prConcurrentLimit`
- Due to current platform limitations, if you close a PR but don’t want for Renovate to recreate the PR, use [package rules](../../../configuration-options.md#packagerules) with the `"enabled": false` key
Limit the number of open Renovate PRs by setting a `prConcurrentLimit`.

## Example configuration
If you close a PR but don’t want Renovate to recreate the PR later, then use [package rules](../../../configuration-options.md#packagerules) with the `"enabled": false` key.
This workaround is needed due to platform limitations.

Here's an example `config.js`:
## Example configuration

```js
```js title="Example config.js file"
module.exports = {
endpoint: 'https://git-codecommit.us-east-1.amazonaws.com/',
platform: 'codecommit',
Expand All @@ -144,12 +148,12 @@ module.exports = {

## CodeBuild examples

Create a repository with `buildspec.yml`.
Create a repository with a `buildspec.yml` file in it.
This repository will be your BuildProject job repository to run Renovate on your repositories.

### Renovate Docker `buildspec.yml`

```yml
```yml title="Example buildspec.yml file"
version: 0.2
env:
shell: bash
Expand All @@ -169,7 +173,7 @@ phases:

### Renovate CLI `buildspec.yml`

```yml
```yml title="Example buildspec.yml file"
version: 0.2
env:
shell: bash
Expand All @@ -190,10 +194,9 @@ phases:

### Notes

In order to reduce Renovate BuildProject time and avoid `npm install`.

We recommend you install Renovate on the BuildProject Renovate job repository.
To keep BuildProject processing times reasonable, we recommend that you install Renovate on the BuildProject Renovate job repository.
This also avoids running the `npm install` command.

You can add `config.js` global config to the repository.
You can add the `config.js` global config to the repository.

You can add the BuildProject repository to the `RENOVATE_REPOSITORIES` variable and get updates on new Renovate versions.