Sign inSign up

arigaio/atlasci-pipe

By arigaio

•Updated about 4 years ago

Run `atlasci` on Bitbucket Pipelines.

Image
0

1.2K

arigaio/atlasci-pipe repository overview

⁠Bitbucket Pipelines Pipe: AtlasCI pipe

https://bitbucket.org/ariga-bot/atlasci-pipe/src/master/⁠

This pipe is used to run atlasci on a Bitbucket Pipelines environment.

⁠YAML Definition

Add the following snippet to the script section of your bitbucket-pipelines.yml file:

- step:
  script:
    - pipe: docker://arigaio/atlasci-pipe:latest
      variables:
        ATLASCI_DIR: "<string>"
        ATLASCI_DEV_URL: "<string>"
        ARIGA_TOKEN: "<string>"
        FAIL_ON_ERRORS: "<true/false>" # defaults to false
        ATLASCI_LATEST_COUNT: "<int>" # defaults to 1
  condition:
    changesets:
      includePaths:
        # same ATLASCI_DIR        
        - "<string>/**"

⁠Required Variables

VariableUsage
ATLASCI_DIR (*)Migrations directory relative to the repository root
ATLASCI_DEV_URL (*)Data source using the atlas URL format.
ARIGA_TOKENToken for sending the report to the cloud.
FAIL_ON_ERRORSShould the build fail if Atlas CI finds SQL errors? (default: false)
ATLASCI_LATEST_COUNTRun analysis on the latest N migration files.
If set to "0" the pipe will compare between source and base branch. (default: 1)

Note that setting "ATLASCI_LATEST_COUNT" to zero is opt-in. In future versions, this will be the default.

⁠Prerequisites

  1. Bitbucket account Pipelines enabled (you will need to enable MFA for this).
  2. Repository in Bitbucket with Atlas migrations directory.

⁠Examples

Example:

script:
  - pipe: docker://arigaio/atlasci-pipe:latest
    variables:
      # Migration directory relative to repo root
      ATLASCI_DIR: "migrations"
      ATLASCI_DEV_URL: "mysql://root:[email protected]:3306/"
      ARIGA_TOKEN: "TOKEN_STRING"
condition:
  changesets:
    includePaths:
      - "migrations/**"
services:
  - mysql

# MySQL service definition example:
definitions:
  services:
    mysql:
      image: mysql:8
      variables:
        MYSQL_ROOT_PASSWORD: pass

⁠Support

If you’d like help with this pipe, or you have an issue or feature request, let us know. The pipe is maintained by [email protected]⁠.

If you’re reporting an issue, please include:

  • The version of the pipe
  • Relevant logs and error messages
  • Steps to reproduce

Tag summary

Content type

Image

Digest

sha256:04ff1795c…

Size

114.6 MB

Last updated

about 4 years ago

docker pull arigaio/atlasci-pipe