Metadata-Version: 2.1
Name: jenkins-backup-s3
Version: 0.1.8
Summary: Backup Jenkins to S3
Home-page: http://github.com/artsy/jenkins-backup-s3
Author: Isac Petruzzi
Author-email: isac@artsymail.com
License: MIT
Platform: UNKNOWN
Description-Content-Type: text/markdown
Requires-Dist: boto3 (==1.4.7)
Requires-Dist: botocore (==1.7.19)
Requires-Dist: click (==6.7)
Requires-Dist: colorama (==0.3.9)
Requires-Dist: docutils (==0.14)
Requires-Dist: jmespath (==0.9.3)
Requires-Dist: python-dateutil (==2.6.1)
Requires-Dist: s3transfer (==0.1.11)
Requires-Dist: six (==1.11.0)
Requires-Dist: termcolor (==1.1.0)

# jenkins-backup-s3

A collection of scripts to backup Jenkins configuration to S3, as well as manage and restore those backups. By default
runs silently (no output) with proper exit codes. Log Level option enables output.

## Setup

`pip install jenkins-backup-s3`

### Configure S3 and IAM

- Create an S3 bucket to store backups.

- Create an IAM role with STS:AssumeRole and a trust Service ec2.amazonaws.com.  The IAM role must have the `GetObject`, `CreateObject`, `DeleteObject` and `ListBucket` S3 permissions for that bucket.

## Usage

Setup with cron for ideal usage.

`backup-jenkins {OPTIONS} {COMMAND} {COMMAND_OPTIONS}`

Options can be set directly or via and environment variable.

The only required option is your S3 bucket:
  - `backup-jenkins --bucket={BUCKET_NAME}`

Other available options are:

Bucket prefix (defaults to "jenkins-backups"):
  - `backup-jenkins --bucket-prefix={BUCKET_PREFIX}`

Bucket region (defaults to "us-east-1"):
  - `backup-jenkins --bucket-region={BUCKET_REGION}`

Available commands:
  - `create`
  - `restore`
  - `list`
  - `delete`
  - `prune`

Run `backup-jenkins {COMMAND} --help` for command-specific options.

## Running a daily backup on Jenkins

Create a new item in Jenkins and configure a build of this repository.

Set the shell / virtualenv builder (if you have it installed) to run `backup-jenkins create`.

Set the build on a daily CRON schedule.


