Skip to content

Commit

Permalink
Bitbucket docs
Browse files Browse the repository at this point in the history
  • Loading branch information
davegaeddert committed Sep 9, 2019
1 parent 3a55911 commit 01f356f
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/content/_sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h3 class="mb-2 font-medium text-gray-700">CI Providers</h3>
<li><a class="no-underline hover:underline inline-block py-1 text-gray-600 hover:text-black" href="/travisci/">TravisCI</a></li>
<li><a class="no-underline hover:underline inline-block py-1 text-gray-600 hover:text-black" href="/gitlab-ci/">GitLab CI</a></li>
<li><a class="no-underline hover:underline inline-block py-1 text-gray-600 hover:text-black" href="/github-actions/">GitHub Actions</a></li>
<li><a class="no-underline hover:underline inline-block py-1 text-gray-600 hover:text-black" href="/bitbucket-pipelines/">Bitbucket Pipelines</a></li>
<li><a class="no-underline hover:underline inline-block py-1 text-gray-600 hover:text-black" href="/jenkins/">Jenkins</a></li>
<li><a class="no-underline hover:underline inline-block py-1 text-gray-600 hover:text-black" href="/other-ci/">Other</a></li>
</ul>
Expand All @@ -20,7 +21,7 @@ <h3 class="mb-2 font-medium text-gray-700">Git Hosts</h3>
<ul class="mb-4">
<li><a class="no-underline hover:underline inline-block py-1 text-gray-600 hover:text-black" href="/github/">GitHub</a></li>
<li><a class="no-underline hover:underline inline-block py-1 text-gray-600 hover:text-black" href="/gitlab/">GitLab</a></li>
<li><a class="no-underline hover:underline inline-block py-1 text-gray-600 hover:text-black" href="/bitbucket/">BitBucket*</a></li>
<li><a class="no-underline hover:underline inline-block py-1 text-gray-600 hover:text-black" href="/bitbucket/">Bitbucket</a></li>
</ul>

<h3 class="mb-2 font-medium text-gray-700">Dependency Types</h3>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions docs/content/bitbucket-pipelines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: Bitbucket Pipeilnes
description: Examples and instructions for setting up deps in Bitbucket Pipelines
---

# Bitbucket Pipelines

## 1. Add deps to bitbucket-pipelines.yml

Add a custom pipeline so that it will only run from a schedule.

This example shows two different languages in use,
each running in their own container. The `--type` option is used to run the specific language updates in their respective containers.

> Note: Bitbucket Pipelines are supported by [CI autoconfigure](/ci/#autoconfigure).
A minimal example of using deps in `bitbucket-pipelines.yml` would look like this:

```yaml
clone:
depth: full

pipelines:
custom:
deps:
- parallel:
- step:
image: "python:3.7"
script:
- curl https://www.dependencies.io/install.sh | bash -s -- -b $HOME/bin
- $HOME/bin/deps ci --type python
- step:
image: "node:latest"
script:
- curl https://www.dependencies.io/install.sh | bash -s -- -b $HOME/bin
- $HOME/bin/deps ci --type js
```
## 2. Set the pipeline repository variables
For a standard Bitbucket repo, you will need a `DEPS_TOKEN`, `DEPS_BITBUCKET_USERNAME`, and `DEPS_BITBUCKET_PASSWORD`.

[![Bitbucket pipeline variables for deps](/assets/img/screenshots/bitbucket-pipeline-variables.png)](/assets/img/screenshots/bitbucket-pipeline-variables.png)

## 3. Create a pipeline schedule

Create a daily or weekly schedule to run your new deps pipeline.

[![Bitbucket pipeline schedule for deps](/assets/img/screenshots/bitbucket-pipeline-schedule.png)](/assets/img/screenshots/bitbucket-pipeline-schedule.png)

## 4. Test the pipeline manually

If you want to test your new pipeline without waiting for the schedule,
just navigate to the commit view and click "run pipeline".

[![Bitbucket pipeline manual run for deps](/assets/img/screenshots/bitbucket-pipeline-manual.png)](/assets/img/screenshots/bitbucket-pipeline-manual.png)
41 changes: 39 additions & 2 deletions docs/content/bitbucket.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
# BitBucket
# Bitbucket

> Docs coming soon!
To give deps write-access to your repo and pull requests, you'll create an *app password*.
You can use your personal account to do this, or a "bot" account that your team has.

## App password

1. Log in with the account you want deps to use (this will be the author of deps pull requests)
1. Give it access to the repo you're setting up
1. Generate a new app password with the repositories and pull requests `write` scopes
[![Bitbucket app password settings for deps](/assets/img/screenshots/bitbucket-app-password.png)](/assets/img/screenshots/bitbucket-app-password.png)
1. Set the required environment variables in your CI
- `DEPS_BITBUCKET_USERNAME` to the user who owns the app password
- `DEPS_BITBUCKET_PASSWORD` to the app password from above

## Pull request settings

When working with a Bitbucket repo,
there are a few settings you can use to determine what your pull requests look like.

```yaml
version: 3
dependencies:
- type: python
settings:
bitbucket_destination: "dev" # branch name
bitbucket_close_source_branch: true
bitbucket_reviewers:
- uuid: "{504c3b62-8120-4f0c-a7bc-87800b9d6f70}"
```
If you don't need a `deps.yml` then you can also configure these settings via environment variables.
This is an easy way to put settings directly in your CI config.

Note that they'll need to be in the format of a JSON-encoded string,
with an uppercase name prefixed by `DEPS_SETTING_`.

```sh
$ DEPS_SETTING_BITBUCKET_CLOSE_SOURCE_BRANCH='true' deps ci
```

0 comments on commit 01f356f

Please sign in to comment.