Skip to content

Commit

Permalink
[WIP] AWS S3 backup
Browse files Browse the repository at this point in the history
- add backup type to API
- add AWS S3 backup configuration to API
  • Loading branch information
tomaszsek committed Jan 15, 2019
1 parent ca2817a commit e507d23
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
26 changes: 24 additions & 2 deletions pkg/apis/virtuslab/v1alpha1/jenkins_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,30 @@ import (
type JenkinsSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
Master JenkinsMaster `json:"master,omitempty"`
SeedJobs []SeedJob `json:"seedJobs,omitempty"`
Backup JenkinsBackup `json:"backup,omitempty"`
BackupAmazonS3 JenkinsBackupAmazonS3 `json:"backupAmazonS3,omitempty"`
Master JenkinsMaster `json:"master,omitempty"`
SeedJobs []SeedJob `json:"seedJobs,omitempty"`
}

// JenkinsBackup defines type of Jenkins backup
type JenkinsBackup string

const (
// JenkinsBackupTypeNoBackup tells that Jenkins won't backup jobs
JenkinsBackupTypeNoBackup = "NoBackup"
// JenkinsBackupTypeAmazonS3 tells that Jenkins will backup jobs into AWS S3 bucket
JenkinsBackupTypeAmazonS3 = "AmazonS3"
)

// AllowedJenkinsBackups consists allowed Jenkins backup types
var AllowedJenkinsBackups = []JenkinsBackup{JenkinsBackupTypeNoBackup, JenkinsBackupTypeAmazonS3}

// JenkinsBackupAmazonS3 defines backup configuration to AWS S3 bucket
type JenkinsBackupAmazonS3 struct {
BucketName string `json:"bucketName,omitempty"`
BucketPath string `json:"bucketPath,omitempty"`
Region string `json:"region,omitempty"`
}

// JenkinsMaster defines the Jenkins master pod attributes and plugins,
Expand Down
17 changes: 17 additions & 0 deletions pkg/apis/virtuslab/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e507d23

Please sign in to comment.